diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-06-10 22:02:23 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-06-10 22:02:23 -0500 |
commit | e3c681aa5cc71122a8d2fae42e6513fc413ccac8 (patch) | |
tree | 5f1df62f7b666028edb0ee1adf083a52d63df45a /ext/standard/php_crypt_r.c | |
parent | fb4e3085cbaa76eb8f28eebf848a81d1c0190067 (diff) | |
parent | 792e89385ca6fc722a03590722eb7745a2374720 (diff) | |
download | php-git-e3c681aa5cc71122a8d2fae42e6513fc413ccac8.tar.gz |
Merge branch 'master' into throw-error-in-extensions
Diffstat (limited to 'ext/standard/php_crypt_r.c')
-rw-r--r-- | ext/standard/php_crypt_r.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index 39185a66c3..8b97d4a496 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -127,7 +127,7 @@ to64(char *s, int32_t v, int n) char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { HCRYPTPROV hCryptProv; HCRYPTHASH ctx, ctx1; - unsigned int i, pwl, sl; + DWORD i, pwl, sl; const BYTE magic_md5[4] = "$1$"; const DWORD magic_md5_len = 3; DWORD dwHashLen; @@ -144,7 +144,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { return NULL; } - pwl = (unsigned int) strlen(pw); + pwl = (DWORD) strlen(pw); /* Refine the salt first */ sp = salt; @@ -160,7 +160,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { } /* get the length of the true salt */ - sl = ep - sp; + sl = (DWORD)(ep - sp); /* Create an empty hash object. */ if(!CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &ctx)) { @@ -318,12 +318,12 @@ _destroyProv: */ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { - static char passwd[MD5_HASH_MAX_LEN], *p; + ZEND_TLS char passwd[MD5_HASH_MAX_LEN], *p; const char *sp, *ep; unsigned char final[16]; unsigned int i, sl, pwl; PHP_MD5_CTX ctx, ctx1; - php_uint32 l; + uint32_t l; int pl; pwl = strlen(pw); @@ -418,7 +418,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) *p = '\0'; /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); + ZEND_SECURE_ZERO(final, sizeof(final)); return (passwd); } |