1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg: Align notes about minimal keysize with actual checks.

* g10/keygen.c (ask_keysize): Use 768 for the minimal value for DSA in
export mode.  Improve readability.
--

GnuPG-bug-id: 2209
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-01-05 13:49:06 +01:00
parent f2ecbf7454
commit e70f7a54f2
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2006,15 +2006,13 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
static unsigned
ask_keysize (int algo, unsigned int primary_keysize)
{
unsigned int nbits, min, def = DEFAULT_STD_KEYSIZE, max=4096;
unsigned int nbits;
unsigned int min = 1024;
unsigned int def = DEFAULT_STD_KEYSIZE;
unsigned int max = 4096;
int for_subkey = !!primary_keysize;
int autocomp = 0;
if(opt.expert)
min=512;
else
min=1024;
if (primary_keysize && !opt.expert)
{
/* Deduce the subkey size from the primary key size. */
@ -2029,9 +2027,11 @@ ask_keysize (int algo, unsigned int primary_keysize)
goto leave;
}
/* Deviations from the standard values. */
switch(algo)
{
case PUBKEY_ALGO_DSA:
min = opt.expert? 768 : 1024;
def=2048;
max=3072;
break;
@ -2048,10 +2048,6 @@ ask_keysize (int algo, unsigned int primary_keysize)
def=255;
max=441;
break;
case PUBKEY_ALGO_RSA:
min=1024;
break;
}
tty_printf(_("%s keys may be between %u and %u bits long.\n"),