diff options
author | Werner Koch <wk@gnupg.org> | 1999-06-10 14:24:42 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-06-10 14:24:42 +0200 |
commit | b5f36dd0dd6af6ce30f8a51a71b382e90677fd97 (patch) | |
tree | 4a0f77aefb7766ab9064a985325990133610204c /g10 | |
parent | See ChangeLog: Tue Jun 8 13:36:25 CEST 1999 Werner Koch (diff) | |
download | gnupg2-b5f36dd0dd6af6ce30f8a51a71b382e90677fd97.tar.xz gnupg2-b5f36dd0dd6af6ce30f8a51a71b382e90677fd97.zip |
See ChangeLog: Thu Jun 10 14:18:23 CEST 1999 Werner Koch
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 10 | ||||
-rw-r--r-- | g10/free-packet.c | 18 | ||||
-rw-r--r-- | g10/helptext.c | 9 | ||||
-rw-r--r-- | g10/keyedit.c | 35 |
4 files changed, 53 insertions, 19 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 53870b45f..f29c39654 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,13 @@ +Thu Jun 10 14:18:23 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * free-packet.c (free_encrypted): Fixed EOF case (Remi). + (free_plaintext): Ditto. + + * helptext.c (keyedit.delsig.unknown): New (Remi). + * keyedit.c (print_and_check_one_sig): Add arg print_without_key and + changed all callers to make use of it (Remi): + Tue Jun 8 13:36:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> * keylist.c (print_key_data): New and called elsewhere. diff --git a/g10/free-packet.c b/g10/free-packet.c index 5d74544fc..0a61e222c 100644 --- a/g10/free-packet.c +++ b/g10/free-packet.c @@ -244,8 +244,13 @@ free_encrypted( PKT_encrypted *ed ) ; } else { - while( ed->len ) /* skip the packet */ - ed->len -= iobuf_read( ed->buf, NULL, ed->len ); + while( ed->len ) { /* skip the packet */ + int n = iobuf_read( ed->buf, NULL, ed->len ); + if( n == -1 ) + ed->len = 0; + else + ed->len -= n; + } } } m_free(ed); @@ -261,8 +266,13 @@ free_plaintext( PKT_plaintext *pt ) ; } else { - while( pt->len ) /* skip the packet */ - pt->len -= iobuf_read( pt->buf, NULL, pt->len ); + while( pt->len ) { /* skip the packet */ + int n = iobuf_read( pt->buf, NULL, pt->len ); + if( n == -1 ) + pt->len = 0; + else + pt->len -= n; + } } } m_free(pt); diff --git a/g10/helptext.c b/g10/helptext.c index 7643f96db..7e573469a 100644 --- a/g10/helptext.c +++ b/g10/helptext.c @@ -178,10 +178,15 @@ static struct helptexts { const char *key; const char *help; } helptexts[] = { "to delete this signature may be important to establish a trust\n" "connection to the key or another key certified by this key." }, +{ N_("keyedit.delsig.unknown"), + "This signature can't be checked because you don't have the\n" + "corresponding key. You should postpone its deletion until you\n" + "know which key was used because this signing key might establish" + "a trust connection through another already certified key." +}, { N_("keyedit.delsig.invalid"), "The signature is not valid. It does make sense to remove it from\n" - "your keyring if it is really invalid and not just unchecked due to\n" - "a missing public key (marked by \"sig?\")." + "your keyring." }, { N_("keyedit.delsig.selfsig"), "This is a signature which binds the user ID to the key. It is\n" diff --git a/g10/keyedit.c b/g10/keyedit.c index 5777e7181..6035f7d2b 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -111,7 +111,7 @@ get_keyblock_byname( KBNODE *keyblock, KBPOS *kbpos, const char *username ) static int print_and_check_one_sig( KBNODE keyblock, KBNODE node, int *inv_sigs, int *no_key, int *oth_err, - int *is_selfsig ) + int *is_selfsig, int print_without_key ) { PKT_signature *sig = node->pkt->pkt.signature; int rc, sigrc; @@ -141,7 +141,7 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node, ++*oth_err; break; } - if( sigrc != '?' ) { + if( sigrc != '?' || print_without_key ) { tty_printf("%s%c %08lX %s ", is_rev? "rev":"sig", sigrc, sig->keyid[1], datestr_from_sig(sig)); @@ -205,7 +205,7 @@ check_all_keysigs( KBNODE keyblock, int only_selected ) int selfsig; if( print_and_check_one_sig( keyblock, node, &inv_sigs, - &no_key, &oth_err, &selfsig ) ) { + &no_key, &oth_err, &selfsig, 0 ) ) { if( selfsig ) has_selfsig = 1; } @@ -1275,24 +1275,33 @@ menu_delsig( KBNODE pub_keyblock ) uid = (node->flag & NODFLG_SELUID)? node->pkt->pkt.user_id : NULL; } else if( uid && node->pkt->pkttype == PKT_SIGNATURE ) { - int okay, valid, selfsig; + int okay, valid, selfsig, inv_sig, no_key, other_err; tty_printf("uid "); tty_print_string( uid->name, uid->len ); tty_printf("\n"); + okay = inv_sig = no_key = other_err = 0; valid = print_and_check_one_sig( pub_keyblock, node, - NULL, NULL, NULL, &selfsig ); - - okay = valid ? cpr_get_answer_yes_no_quit( - "keyedit.delsig.valid", - _("Delete this good signature? (y/N/q)")) - : cpr_get_answer_yes_no_quit( - "keyedit.delsig.invalid", - _("Delete this invalid signature? (y/N/q)")); + &inv_sig, &no_key, &other_err, + &selfsig, 1 ); + + if( valid ) + okay = cpr_get_answer_yes_no_quit( + "keyedit.delsig.valid", + _("Delete this good signature? (y/N/q)")); + else if( inv_sig || other_err ) + okay = cpr_get_answer_yes_no_quit( + "keyedit.delsig.invalid", + _("Delete this invalid signature? (y/N/q)")); + else if( no_key ) + okay = cpr_get_answer_yes_no_quit( + "keyedit.delsig.unknown", + _("Delete this unknown signature? (y/N/q)")); + if( okay == -1 ) break; - if( okay && !cpr_get_answer_is_yes( + if( okay && selfsig && !cpr_get_answer_is_yes( "keyedit.delsig.selfsig", _("Really delete this self-signature? (y/N)") )) okay = 0; |