diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1999-10-16 23:20:26 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1999-10-16 23:20:26 +0000 |
commit | 4ef15f944825eb77e5eb0f2672ab0f999e4462d4 (patch) | |
tree | 6b975ee9b717d5ee12f3cd1892f5b5e685c70529 | |
parent | 34200164498c3a0013ddea8c44a3867586dd942c (diff) |
dont encrypt with public exponent < 3.
-rw-r--r-- | usr.bin/ssh/rsa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/rsa.c b/usr.bin/ssh/rsa.c index ac219a5b4e3..246e75a174e 100644 --- a/usr.bin/ssh/rsa.c +++ b/usr.bin/ssh/rsa.c @@ -35,7 +35,7 @@ Description of the RSA algorithm can be found e.g. from the following sources: */ #include "includes.h" -RCSID("$Id: rsa.c,v 1.3 1999/09/29 18:16:20 dugsong Exp $"); +RCSID("$Id: rsa.c,v 1.4 1999/10/16 23:20:25 provos Exp $"); #include "rsa.h" #include "ssh.h" @@ -112,6 +112,9 @@ rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA* key) char *inbuf, *outbuf; int len; + if (BN_num_bits(key->e) < 2) + fatal("rsa_public_encrypt() exponent too small"); + len = BN_num_bytes(key->n); outbuf = xmalloc(len); |