1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

This commit is contained in:
Jakub Zelenka
2023-12-21 16:44:19 +00:00

View File

@@ -3194,6 +3194,7 @@ PHP_FUNCTION(openssl_csr_sign)
X509 *cert = NULL, *new_cert = NULL;
EVP_PKEY * key = NULL, *priv_key = NULL;
int i;
bool new_cert_used = false;
struct php_x509_request req;
ZEND_PARSE_PARAMETERS_START(4, 6)
@@ -3315,11 +3316,12 @@ PHP_FUNCTION(openssl_csr_sign)
object_init_ex(return_value, php_openssl_certificate_ce);
cert_object = Z_OPENSSL_CERTIFICATE_P(return_value);
cert_object->x509 = new_cert;
new_cert_used = true;
cleanup:
if (cert == new_cert) {
cert = NULL;
if (!new_cert_used && new_cert) {
X509_free(new_cert);
}
PHP_SSL_REQ_DISPOSE(&req);
@@ -3328,7 +3330,7 @@ cleanup:
if (csr_str) {
X509_REQ_free(csr);
}
if (cert_str && cert) {
if (cert_str && cert && cert != new_cert) {
X509_free(cert);
}
}