aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-01-23 22:17:45 +0000
committerDavid Shaw <[email protected]>2002-01-23 22:17:45 +0000
commit1cad77d9b4390111f883868e7f25b388042da0a8 (patch)
tree9b02969846837514b2860fbda7bcbbba8a0f9a88
parentSome compatibility polish for PGP2. Add a fake IDEA preference for v3 (diff)
downloadgnupg-1cad77d9b4390111f883868e7f25b388042da0a8.tar.gz
gnupg-1cad77d9b4390111f883868e7f25b388042da0a8.zip
Cosmetic: don't present a RSA signing key as a "keypair" which can be 768
bits long (as RSA minimum is 1024) Allow IDEA as a fake preference for v3 keys with v3 selfsigs when verifying that a cipher is in preferences while decrypting
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/keygen.c7
-rw-r--r--g10/pubkey-enc.c8
3 files changed, 21 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index de8d0d588..d6fb5b699 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2002-01-23 David Shaw <[email protected]>
+
+ * keygen.c (ask_keysize): Cosmetic: don't present a RSA signing
+ key as a "keypair" which can be 768 bits long (as RSA minimum is
+ 1024).
+
+ * pubkey-enc.c (is_algo_in_prefs): Allow IDEA as a fake preference
+ for v3 keys with v3 selfsigs.
+
2002-01-22 David Shaw <[email protected]>
* packet.h, getkey.c (merge_selfsigs_main), pkclist.c
diff --git a/g10/keygen.c b/g10/keygen.c
index 3d0dbb485..8f878449f 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -814,7 +814,7 @@ ask_keysize( int algo )
char *answer;
unsigned nbits;
- if (algo != PUBKEY_ALGO_DSA) {
+ if (algo != PUBKEY_ALGO_DSA && algo != PUBKEY_ALGO_RSA) {
tty_printf (_("About to generate a new %s keypair.\n"
" minimum keysize is 768 bits\n"
" default keysize is 1024 bits\n"
@@ -830,11 +830,12 @@ ask_keysize( int algo )
m_free(answer);
if( algo == PUBKEY_ALGO_DSA && (nbits < 512 || nbits > 1024) )
tty_printf(_("DSA only allows keysizes from 512 to 1024\n"));
- else if( nbits < 768 )
- tty_printf(_("keysize too small; 768 is smallest value allowed.\n"));
else if( algo == PUBKEY_ALGO_RSA && nbits < 1024 )
tty_printf(_("keysize too small;"
" 1024 is smallest value allowed for RSA.\n"));
+ else if( nbits < 768 )
+ tty_printf(_("keysize too small;"
+ " 768 is smallest value allowed.\n"));
else if( nbits > 4096 ) {
/* It is ridiculous and an annoyance to use larger key sizes!
* GnuPG can handle much larger sizes; but it takes an eternity
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index d31e3be33..d08cd7c12 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -46,6 +46,14 @@ is_algo_in_prefs ( KBNODE keyblock, preftype_t type, int algo )
KBNODE k;
for (k=keyblock; k; k=k->next) {
+ /* Fake IDEA preference for v3 keys with v3 selfsigs */
+ if (k->pkt->pkttype == PKT_PUBLIC_KEY &&
+ k->pkt->pkt.public_key->version < 4 &&
+ k->pkt->pkt.public_key->selfsigversion < 4 &&
+ type==PREFTYPE_SYM &&
+ algo==CIPHER_ALGO_IDEA)
+ return 1;
+
if (k->pkt->pkttype == PKT_USER_ID) {
PKT_user_id *uid = k->pkt->pkt.user_id;
prefitem_t *prefs = uid->prefs;