From 18a212f2c8a75596d6ef39c4d29c018383e6089a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 24 Feb 2004 14:15:43 +0000 Subject: (list_cert_colon): Print the fingerprint as the cert-id for root certificates. --- sm/keylist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sm/keylist.c') diff --git a/sm/keylist.c b/sm/keylist.c index 3ebbe3ba3..6d48068b0 100644 --- a/sm/keylist.c +++ b/sm/keylist.c @@ -249,21 +249,27 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity, /* FPR record */ fprintf (fp, "fpr:::::::::%s:::", fpr); - xfree (fpr); fpr = NULL; /* print chaining ID (field 13)*/ { ksba_cert_t next; + int rc; - if (!gpgsm_walk_cert_chain (cert, &next)) + rc = gpgsm_walk_cert_chain (cert, &next); + if (!rc) /* We known the issuer's certificate. */ { p = gpgsm_get_fingerprint_hexstring (next, GCRY_MD_SHA1); fputs (p, fp); xfree (p); ksba_cert_release (next); } + else if (rc == -1) /* We reached the root certificate. */ + { + fputs (fpr, fp); + } } putc (':', fp); putc ('\n', fp); + xfree (fpr); fpr = NULL; if (opt.with_key_data) -- cgit v1.2.3