Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
check for errors in SSL RAND_(poll|bytes) calls
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrench committed Nov 21, 2017
1 parent d3da401 commit 018dec8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,16 @@ evhtp_ssl_init(evhtp_t * htp, evhtp_ssl_cfg_t * cfg)
ERR_load_crypto_strings();
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
RAND_poll();

if (RAND_poll() != 1) {
log_error("RAND_poll");
return -1;
}

if (RAND_bytes(&c, 1) != 1) {
log_error("RAND_bytes");
return -1;
}

#if OPENSSL_VERSION_NUMBER < 0x10000000L
STACK_OF(SSL_COMP) * comp_methods = SSL_COMP_get_compression_methods();
Expand Down

0 comments on commit 018dec8

Please sign in to comment.