From ff21cfb4036f45f8a4c7e41700e2ff3443ea792e Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Fri, 5 Nov 1999 07:09:08 +0000 Subject: clear buffers used for encryption. ok: niels@ --- usr.bin/ssh/rsa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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); } -- cgit v1.2.3