com php-src: Merge branch 'PHP-7.0' into PHP-7.1: NEWS ext/openssl/openssl.c

From: Date: Sun, 15 Oct 2017 19:31:25 +0000
Subject: com php-src: Merge branch 'PHP-7.0' into PHP-7.1: NEWS ext/openssl/openssl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99754@lists.php.net to get a copy of this message
Commit: 547fee9cd44d3aed19490971e2d06f275a7b522b Author: Jakub Zelenka <bukka@php.net> Sun, 15 Oct 2017 20:31:25 +0100 Parents: 5e2751e7ffa5ad877083abc7dda8da658c9691c7 999fe36d404a375864202a1b2d90de111ddd1b25 Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=547fee9cd44d3aed19490971e2d06f275a7b522b Log: Merge branch 'PHP-7.0' into PHP-7.1 Changed paths: MM NEWS MM ext/openssl/openssl.c Diff: diff --cc ext/openssl/openssl.c index b199e0a,9b8a2fc..b5b0e87 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -1758,16 -1672,13 +1757,16 @@@ PHP_FUNCTION(openssl_x509_export_to_fil RETVAL_TRUE; } else { + php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "error opening file %s", filename); } - if (certresource == NULL && cert) { + if (Z_TYPE_P(zcert) != IS_RESOURCE) { X509_free(cert); } - BIO_free(bio_out); + + if (!BIO_free(bio_out)) { + php_openssl_store_errors(); + } } /* }}} */ @@@ -2099,16 -1991,12 +2097,16 @@@ PHP_FUNCTION(openssl_x509_export ZVAL_STRINGL(zout, bio_buf->data, bio_buf->length); RETVAL_TRUE; + } else { + php_openssl_store_errors(); } + BIO_free(bio_out); + +cleanup: - if (certresource == NULL && cert != NULL) { + if (Z_TYPE_P(zcert) != IS_RESOURCE) { X509_free(cert); } - BIO_free(bio_out); } /* }}} */ @@@ -2775,8 -2642,7 +2776,8 @@@ PHP_FUNCTION(openssl_pkcs12_export_to_f php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3"); goto cleanup; } - if (cert && !X509_check_private_key(cert, priv_key)) { + if (!X509_check_private_key(cert, priv_key)) { + php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "private key does not correspond to cert"); goto cleanup; }

« previous php.cvs (#99754) next »