Commit 131d0d94 authored by Niels Möller's avatar Niels Möller
Browse files

(rsa_generate_keypair): Output a newline after a

non-empty line of 'e':s (bad e was chosen, try again).

Rev: src/nettle/rsa-keygen.c:1.2
parent ae7cfc81
......@@ -303,6 +303,8 @@ rsa_generate_keypair(struct rsa_public_key *pub,
/* If we didn't have a given e, generate one now. */
if (e_size)
int retried = 0;
for (;;)
bignum_random_size(pub->e, e_size,
......@@ -316,7 +318,12 @@ rsa_generate_keypair(struct rsa_public_key *pub,
/* Needs gmp-3, or inverse might be negative. */
if (mpz_invert(key->d, pub->e, phi))
else if (progress) progress(progress_ctx, 'e');
if (progress) progress(progress_ctx, 'e');
retried = 1;
if (retried && progress)
progress(progress_ctx, '\n');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment