summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1999-10-16 23:54:13 +0000
committerNiels Provos <provos@cvs.openbsd.org>1999-10-16 23:54:13 +0000
commit8a15903bf8578c5cd416c109f2ccfbd3584df1b9 (patch)
tree5fdd7d455d35219b122789268fa9f3bed8094a2c
parenta9f2f9114f94aff1ea96b7408df7a11549ac901f (diff)
public exponent needs to be odd.
-rw-r--r--usr.bin/ssh/rsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/rsa.c b/usr.bin/ssh/rsa.c
index 246e75a174e..f2e5d5f1212 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.4 1999/10/16 23:20:25 provos Exp $");
+RCSID("$Id: rsa.c,v 1.5 1999/10/16 23:54:12 provos Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -112,8 +112,8 @@ 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");
+ if (BN_num_bits(key->e) < 2 || !BN_is_odd(key->e))
+ fatal("rsa_public_encrypt() exponent too small or not odd");
len = BN_num_bytes(key->n);
outbuf = xmalloc(len);