diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2008-04-02 19:54:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2008-04-02 19:54:06 +0000 |
commit | d375f763b57b1bf821e19dababf5e3ff84892b1f (patch) | |
tree | 99d578b58e04b6c9f8c24e1665c8073bfe298725 /lib/libc/crypt | |
parent | 76d856897a6b2bc1dad1236c20411b5b3956b797 (diff) |
Zero state buffers on return. OK deraadt@
Diffstat (limited to 'lib/libc/crypt')
-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; } |