- djm@cvs.openbsd.org 2001/09/28 12:07:09

[ssh-keygen.c]
     bzero private key after loading to smartcard; ok markus@
This commit is contained in:
Ben Lindstrom 2001-10-03 17:18:37 +00:00
parent 6149a6c57f
commit 1af4d3bb70
2 changed files with 13 additions and 2 deletions

View File

@ -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 $

View File

@ -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 <openssl/evp.h>
#include <openssl/pem.h>
@ -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++)