mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-10 13:04:23 +01:00
gpg: Use 2048 as the default keysize in batch mode.
* g10/keygen.c (gen_elg, gen_dsa, gen_rsa): Set default keysize to 2048. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
4d93e5e3cf
commit
0f18295ac8
14
g10/keygen.c
14
g10/keygen.c
@ -1170,12 +1170,12 @@ gen_elg (int algo, unsigned int nbits,
|
|||||||
PKT_public_key *pk;
|
PKT_public_key *pk;
|
||||||
gcry_sexp_t s_parms, s_key;
|
gcry_sexp_t s_parms, s_key;
|
||||||
gcry_sexp_t misc_key_info;
|
gcry_sexp_t misc_key_info;
|
||||||
|
|
||||||
assert( is_ELGAMAL(algo) );
|
assert( is_ELGAMAL(algo) );
|
||||||
|
|
||||||
if (nbits < 512)
|
if (nbits < 512)
|
||||||
{
|
{
|
||||||
nbits = 1024;
|
nbits = 2048;
|
||||||
log_info (_("keysize invalid; using %u bits\n"), nbits );
|
log_info (_("keysize invalid; using %u bits\n"), nbits );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1284,9 +1284,9 @@ gen_dsa (unsigned int nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
|
|||||||
gcry_sexp_t misc_key_info;
|
gcry_sexp_t misc_key_info;
|
||||||
unsigned int qbits;
|
unsigned int qbits;
|
||||||
|
|
||||||
if ( nbits < 512)
|
if ( nbits < 512)
|
||||||
{
|
{
|
||||||
nbits = 1024;
|
nbits = 2048;
|
||||||
log_info(_("keysize invalid; using %u bits\n"), nbits );
|
log_info(_("keysize invalid; using %u bits\n"), nbits );
|
||||||
}
|
}
|
||||||
else if ( nbits > 3072 )
|
else if ( nbits > 3072 )
|
||||||
@ -1435,12 +1435,12 @@ gen_rsa (int algo, unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
|
|||||||
if (!nbits)
|
if (!nbits)
|
||||||
nbits = DEFAULT_STD_KEYSIZE;
|
nbits = DEFAULT_STD_KEYSIZE;
|
||||||
|
|
||||||
if (nbits < 1024)
|
if (nbits < 1024)
|
||||||
{
|
{
|
||||||
nbits = 1024;
|
nbits = 2048;
|
||||||
log_info (_("keysize invalid; using %u bits\n"), nbits );
|
log_info (_("keysize invalid; using %u bits\n"), nbits );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((nbits % 32))
|
if ((nbits % 32))
|
||||||
{
|
{
|
||||||
nbits = ((nbits + 31) / 32) * 32;
|
nbits = ((nbits + 31) / 32) * 32;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user