File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1510,6 +1510,10 @@ EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req)
15101510 int egdsocket , seeded ;
15111511 char * randfile = php_openssl_conf_get_string (req -> req_config , req -> section_name , "RANDFILE" );
15121512 php_openssl_load_rand_file (randfile , & egdsocket , & seeded );
1513+ if (php_openssl_load_rand_file (randfile , & egdsocket , & seeded ) == FAILURE ) {
1514+ php_error_docref (NULL , E_WARNING , "Failed to load RANDFILE" );
1515+ return NULL ;
1516+ }
15131517 PHP_OPENSSL_RAND_ADD_TIME ();
15141518
15151519 EVP_PKEY * key = NULL ;
@@ -1601,7 +1605,9 @@ EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req)
16011605 req -> priv_key = key ;
16021606
16031607cleanup :
1604- php_openssl_write_rand_file (randfile , egdsocket , seeded );
1608+ if (php_openssl_write_rand_file (randfile , egdsocket , seeded ) == FAILURE ) {
1609+ php_error_docref (NULL , E_WARNING , "Failed to write to RANDFILE" );
1610+ }
16051611 EVP_PKEY_free (params );
16061612 EVP_PKEY_CTX_free (ctx );
16071613 return key ;
You can’t perform that action at this time.
0 commit comments