summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2016-10-15 17:55:44 +0100
committerDavid Carlier <devnexen@gmail.com>2016-10-15 17:55:44 +0100
commit1ece76411499cecfefd55b59b934963a46ac488b (patch)
treeb5e0a94312498814e089e67b6f9bdad691115494
parent2464dbd5f3dda7ab69f9217d802d08af0334ec71 (diff)
downloadphp-git-1ece76411499cecfefd55b59b934963a46ac488b.tar.gz
let s use the macro instead
-rw-r--r--ext/standard/crypt.c8
-rw-r--r--ext/standard/php_crypt_r.c2
-rw-r--r--main/php.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 99af6fb006..025887d6ee 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -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;
}
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c
index 27cc82af8b..582718b5ea 100644
--- a/ext/standard/php_crypt_r.c
+++ b/ext/standard/php_crypt_r.c
@@ -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)
diff --git a/main/php.h b/main/php.h
index b9b091d58e..e290d8e5db 100644
--- a/main/php.h
+++ b/main/php.h
@@ -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()