Skip to content

Commit

Permalink
Make sure that we set the strong crypto result to false as well as re…
Browse files Browse the repository at this point in the history
…turning false.
  • Loading branch information
Scott MacVicar committed Dec 7, 2011
1 parent 96f55bb commit b69cfde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4939,11 +4939,17 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
/* random/urandom equivalent on Windows */
if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){
efree(buffer);
if (zstrong_result_returned) {
ZVAL_BOOL(zstrong_result_returned, 0);
}
RETURN_FALSE;
}
#else
if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) < 0) {
efree(buffer);
if (zstrong_result_returned) {
ZVAL_BOOL(zstrong_result_returned, 0);
}
RETURN_FALSE;
}
#endif
Expand Down

0 comments on commit b69cfde

Please sign in to comment.