diff options
author | Werner Koch <wk@gnupg.org> | 2006-06-27 16:32:34 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2006-06-27 16:32:34 +0200 |
commit | 98c6970ad1c55d38d7e3d1ba4c97d01dacec281f (patch) | |
tree | aa65e4fe1d1e53aeba2b159b10d5212f0af52a68 /sm | |
parent | Ported patches from 1.4.x (diff) | |
download | gnupg2-98c6970ad1c55d38d7e3d1ba4c97d01dacec281f.tar.xz gnupg2-98c6970ad1c55d38d7e3d1ba4c97d01dacec281f.zip |
Various smaller changes
Diffstat (limited to 'sm')
-rw-r--r-- | sm/ChangeLog | 5 | ||||
-rw-r--r-- | sm/certchain.c | 2 | ||||
-rw-r--r-- | sm/certdump.c | 30 | ||||
-rw-r--r-- | sm/gpgsm.h | 2 | ||||
-rw-r--r-- | sm/keylist.c | 2 |
5 files changed, 40 insertions, 1 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog index f191e7512..97fa8cd89 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,3 +1,8 @@ +2006-06-26 Werner Koch <wk@g10code.com> + + * certdump.c (gpgsm_cert_log_name): New. + * certchain.c (is_cert_still_valid): Log the name of the certificate. + 2006-06-20 Werner Koch <wk@g10code.com> * gpgsm.c (gpgsm_init_default_ctrl): Take care of the command line diff --git a/sm/certchain.c b/sm/certchain.c index 4a4ac49f6..647adc030 100644 --- a/sm/certchain.c +++ b/sm/certchain.c @@ -597,6 +597,8 @@ is_cert_still_valid (ctrl_t ctrl, int lm, FILE *fp, { /* Fixme: We should change the wording because we may have used OCSP. */ + if (!lm) + gpgsm_cert_log_name (NULL, subject_cert); switch (gpg_err_code (err)) { case GPG_ERR_CERT_REVOKED: diff --git a/sm/certdump.c b/sm/certdump.c index 0d5146abc..2f7c1fd54 100644 --- a/sm/certdump.c +++ b/sm/certdump.c @@ -238,6 +238,36 @@ gpgsm_dump_cert (const char *text, ksba_cert_t cert) } +/* Log the certificate's name in "#SN/ISSUERDN" format along with + TEXT. */ +void +gpgsm_cert_log_name (const char *text, ksba_cert_t cert) +{ + log_info ("%s", text? text:"certificate" ); + if (cert) + { + ksba_sexp_t sn; + char *p; + + p = ksba_cert_get_issuer (cert, 0); + sn = ksba_cert_get_serial (cert); + if (p && sn) + { + log_printf (" #"); + gpgsm_dump_serial (sn); + log_printf ("/"); + gpgsm_dump_string (p); + } + else + log_printf (" [invalid]"); + ksba_free (sn); + xfree (p); + } + log_printf ("\n"); +} + + + /* helper for the rfc2253 string parser */ static const unsigned char * diff --git a/sm/gpgsm.h b/sm/gpgsm.h index b49f34640..0d9bac560 100644 --- a/sm/gpgsm.h +++ b/sm/gpgsm.h @@ -218,6 +218,8 @@ void gpgsm_print_time (FILE *fp, ksba_isotime_t t); void gpgsm_print_name2 (FILE *fp, const char *string, int translate); void gpgsm_print_name (FILE *fp, const char *string); +void gpgsm_cert_log_name (const char *text, ksba_cert_t cert); + void gpgsm_dump_cert (const char *text, ksba_cert_t cert); void gpgsm_dump_serial (ksba_const_sexp_t p); void gpgsm_dump_time (ksba_isotime_t t); diff --git a/sm/keylist.c b/sm/keylist.c index 9baf065d0..c44d62102 100644 --- a/sm/keylist.c +++ b/sm/keylist.c @@ -672,7 +672,7 @@ list_cert_raw (ctrl_t ctrl, KEYDB_HANDLE hd, else fputs ("[?]\n", fp); - fputs (" keyUsage:", fp); + fputs (" keyUsage: ", fp); err = ksba_cert_get_key_usage (cert, &kusage); if (gpg_err_code (err) != GPG_ERR_NO_DATA) { |