summaryrefslogtreecommitdiff
path: root/sshbuf-misc.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-10-05 17:11:21 +0000
committerDamien Miller <djm@mindrot.org>2015-10-06 12:26:41 +1100
commit905b054ed24e0d5b4ef226ebf2c8bfc02ae6d4ad (patch)
tree44f664443952cd5aec21f8cf139d54ae318a52b3 /sshbuf-misc.c
parentb007159a0acdbcf65814b3ee05dbe2cf4ea46011 (diff)
upstream commit
some more bzero->explicit_bzero, from Michael McConville Upstream-ID: 17f19545685c33327db2efdc357c1c9225ff00d0
Diffstat (limited to 'sshbuf-misc.c')
-rw-r--r--sshbuf-misc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c
index d022065f9..3da4b80e7 100644
--- a/sshbuf-misc.c
+++ b/sshbuf-misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf-misc.c,v 1.4 2015/03/24 20:03:44 markus Exp $ */ 1/* $OpenBSD: sshbuf-misc.c,v 1.5 2015/10/05 17:11:21 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -103,7 +103,7 @@ sshbuf_dtob64(struct sshbuf *buf)
103 if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL) 103 if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL)
104 return NULL; 104 return NULL;
105 if ((r = b64_ntop(p, len, ret, plen)) == -1) { 105 if ((r = b64_ntop(p, len, ret, plen)) == -1) {
106 bzero(ret, plen); 106 explicit_bzero(ret, plen);
107 free(ret); 107 free(ret);
108 return NULL; 108 return NULL;
109 } 109 }
@@ -122,16 +122,16 @@ sshbuf_b64tod(struct sshbuf *buf, const char *b64)
122 if ((p = malloc(plen)) == NULL) 122 if ((p = malloc(plen)) == NULL)
123 return SSH_ERR_ALLOC_FAIL; 123 return SSH_ERR_ALLOC_FAIL;
124 if ((nlen = b64_pton(b64, p, plen)) < 0) { 124 if ((nlen = b64_pton(b64, p, plen)) < 0) {
125 bzero(p, plen); 125 explicit_bzero(p, plen);
126 free(p); 126 free(p);
127 return SSH_ERR_INVALID_FORMAT; 127 return SSH_ERR_INVALID_FORMAT;
128 } 128 }
129 if ((r = sshbuf_put(buf, p, nlen)) < 0) { 129 if ((r = sshbuf_put(buf, p, nlen)) < 0) {
130 bzero(p, plen); 130 explicit_bzero(p, plen);
131 free(p); 131 free(p);
132 return r; 132 return r;
133 } 133 }
134 bzero(p, plen); 134 explicit_bzero(p, plen);
135 free(p); 135 free(p);
136 return 0; 136 return 0;
137} 137}