summaryrefslogtreecommitdiff
path: root/sshkey.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-06-27 06:29:35 +0000
committerDamien Miller <djm@mindrot.org>2019-06-28 11:30:18 +1000
commitb2e3e57be4a933d9464bccbe592573725765486f (patch)
tree1ef7b579a463285b8524d94dd6a8bda80b2f6429 /sshkey.c
parent58ceacdcbaebefc77d120712de55c6fc6aa32bb1 (diff)
upstream: fix NULL deference (bzero) on err
=?UTF-8?q?or=20path=20added=20in=20last=20commit;=20spotted=20by=20Reynir?= =?UTF-8?q?=20Bj=C3=B6rnsson?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ok deraadt@ markus@ tb@ OpenBSD-Commit-ID: b11b084bcc551b2c630560eb08618dd501027bbd
Diffstat (limited to 'sshkey.c')
-rw-r--r--sshkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sshkey.c b/sshkey.c
index a545b42c..5d28c457 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.77 2019/06/23 12:21:46 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.78 2019/06/27 06:29:35 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -1985,9 +1985,9 @@ sshkey_shield_private(struct sshkey *k)
out:
/* XXX behaviour on error - invalidate original private key? */
cipher_free(cctx);
- explicit_bzero(enc, enclen);
explicit_bzero(keyiv, sizeof(keyiv));
explicit_bzero(&tmp, sizeof(tmp));
+ freezero(enc, enclen);
freezero(prekey, SSHKEY_SHIELD_PREKEY_LEN);
sshkey_free(kswap);
sshbuf_free(prvbuf);