diff options
author | Pierre Joye <pajoye@php.net> | 2011-07-10 14:36:32 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2011-07-10 14:36:32 +0000 |
commit | 4276fd63b58823bff85a8a412a451b96dbb89374 (patch) | |
tree | 9e6811d3f5b46446b386501b42122850fafb2a4f | |
parent | 8a18b29d235742865ea7b358cfa6b2d833a33cfc (diff) | |
download | php-git-4276fd63b58823bff85a8a412a451b96dbb89374.tar.gz |
- fix bug #55169, mcrypt_create_iv always fails to gather sufficient random data
-rw-r--r-- | win32/winutil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/winutil.c b/win32/winutil.c index dae01584a9..f3043f50aa 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -87,7 +87,7 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ #endif if (has_crypto_ctx == 0) { - if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) { + if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)) { /* Could mean that the key container does not exist, let try again by asking for a new one */ if (GetLastError() == NTE_BAD_KEYSET) { @@ -97,6 +97,8 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ has_crypto_ctx = 0; } } + } else { + has_crypto_ctx = 1; } } |