diff --git a/ChangeLog b/ChangeLog index fe6d47977..c459b82c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ [sshd.8] don't talk about compile-time options ok markus@ + - djm@cvs.openbsd.org 2001/09/28 12:07:09 + [ssh-keygen.c] + bzero private key after loading to smartcard; ok markus@ 20011001 - (stevesk) loginrec.c: fix type conversion problems exposed when using @@ -6606,4 +6609,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1573 2001/10/03 17:15:32 mouring Exp $ +$Id: ChangeLog,v 1.1574 2001/10/03 17:18:37 mouring Exp $ diff --git a/ssh-keygen.c b/ssh-keygen.c index 299ba79c8..727b876de 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.81 2001/09/17 20:50:22 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.82 2001/09/28 12:07:09 djm Exp $"); #include #include @@ -495,6 +495,14 @@ do_upload(struct passwd *pw, const char *sc_reader_id) status = 0; log("loading key done"); done: + + memset(elements[0], '\0', BN_num_bytes(prv->rsa->q)); + memset(elements[1], '\0', BN_num_bytes(prv->rsa->p)); + memset(elements[2], '\0', BN_num_bytes(prv->rsa->iqmp)); + memset(elements[3], '\0', BN_num_bytes(prv->rsa->dmq1)); + memset(elements[4], '\0', BN_num_bytes(prv->rsa->dmp1)); + memset(elements[5], '\0', BN_num_bytes(prv->rsa->n)); + if (prv) key_free(prv); for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++)