From a119391e263c5510df4c551bf6eff4523b04cdb0 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 28 Aug 2002 19:34:58 +0000 Subject: [PATCH] * sig-check.c (do_check_messages, do_check): Show keyid in error messages. * keyserver.c (print_keyinfo): More readable key listings for --search-keys responses. --- g10/ChangeLog | 8 ++++++++ g10/keyserver.c | 15 ++++++++------- g10/sig-check.c | 20 +++++++++++--------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 279c767ac..c1642ff5f 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2002-08-28 David Shaw + + * sig-check.c (do_check_messages, do_check): Show keyid in error + messages. + + * keyserver.c (print_keyinfo): More readable key listings for + --search-keys responses. + 2002-08-26 David Shaw * hkp.c (parse_hkp_index, dehtmlize): Move HTML functionality into diff --git a/g10/keyserver.c b/g10/keyserver.c index f20e492fe..9aef56726 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -304,18 +304,20 @@ print_keyinfo(int count,char *keystring,KEYDB_SEARCH_DESC *desc) if(flags&2) printf(" (disabled)"); - if(keytype[0]) - printf(" %s",keytype); + printf("\n\t "); if(keysize>0) - printf(" %d",keysize); + printf("%d bit ",keysize); - printf("\n\t created %s,",strtimestamp(createtime)); + if(keytype[0]) + printf("%s ",keytype); + + printf("key %s, created %s",certid,strtimestamp(createtime)); if(expiretime>0) - printf(" expires %s,",strtimestamp(expiretime)); + printf(", expires %s",strtimestamp(expiretime)); - printf(" key %s\n",certid); + printf("\n"); return 0; } @@ -347,7 +349,6 @@ keyserver_spawn(int action,STRLIST list, set_exec_path(GNUPG_LIBEXECDIR,opt.exec_path_set); #endif - /* Build the filename for the helper to execute */ command=m_alloc(strlen("gpgkeys_")+strlen(opt.keyserver_scheme)+1); strcpy(command,"gpgkeys_"); diff --git a/g10/sig-check.c b/g10/sig-check.c index 29a035203..657ead52a 100644 --- a/g10/sig-check.c +++ b/g10/sig-check.c @@ -212,17 +212,18 @@ do_check_messages( PKT_public_key *pk, PKT_signature *sig, int *r_expired ) *r_expired = 0; if( pk->version == 4 && pk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) { - log_info(_("this is a PGP generated " - "ElGamal key which is NOT secure for signatures!\n")); + log_info(_("key %08lX: this is a PGP generated " + "ElGamal key which is NOT secure for signatures!\n"), + (ulong)keyid_from_pk(pk,NULL)); return G10ERR_PUBKEY_ALGO; } if( pk->timestamp > sig->timestamp ) { ulong d = pk->timestamp - sig->timestamp; log_info( d==1 - ? _("public key is %lu second newer than the signature\n") - : _("public key is %lu seconds newer than the signature\n"), - d ); + ? _("public key %08lX is %lu second newer than the signature\n") + : _("public key %08lX is %lu seconds newer than the signature\n"), + (ulong)keyid_from_pk(pk,NULL),d ); if( !opt.ignore_time_conflict ) return G10ERR_TIME_CONFLICT; /* pubkey newer than signature */ } @@ -230,10 +231,11 @@ do_check_messages( PKT_public_key *pk, PKT_signature *sig, int *r_expired ) cur_time = make_timestamp(); if( pk->timestamp > cur_time ) { ulong d = pk->timestamp - cur_time; - log_info( d==1 ? _("key has been created %lu second " + log_info( d==1 ? _("key %08lX has been created %lu second " "in future (time warp or clock problem)\n") - : _("key has been created %lu seconds " - "in future (time warp or clock problem)\n"), d ); + : _("key %08lX has been created %lu seconds " + "in future (time warp or clock problem)\n"), + (ulong)keyid_from_pk(pk,NULL),d ); if( !opt.ignore_time_conflict ) return G10ERR_TIME_CONFLICT; } @@ -343,7 +345,7 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest, } if( !rc && sig->flags.unknown_critical ) { - log_info(_("assuming bad signature due to an unknown critical bit\n")); + log_info(_("assuming bad signature from key %08lX due to an unknown critical bit\n"),(ulong)keyid_from_pk(pk,NULL)); rc = G10ERR_BAD_SIGN; }