From 8a15903bf8578c5cd416c109f2ccfbd3584df1b9 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 16 Oct 1999 23:54:13 +0000 Subject: public exponent needs to be odd. --- usr.bin/ssh/rsa.c | 6 +++--- 1 file 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); -- cgit v1.2.3