diff --git a/g10/keygen.c b/g10/keygen.c index 992e572e4..921e93807 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -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"),