From 697eae9c9dea6e0df37f20be7b637b30d1163b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 15 Sep 2006 05:50:17 +0000 Subject: [PATCH] Improve printing and error reporting. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18085 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/hxtool.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/hx509/hxtool.c b/lib/hx509/hxtool.c index cc3436def..51754088c 100644 --- a/lib/hx509/hxtool.c +++ b/lib/hx509/hxtool.c @@ -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;