Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time to the RAND pool before each RAND_bytes call #1857

Closed
wants to merge 2 commits into from

Conversation

bukka
Copy link
Member

@bukka bukka commented Apr 10, 2016

This is an another variant of the fix for bug 1844. The idea is to sort of back-port what OpenSSL 1.1 does and add a time to the entropy pool before each RAND_bytes call. It means also before each OpenSSL function that calls it internally. It is replaced by noop on Windows where it's not needed and it will be also noop if compiled with OpenSSL 1.1 (once I merge it's support to master).

#define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval()
#endif

static inline void php_openssl_rand_add_timeval() /* {{{ */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not used on Windows, it might as well be apart of the #else part ^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Done

@bukka
Copy link
Member Author

bukka commented Jun 12, 2016

Merged via 0e2447c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants