Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit f6a67c2

Browse files
author
NIIBE Yutaka
committed
cipher: Change the bounds for RSA key generation round.
* cipher/rsa.c (generate_fips): Use 10 for p, 20 for q. -- Applied the master commit of: cd30ed3 Constants from FIPS 186-5-draft. GnuPG-bug-id: 5919 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
1 parent 26df4b8 commit f6a67c2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cipher/rsa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
476476

477477
retry:
478478
/* generate p and q */
479-
for (i = 0; i < 5 * pbits; i++)
479+
for (i = 0; i < 10 * pbits; i++)
480480
{
481481
ploop:
482482
if (!testparms)
@@ -506,10 +506,10 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
506506
else if (testparms)
507507
goto err;
508508
}
509-
if (i >= 5 * pbits)
509+
if (i >= 10 * pbits)
510510
goto err;
511511

512-
for (i = 0; i < 5 * pbits; i++)
512+
for (i = 0; i < 20 * pbits; i++)
513513
{
514514
qloop:
515515
if (!testparms)
@@ -555,7 +555,7 @@ generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
555555
else if (testparms)
556556
goto err;
557557
}
558-
if (i >= 5 * pbits)
558+
if (i >= 20 * pbits)
559559
goto err;
560560

561561
if (testparms)

0 commit comments

Comments
 (0)