aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-10-11 21:07:03 +0000
committerDavid Shaw <[email protected]>2002-10-11 21:07:03 +0000
commit9fafaa7ef795cbba74d12ebea44ed133c31ceaa9 (patch)
treeaaf260accca6e2110b314c2a0a94ef627d82c718
parent* http.c (connect_server): Properly handle a single A record that fails (diff)
downloadgnupg-9fafaa7ef795cbba74d12ebea44ed133c31ceaa9.tar.gz
gnupg-9fafaa7ef795cbba74d12ebea44ed133c31ceaa9.zip
* keyedit.c (menu_addrevoker): Properly back out if the signature fails.
Also, do not allow appointing the same revoker twice, and report ALREADY_SIGNED if the user tries it.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/keyedit.c42
2 files changed, 44 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index c27f95bc5..639a7dc03 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-11 David Shaw <[email protected]>
+
+ * keyedit.c (menu_addrevoker): Properly back out if the signature
+ fails. Also, do not allow appointing the same revoker twice, and
+ report ALREADY_SIGNED if the user tries it.
+
2002-10-07 David Shaw <[email protected]>
* import.c (import_keys_internal): Missed one s/inp/inp2/.
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 5743944d2..71d2858b7 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -2326,6 +2326,11 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
continue;
}
+ revkey.class=0x80;
+ if(sensitive)
+ revkey.class|=0x40;
+ revkey.algid=revoker_pk->pubkey_algo;
+
if(cmp_public_keys(revoker_pk,pk)==0)
{
/* This actually causes no harm (after all, a key that
@@ -2333,9 +2338,41 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
regular key), but it's easy enough to check. */
log_error(_("you cannot appoint a key as its own "
"designated revoker\n"));
+
continue;
}
+ keyid_from_pk(pk,NULL);
+
+ /* Does this revkey already exist? */
+ if(!pk->revkey && pk->numrevkeys)
+ BUG();
+ else
+ {
+ int i;
+
+ for(i=0;i<pk->numrevkeys;i++)
+ {
+ if(memcmp(&pk->revkey[i],&revkey,
+ sizeof(struct revocation_key))==0)
+ {
+ char buf[50];
+
+ log_error(_("this key has already been designated "
+ "as a revoker\n"));
+
+ sprintf(buf,"%08lX%08lX",
+ (ulong)pk->keyid[0],(ulong)pk->keyid[1]);
+ write_status_text(STATUS_ALREADY_SIGNED,buf);
+
+ break;
+ }
+ }
+
+ if(i<pk->numrevkeys)
+ continue;
+ }
+
keyid_from_pk(revoker_pk,keyid);
tty_printf("\npub %4u%c/%08lX %s ",
@@ -2360,11 +2397,8 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
"key as a designated revoker? (y/N): "))
continue;
- revkey.class=0x80;
- if(sensitive)
- revkey.class|=0x40;
- revkey.algid=revoker_pk->pubkey_algo;
free_public_key(revoker_pk);
+ revoker_pk=NULL;
break;
}