summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>1999-11-05 07:09:08 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>1999-11-05 07:09:08 +0000
commitff21cfb4036f45f8a4c7e41700e2ff3443ea792e (patch)
tree99aaf9766bedca58b531bda169af30decb412125
parentc35dfa13d2c1fd2f0d241f12590ffb8ffa524dc9 (diff)
clear buffers used for encryption. ok: niels@
-rw-r--r--usr.bin/ssh/rsa.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ssh/rsa.c b/usr.bin/ssh/rsa.c
index 9bdde7d1049..2721b2a2a7a 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.6 1999/11/02 19:42:36 markus Exp $");
+RCSID("$Id: rsa.c,v 1.7 1999/11/05 07:09:07 markus Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -128,6 +128,8 @@ rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA* key)
BN_bin2bn(outbuf, len, out);
+ memset(outbuf, 0, len);
+ memset(inbuf, 0, len);
xfree(outbuf);
xfree(inbuf);
}
@@ -151,6 +153,8 @@ rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key)
BN_bin2bn(outbuf, len, out);
+ memset(outbuf, 0, len);
+ memset(inbuf, 0, len);
xfree(outbuf);
xfree(inbuf);
}