diff options
author | Anatol Belski <ab@php.net> | 2014-09-19 01:46:14 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-09-19 01:46:14 +0200 |
commit | c45f4f546180d5d4fa83bfcdaad94ec52c9cc274 (patch) | |
tree | fa0cbcc19a6fd580cce3df5a971089bbb5bfefb4 /ext/standard/crypt.c | |
parent | adf753159b534885b31586cd5b37bdf36d806df0 (diff) | |
download | php-git-c45f4f546180d5d4fa83bfcdaad94ec52c9cc274.tar.gz |
generalized the case with secure memory zeroing
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r-- | ext/standard/crypt.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index b2524a0767..75940482d6 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -207,15 +207,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output)); if (!crypt_res) { - memset(output, 0, PHP_MAX_SALT_LEN + 1); + ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1); return NULL; } else { result = zend_string_init(output, strlen(output), 0); -#ifdef PHP_WIN32 - RtlSecureZeroMemory(output, PHP_MAX_SALT_LEN + 1); -#else - memset(output, 0, PHP_MAX_SALT_LEN + 1); -#endif + ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1); return result; } } else { |