mirror of
https://github.com/clearml/dropbear
synced 2025-02-12 07:25:30 +00:00
Remove workaround forcing rsa mpint to exactly a 8 bits multiple for putty (see
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/rsa-non8mult-verify-fail.html , was fixed in 2004) --HG-- extra : convert_revision : f21045c791002d81fc6b8dde6537ea481e513eb2
This commit is contained in:
parent
f90f64b5c1
commit
460bf43822
14
genrsa.c
14
genrsa.c
@ -62,17 +62,13 @@ rsa_key * gen_rsa_priv_key(unsigned int size) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PuTTY doesn't like it if the modulus isn't a multiple of 8 bits,
|
|
||||||
* so we just generate them until we get one which is OK */
|
|
||||||
getrsaprime(key->p, &pminus, key->e, size/2);
|
getrsaprime(key->p, &pminus, key->e, size/2);
|
||||||
do {
|
getrsaprime(key->q, &qminus, key->e, size/2);
|
||||||
getrsaprime(key->q, &qminus, key->e, size/2);
|
|
||||||
|
|
||||||
if (mp_mul(key->p, key->q, key->n) != MP_OKAY) {
|
if (mp_mul(key->p, key->q, key->n) != MP_OKAY) {
|
||||||
fprintf(stderr, "rsa generation failed\n");
|
fprintf(stderr, "rsa generation failed\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
} while (mp_count_bits(key->n) % 8 != 0);
|
|
||||||
|
|
||||||
/* lcm(p-1, q-1) */
|
/* lcm(p-1, q-1) */
|
||||||
if (mp_lcm(&pminus, &qminus, &lcm) != MP_OKAY) {
|
if (mp_lcm(&pminus, &qminus, &lcm) != MP_OKAY) {
|
||||||
|
Loading…
Reference in New Issue
Block a user