aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-03-28 16:36:25 +0000
committerWerner Koch <[email protected]>2002-03-28 16:36:25 +0000
commitf63676f9accc89e61d11f7271e567b29e31bd17c (patch)
tree6f6c524b9075949eb7ef10a2ba4fd7e7b06c5877
parent* card.c (card_open, card_close): Adjusted for changes in OpenSC. (diff)
downloadgnupg-f63676f9accc89e61d11f7271e567b29e31bd17c.tar.gz
gnupg-f63676f9accc89e61d11f7271e567b29e31bd17c.zip
* keylist.c (list_cert_colon): Fixed listing of crt record; the
issuer is not at the right place. Print a chainingID.
-rw-r--r--sm/ChangeLog5
-rw-r--r--sm/keylist.c30
2 files changed, 31 insertions, 4 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 4ef0102b0..c3abb574c 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-28 Werner Koch <[email protected]>
+
+ * keylist.c (list_cert_colon): Fixed listing of crt record; the
+ issuer is not at the right place. Print a chainingID.
+
2002-03-21 Werner Koch <[email protected]>
* export.c: New.
diff --git a/sm/keylist.c b/sm/keylist.c
index 6c57897de..bccb26b6e 100644
--- a/sm/keylist.c
+++ b/sm/keylist.c
@@ -62,7 +62,6 @@ print_capabilities (KsbaCert cert, FILE *fp)
putc ('E', fp);
putc ('S', fp);
putc ('C', fp);
- putc (':', fp);
}
@@ -137,14 +136,14 @@ list_cert_colon (KsbaCert cert, FILE *fp, int have_secret)
fprintf (fp, ":%u:%d::",
/*keylen_of_cert (cert)*/1024,
- /* pubkey_algo_of_cert (cert)*/'R');
+ /* pubkey_algo_of_cert (cert)*/1);
/* we assume --fixed-list-mode for gpgsm */
print_time ( ksba_cert_get_validity (cert, 0), fp);
putc (':', fp);
print_time ( ksba_cert_get_validity (cert, 1), fp);
putc (':', fp);
- putc (':', fp);
+ /* field 8, serial number: */
if ((sexp = ksba_cert_get_serial (cert)))
{
int len;
@@ -162,19 +161,42 @@ list_cert_colon (KsbaCert cert, FILE *fp, int have_secret)
xfree (sexp);
}
putc (':', fp);
+ /* field 9, ownertrust - not used here */
putc (':', fp);
+ /* field 10, old user ID - we use it here for the issuer DN */
if ((p = ksba_cert_get_issuer (cert,0)))
{
print_sanitized_string (fp, p, ':');
xfree (p);
}
putc (':', fp);
+ /* field 11, signature class - not used */
+ putc (':', fp);
+ /* field 12, capabilities: */
print_capabilities (cert, fp);
+ putc (':', fp);
putc ('\n', fp);
+ /* FPR record */
p = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1);
- fprintf (fp, "fpr:::::::::%s:\n", p);
+ fprintf (fp, "fpr:::::::::%s:::", p);
xfree (p);
+ /* print chaining ID (field 13)*/
+ {
+ KsbaCert next;
+
+ if (!gpgsm_walk_cert_chain (cert, &next))
+ {
+ p = gpgsm_get_fingerprint_hexstring (next, GCRY_MD_SHA1);
+ fputs (p, fp);
+ xfree (p);
+ ksba_cert_release (next);
+ }
+ }
+ putc (':', fp);
+ putc ('\n', fp);
+
+
if (opt.with_key_data)
{
if ( (p = gpgsm_get_keygrip_hexstring (cert)))