Skip to content

Commit

Permalink
cipher: Change the bounds for RSA key generation round.
Browse files Browse the repository at this point in the history
* cipher/rsa.c (generate_fips): Use 10 for p, 20 for q.

--

Constants from FIPS 186-5-draft.

GnuPG-bug-id: 5919
Signed-off-by: NIIBE Yutaka <[email protected]>
  • Loading branch information
NIIBE Yutaka committed Apr 20, 2022
1 parent 9e9f307 commit cd30ed3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cipher/rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,

retry:
/* generate p and q */
for (i = 0; i < 5 * pbits; i++)
for (i = 0; i < 10 * pbits; i++)
{
ploop:
if (!testparms)
Expand Down Expand Up @@ -506,10 +506,10 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
else if (testparms)
goto err;
}
if (i >= 5 * pbits)
if (i >= 10 * pbits)
goto err;

for (i = 0; i < 5 * pbits; i++)
for (i = 0; i < 20 * pbits; i++)
{
qloop:
if (!testparms)
Expand Down Expand Up @@ -555,7 +555,7 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
else if (testparms)
goto err;
}
if (i >= 5 * pbits)
if (i >= 20 * pbits)
goto err;

if (testparms)
Expand Down

0 comments on commit cd30ed3

Please sign in to comment.