From 75b4e369ebca1a7d903f803d8a9dc435f641320e Mon Sep 17 00:00:00 2001 From: David Shaw Date: Sat, 7 Jun 2003 22:38:15 +0000 Subject: [PATCH] * keyedit.c (sign_uids): Do not sign expired uids without --expert (same behavior as revoked uids). * mainproc.c (print_notation_data, check_sig_and_print): Only show the "key available from" preferred keyserver line if the key is not currently present. --- g10/ChangeLog | 9 +++++++++ g10/keyedit.c | 20 ++++++++++++++++++++ g10/mainproc.c | 26 +++++++++++++++++--------- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 05725c02d..6f2a6325d 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,12 @@ +2003-06-07 David Shaw + + * keyedit.c (sign_uids): Do not sign expired uids without --expert + (same behavior as revoked uids). + + * mainproc.c (print_notation_data, check_sig_and_print): Only show + the "key available from" preferred keyserver line if the key is + not currently present. + 2003-06-07 Werner Koch * g10.c (add_notation_data): Make sure that only ascii is passed diff --git a/g10/keyedit.c b/g10/keyedit.c index 5a641ddbc..8ac7c1125 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -377,6 +377,26 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified, tty_printf(_(" Unable to sign.\n")); } } + else if(uidnode->pkt->pkt.user_id->is_expired) + { + tty_printf(_("User ID \"%s\" is expired."),user); + + if(opt.expert) + { + tty_printf("\n"); + /* No, so remove the mark and continue */ + if(!cpr_get_answer_is_yes("sign_uid.expire_okay", + _("Are you sure you " + "still want to sign " + "it? (y/N) "))) + uidnode->flag &= ~NODFLG_MARK_A; + } + else + { + uidnode->flag &= ~NODFLG_MARK_A; + tty_printf(_(" Unable to sign.\n")); + } + } else if(!uidnode->pkt->pkt.user_id->created) { tty_printf(_("WARNING: user ID \"%s\" is not " diff --git a/g10/mainproc.c b/g10/mainproc.c index 2558b4d57..c734dd6c3 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -796,15 +796,6 @@ print_notation_data( PKT_signature *sig ) write_status_buffer ( STATUS_POLICY_URL, p, n, 0 ); } - seq=0; - - while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_PREF_KS,&n,&seq,NULL))) { - log_info(_("Preferred keyserver: ") ); - print_string( log_stream(), p, n, 0 ); - putc( '\n', log_stream() ); - /* TODO: put in a status-fd tag for preferred keyservers */ - } - /* Now check whether the key of this signature has some * notation data */ @@ -1323,6 +1314,23 @@ check_sig_and_print( CTX c, KBNODE node ) if( keyserver_import_keyid ( sig->keyid )==0 ) rc = do_check_sig(c, node, NULL, &is_expkey ); } + + /* If the key still isn't found, try to inform the user where it + can be found. */ + if(rc==G10ERR_NO_PUBKEY) + { + const byte *p; + int seq=0; + size_t n; + + while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_PREF_KS,&n,&seq,NULL))) + { + log_info(_("Key available from: ") ); + print_string( log_stream(), p, n, 0 ); + putc( '\n', log_stream() ); + } + } + if( !rc || rc == G10ERR_BAD_SIGN ) { KBNODE un, keyblock; int count=0, statno;