summaryrefslogtreecommitdiffstats
path: root/key.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-02-04 01:20:14 +0100
committerDamien Miller <djm@mindrot.org>2014-02-04 01:20:14 +0100
commita5103f413bde6f31bff85d6e1fd29799c647d765 (patch)
tree0b35ad9292b2ca8d58229435865d0ec3818e5981 /key.c
parent - tedu@cvs.openbsd.org 2014/01/31 16:39:19 (diff)
downloadopenssh-a5103f413bde6f31bff85d6e1fd29799c647d765.tar.xz
openssh-a5103f413bde6f31bff85d6e1fd29799c647d765.zip
- djm@cvs.openbsd.org 2014/02/02 03:44:32
[auth1.c auth2-chall.c auth2-passwd.c authfile.c bufaux.c bufbn.c] [buffer.c cipher-3des1.c cipher.c clientloop.c gss-serv.c kex.c] [kexdhc.c kexdhs.c kexecdhc.c kexgexc.c kexecdhs.c kexgexs.c key.c] [monitor.c monitor_wrap.c packet.c readpass.c rsa.c serverloop.c] [ssh-add.c ssh-agent.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c] [ssh-keygen.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c] [sshd.c] convert memset of potentially-private data to explicit_bzero()
Diffstat (limited to 'key.c')
-rw-r--r--key.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/key.c b/key.c
index 914233808..168e1b7d7 100644
--- a/key.c
+++ b/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.115 2014/01/09 23:20:00 djm Exp $ */
+/* $OpenBSD: key.c,v 1.116 2014/02/02 03:44:31 djm Exp $ */
/*
* read_bignum():
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -242,12 +242,12 @@ key_free(Key *k)
case KEY_ED25519:
case KEY_ED25519_CERT:
if (k->ed25519_pk) {
- memset(k->ed25519_pk, 0, ED25519_PK_SZ);
+ explicit_bzero(k->ed25519_pk, ED25519_PK_SZ);
free(k->ed25519_pk);
k->ed25519_pk = NULL;
}
if (k->ed25519_sk) {
- memset(k->ed25519_sk, 0, ED25519_SK_SZ);
+ explicit_bzero(k->ed25519_sk, ED25519_SK_SZ);
free(k->ed25519_sk);
k->ed25519_sk = NULL;
}
@@ -415,7 +415,7 @@ key_fingerprint_raw(const Key *k, enum fp_type dgst_type,
if ((ssh_digest_memory(hash_alg, blob, len,
retval, SSH_DIGEST_MAX_LENGTH)) != 0)
fatal("%s: digest_memory failed", __func__);
- memset(blob, 0, len);
+ explicit_bzero(blob, len);
free(blob);
*dgst_raw_length = ssh_digest_bytes(hash_alg);
} else {
@@ -623,7 +623,7 @@ key_fingerprint(const Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
dgst_rep);
break;
}
- memset(dgst_raw, 0, dgst_raw_len);
+ explicit_bzero(dgst_raw, dgst_raw_len);
free(dgst_raw);
return retval;
}
@@ -1744,7 +1744,7 @@ to_blob(const Key *key, u_char **blobp, u_int *lenp, int force_plain)
*blobp = xmalloc(len);
memcpy(*blobp, buffer_ptr(&b), len);
}
- memset(buffer_ptr(&b), 0, len);
+ explicit_bzero(buffer_ptr(&b), len);
buffer_free(&b);
return len;
}