From cceda5c9d22591162c7ebacf3685f6829b0bebf5 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 22 Jan 2004 01:08:58 +0000 Subject: [PATCH] * packet.h, getkey.c (merge_selfsigs, merge_selfsigs_main), pkclist.c (check_signatures_trust): Indicate who has revoked a key (the owner or a designated revoker). If a key was revoked by both, prefer the owner. --- g10/ChangeLog | 5 +++++ g10/getkey.c | 10 +++++----- g10/packet.h | 7 ++++--- g10/pkclist.c | 10 +++++++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 66566385b..e9521dbde 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,10 @@ 2004-01-21 David Shaw + * packet.h, getkey.c (merge_selfsigs, merge_selfsigs_main), + pkclist.c (check_signatures_trust): Indicate who has revoked a key + (the owner or a designated revoker). If a key was revoked by + both, prefer the owner. + * keyedit.c (print_and_check_one_sig, keyedit_menu): Use the COLUMNS environment variable (if any) to hint how wide the terminal is. Disabled on _WIN32. Suggested by Janusz diff --git a/g10/getkey.c b/g10/getkey.c index 4aba21eae..e5c311832 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1,6 +1,6 @@ /* getkey.c - Get a key from the database - * Copyright (C) 1998, 1999, 2000, 2001, 2002, - * 2003 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + * 2004 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -1532,7 +1532,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked ) int rc=check_revocation_keys(pk,sig); if(rc==0) { - *r_revoked=1; + *r_revoked=2; /* don't continue checking since we can't be any more revoked than this */ break; @@ -1976,8 +1976,8 @@ merge_selfsigs( KBNODE keyblock ) PKT_public_key *pk = k->pkt->pkt.public_key; if(!main_pk->is_valid) pk->is_valid = 0; - if(revoked) - pk->is_revoked = 1; + if(revoked && !pk->is_revoked) + pk->is_revoked = revoked; if(main_pk->has_expired) pk->has_expired = main_pk->has_expired; } diff --git a/g10/packet.h b/g10/packet.h index db27d7a46..e5e4a2a03 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -1,6 +1,6 @@ /* packet.h - packet definitions - * Copyright (C) 1998, 1999, 2000, 2001, 2002, - * 2003 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, + * 2004 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -205,7 +205,8 @@ typedef struct { byte req_usage; /* hack to pass a request to getkey() */ byte req_algo; /* Ditto */ u32 has_expired; /* set to the expiration date if expired */ - int is_revoked; /* key has been revoked */ + int is_revoked; /* key has been revoked, 1 if by the + owner, 2 if by a designated revoker */ int maybe_revoked; /* a designated revocation is present, but without the key to check it */ int is_valid; /* key (especially subkey) is valid */ diff --git a/g10/pkclist.c b/g10/pkclist.c index eb4872580..405af10be 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -1,6 +1,6 @@ /* pkclist.c - * Copyright (C) 1998, 1999, 2000, 2001, 2002 - * 2003 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + * 2004 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -624,7 +624,11 @@ check_signatures_trust( PKT_signature *sig ) if ( (trustlevel & TRUST_FLAG_REVOKED) ) { write_status( STATUS_KEYREVOKED ); - log_info(_("WARNING: This key has been revoked by its owner!\n")); + if(pk->is_revoked==2) + log_info(_("WARNING: This key has been revoked by its" + " designated revoker!\n")); + else + log_info(_("WARNING: This key has been revoked by its owner!\n")); log_info(_(" This could mean that the signature is forgery.\n")); show_revocation_reason( pk, 0 ); }