1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-07-01 02:42:44 +02:00

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
This commit is contained in:
David Shaw 2002-01-23 22:17:45 +00:00
parent 1dbd67b96a
commit 1cad77d9b4
3 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2002-01-23 David Shaw <dshaw@jabberwocky.com>
* 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 <dshaw@jabberwocky.com>
* packet.h, getkey.c (merge_selfsigs_main), pkclist.c

View File

@ -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

View File

@ -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;