summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2015-03-31 11:06:49 +0000
committertobias <tobias@openbsd.org>2015-03-31 11:06:49 +0000
commit829d8687ab5bcdb988dbd0263f01ec819475fed4 (patch)
tree51004c0c032498c2400f991996473b649df3a508
parentTell the firmware to shut down the fan management thread on the last (diff)
downloadwireguard-openbsd-829d8687ab5bcdb988dbd0263f01ec819475fed4.tar.xz
wireguard-openbsd-829d8687ab5bcdb988dbd0263f01ec819475fed4.zip
Comments are only supported for RSA1 keys. If a user tried to add one and
entered his passphrase, explicitly clear it before exit. This is done in all other error paths, too. ok djm
-rw-r--r--usr.bin/ssh/ssh-keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 5dcbc2e7b0b..577bc5b3908 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.267 2015/03/23 06:06:38 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.268 2015/03/31 11:06:49 tobias Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1385,6 +1385,7 @@ do_change_comment(struct passwd *pw)
}
if (private->type != KEY_RSA1) {
fprintf(stderr, "Comments are only supported for RSA1 keys.\n");
+ explicit_bzero(passphrase, strlen(passphrase));
sshkey_free(private);
exit(1);
}