~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
pub/bbs-gen.c, pub/rsa-gen.c: Fail if the generated key is the wrong length.
[catacomb]
/
pub
/
rsa-gen.c
diff --git
a/pub/rsa-gen.c
b/pub/rsa-gen.c
index
c12be18
..
de97644
100644
(file)
--- a/
pub/rsa-gen.c
+++ b/
pub/rsa-gen.c
@@
-158,6
+158,8
@@
int rsa_gen(rsa_priv *rp, unsigned nbits, grand *r, unsigned n,
mp_gcd(&g.g, 0, &rp->d, phi, rp->e);
if (!MP_EQ(g.g, MP_ONE) && MP_LEN(rp->d) * 4 > MP_LEN(rp->n) * 3)
goto fail_e;
+ if (mp_bits(rp->n) != nbits)
+ goto fail_e;
/* --- Work out exponent residues --- */