2
0

More standard memset_s

This commit is contained in:
Maarten Billemont
2017-09-25 02:53:34 -04:00
parent f2ae35080d
commit 6b554c67ed
7 changed files with 38 additions and 27 deletions

View File

@@ -41,6 +41,7 @@
#include "blf.h"
#include "blowfish.h"
#include "mpw-util.h"
/* This implementation is adaptable to current computing power.
* You can have up to 2^31 rounds which should be enough for some
@@ -186,10 +187,10 @@ bcrypt_hashpass(const char *key, const uint8_t *salt, char *encrypted,
snprintf( encrypted, 8, "$2%c$%2.2u$", minor, logr );
encode_base64( encrypted + 7, csalt, BCRYPT_MAXSALT );
encode_base64( encrypted + 7 + 22, ciphertext, 4 * BCRYPT_WORDS - 1 );
memset_s( &state, sizeof state, 0, sizeof state );
memset_s( ciphertext, sizeof ciphertext, 0, sizeof ciphertext );
memset_s( csalt, sizeof csalt, 0, sizeof csalt );
memset_s( cdata, sizeof cdata, 0, sizeof cdata );
mpw_zero( &state, sizeof state );
mpw_zero( ciphertext, sizeof ciphertext );
mpw_zero( csalt, sizeof csalt );
mpw_zero( cdata, sizeof cdata );
return 0;
inval: