diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-06 15:38:50 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-06 15:38:50 +0000 |
commit | 6b5feb160616a5b8866c3b1e8517194ccea3a5f9 (patch) | |
tree | 33d9d9efa0de37a1efa07bbd544c97fecc061c84 /lib/libc | |
parent | 47732eabe9b0b153947ab258f754d56817737511 (diff) |
use explicit_bzero
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/crypt/bcrypt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/crypt/bcrypt.c b/lib/libc/crypt/bcrypt.c index 4656ca656b9..3bb61a5ebc1 100644 --- a/lib/libc/crypt/bcrypt.c +++ b/lib/libc/crypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcrypt.c,v 1.41 2014/05/03 17:12:53 tedu Exp $ */ +/* $OpenBSD: bcrypt.c,v 1.42 2014/05/06 15:38:49 tedu Exp $ */ /* * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> @@ -187,10 +187,10 @@ bcrypt_hashpass(const char *key, const char *salt, char *encrypted, encode_base64(encrypted + i + 3, csalt, BCRYPT_MAXSALT); encode_base64(encrypted + strlen(encrypted), ciphertext, 4 * BCRYPT_BLOCKS - 1); - memset(&state, 0, sizeof(state)); - memset(ciphertext, 0, sizeof(ciphertext)); - memset(csalt, 0, sizeof(csalt)); - memset(cdata, 0, sizeof(cdata)); + explicit_bzero(&state, 0, sizeof(state)); + explicit_bzero(ciphertext, 0, sizeof(ciphertext)); + explicit_bzero(csalt, 0, sizeof(csalt)); + explicit_bzero(cdata, 0, sizeof(cdata)); return 0; } |