Skip to content

Commit 25fb197

Browse files
author
Scott MacVicar
committed
Revert change to use a special Windows version of openssl_random_pseudo_bytes().
Lets discuss this on internals first. We're advertising something from the OpenSSL library and then subverting it with another Windows OS call. What are the implications of this? Should we make this available in ext/standard/ instead?
1 parent 3d10c57 commit 25fb197

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

ext/openssl/openssl.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4926,19 +4926,10 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
49264926

49274927
buffer = emalloc(buffer_length + 1);
49284928

4929-
#ifdef PHP_WIN32
4930-
strong_result = 1;
4931-
/* random/urandom equivalent on Windows */
4932-
if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){
4933-
efree(buffer);
4934-
RETURN_FALSE;
4935-
}
4936-
#else
49374929
if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) < 0) {
49384930
efree(buffer);
49394931
RETURN_FALSE;
49404932
}
4941-
#endif
49424933

49434934
buffer[buffer_length] = 0;
49444935
RETVAL_STRINGL((char *)buffer, buffer_length, 0);

0 commit comments

Comments
 (0)