File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1452,7 +1452,10 @@ EVP_PKEY *php_openssl_generate_private_key(struct php_x509_request * req)
14521452
14531453 int egdsocket , seeded ;
14541454 char * randfile = php_openssl_conf_get_string (req -> req_config , req -> section_name , "RANDFILE" );
1455- php_openssl_load_rand_file (randfile , & egdsocket , & seeded );
1455+ if (php_openssl_load_rand_file (randfile , & egdsocket , & seeded ) == FAILURE ) {
1456+ php_error_docref (NULL , E_WARNING , "Failed to load RANDFILE" );
1457+ return NULL ;
1458+ }
14561459
14571460 EVP_PKEY * key = NULL ;
14581461 EVP_PKEY * params = NULL ;
@@ -1543,7 +1546,9 @@ EVP_PKEY *php_openssl_generate_private_key(struct php_x509_request * req)
15431546 req -> priv_key = key ;
15441547
15451548cleanup :
1546- php_openssl_write_rand_file (randfile , egdsocket , seeded );
1549+ if (php_openssl_write_rand_file (randfile , egdsocket , seeded ) == FAILURE ) {
1550+ php_error_docref (NULL , E_WARNING , "Failed to write to RANDFILE" );
1551+ }
15471552 EVP_PKEY_free (params );
15481553 EVP_PKEY_CTX_free (ctx );
15491554 return key ;
You can’t perform that action at this time.
0 commit comments