]> granicus.if.org Git - php/commitdiff
let s use the macro instead
authorDavid Carlier <devnexen@gmail.com>
Sat, 15 Oct 2016 16:55:44 +0000 (17:55 +0100)
committerDavid Carlier <devnexen@gmail.com>
Sat, 15 Oct 2016 16:55:44 +0000 (17:55 +0100)
ext/standard/crypt.c
ext/standard/php_crypt_r.c
main/php.h

index 99af6fb006e8b9ce8d271e6ac470fa81877b4758..025887d6ee79b3e16592f050e27da7b4067cafc7 100644 (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;
                        }
index 27cc82af8b3131c0af7de5c81fd326f51b6cedef..582718b5eae26f1e0f2cff75dbe406e4d489d643 100644 (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)
index b9b091d58e15c1ee85e0d3513c1cd3f32805c83b..e290d8e5db69bb9f07b1c312e120b90ab835e23f 100644 (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()