Improve printing and error reporting.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18085 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-09-15 05:50:17 +00:00
parent d6ac5d5275
commit 697eae9c9d

View File

@@ -407,9 +407,13 @@ print_certificate(hx509_context hxcontext, hx509_cert cert, int verbose)
printf(" subject: \"%s\"\n", str);
free(str);
printf(" keyusage: ");
ret = hx509_cert_keyusage_print(hxcontext, cert, &str);
printf(" keyusage: %s\n", str);
free(str);
if (ret == 0) {
printf("%s\n", str);
free(str);
} else
printf("no");
if (verbose) {
hx509_validate_ctx vctx;
@@ -520,9 +524,11 @@ verify_f(hx509_context hxcontext, void *ctx, hx509_cert c)
int ret;
ret = hx509_verify_path(hxcontext, v->ctx, c, v->chain);
if (ret)
printf("verify_path returned %d\n", ret);
else
if (ret) {
char *s = hx509_get_error_string(hxcontext, ret);
printf("verify_path: %s: %d\n", s, ret);
free(s);
} else
printf("path ok\n");
return ret;