let s use the macro instead

This commit is contained in:
David Carlier 2016-10-15 17:55:44 +01:00
parent 2464dbd5f3
commit 1ece764114
3 changed files with 6 additions and 6 deletions

View file

@ -129,12 +129,12 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
crypt_res = php_sha512_crypt_r(password, salt, output, PHP_MAX_SALT_LEN);
if (!crypt_res) {
explicit_bzero(output, PHP_MAX_SALT_LEN);
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
efree(output);
return NULL;
} else {
result = zend_string_init(output, strlen(output), 0);
explicit_bzero(output, PHP_MAX_SALT_LEN);
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
efree(output);
return result;
}
@ -144,12 +144,12 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
crypt_res = php_sha256_crypt_r(password, salt, output, PHP_MAX_SALT_LEN);
if (!crypt_res) {
explicit_bzero(output, PHP_MAX_SALT_LEN);
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
efree(output);
return NULL;
} else {
result = zend_string_init(output, strlen(output), 0);
explicit_bzero(output, PHP_MAX_SALT_LEN);
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
efree(output);
return result;
}

View file

@ -364,7 +364,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
PHP_MD5Update(&ctx, final, (unsigned int)(pl > 16 ? 16 : pl));
/* Don't leave anything around in vm they could use. */
explicit_bzero(final, sizeof(final));
ZEND_SECURE_ZERO(final, sizeof(final));
/* Then something really weird... */
for (i = pwl; i != 0; i >>= 1)

View file

@ -136,7 +136,7 @@ END_EXTERN_C()
#define strlcat php_strlcat
#endif
#ifndef HAVE_STRLCAT
#ifndef HAVE_EXPLICIT_BZERO
BEGIN_EXTERN_C()
PHPAPI void php_explicit_bzero(void *dst, size_t siz);
END_EXTERN_C()