Skip to content

Commit 1ece764

Browse files
committed
let s use the macro instead
1 parent 2464dbd commit 1ece764

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: ext/standard/crypt.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
129129

130130
crypt_res = php_sha512_crypt_r(password, salt, output, PHP_MAX_SALT_LEN);
131131
if (!crypt_res) {
132-
explicit_bzero(output, PHP_MAX_SALT_LEN);
132+
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
133133
efree(output);
134134
return NULL;
135135
} else {
136136
result = zend_string_init(output, strlen(output), 0);
137-
explicit_bzero(output, PHP_MAX_SALT_LEN);
137+
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
138138
efree(output);
139139
return result;
140140
}
@@ -144,12 +144,12 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
144144

145145
crypt_res = php_sha256_crypt_r(password, salt, output, PHP_MAX_SALT_LEN);
146146
if (!crypt_res) {
147-
explicit_bzero(output, PHP_MAX_SALT_LEN);
147+
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
148148
efree(output);
149149
return NULL;
150150
} else {
151151
result = zend_string_init(output, strlen(output), 0);
152-
explicit_bzero(output, PHP_MAX_SALT_LEN);
152+
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN);
153153
efree(output);
154154
return result;
155155
}

Diff for: ext/standard/php_crypt_r.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
364364
PHP_MD5Update(&ctx, final, (unsigned int)(pl > 16 ? 16 : pl));
365365

366366
/* Don't leave anything around in vm they could use. */
367-
explicit_bzero(final, sizeof(final));
367+
ZEND_SECURE_ZERO(final, sizeof(final));
368368

369369
/* Then something really weird... */
370370
for (i = pwl; i != 0; i >>= 1)

Diff for: main/php.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ END_EXTERN_C()
136136
#define strlcat php_strlcat
137137
#endif
138138

139-
#ifndef HAVE_STRLCAT
139+
#ifndef HAVE_EXPLICIT_BZERO
140140
BEGIN_EXTERN_C()
141141
PHPAPI void php_explicit_bzero(void *dst, size_t siz);
142142
END_EXTERN_C()

0 commit comments

Comments
 (0)