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