diff options
author | 2008-04-02 19:54:05 +0000 | |
---|---|---|
committer | 2008-04-02 19:54:05 +0000 | |
commit | 426a059f16c66a6bcd9d85c5ef07613e9067535e (patch) | |
tree | eb91c20f06c301f31548afe6fa9b7a8fc7fc679a /lib/libc/crypt/bcrypt.c | |
parent | repair code which blocks passing fd's for block devices or (diff) | |
download | wireguard-openbsd-426a059f16c66a6bcd9d85c5ef07613e9067535e.tar.xz wireguard-openbsd-426a059f16c66a6bcd9d85c5ef07613e9067535e.zip |
Zero state buffers on return. OK deraadt@
Diffstat (limited to 'lib/libc/crypt/bcrypt.c')
-rw-r--r-- | lib/libc/crypt/bcrypt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/crypt/bcrypt.c b/lib/libc/crypt/bcrypt.c index 769d303402f..207e76ea469 100644 --- a/lib/libc/crypt/bcrypt.c +++ b/lib/libc/crypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcrypt.c,v 1.23 2007/03/19 05:18:32 ray Exp $ */ +/* $OpenBSD: bcrypt.c,v 1.24 2008/04/02 19:54:05 millert Exp $ */ /* * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> @@ -270,6 +270,10 @@ bcrypt(const char *key, const char *salt) encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT); encode_base64((u_int8_t *) 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)); return encrypted; } |