mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.5'
* PHP-8.5: openssl: Fix missing error propagation for BIO_printf() calls
This commit is contained in:
@@ -2712,16 +2712,21 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
|
|||||||
/* tack on extra headers */
|
/* tack on extra headers */
|
||||||
if (zheaders) {
|
if (zheaders) {
|
||||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
|
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
|
||||||
|
int ret;
|
||||||
zend_string *str = zval_try_get_string(zcertval);
|
zend_string *str = zval_try_get_string(zcertval);
|
||||||
if (UNEXPECTED(!str)) {
|
if (UNEXPECTED(!str)) {
|
||||||
goto clean_exit;
|
goto clean_exit;
|
||||||
}
|
}
|
||||||
if (strindex) {
|
if (strindex) {
|
||||||
BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
|
ret = BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
|
||||||
} else {
|
} else {
|
||||||
BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
|
ret = BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
|
||||||
}
|
}
|
||||||
zend_string_release(str);
|
zend_string_release(str);
|
||||||
|
if (ret < 0) {
|
||||||
|
php_openssl_store_errors();
|
||||||
|
goto clean_exit;
|
||||||
|
}
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2941,6 +2946,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
|||||||
zend_string_release(str);
|
zend_string_release(str);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
php_openssl_store_errors();
|
php_openssl_store_errors();
|
||||||
|
goto clean_exit;
|
||||||
}
|
}
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
}
|
}
|
||||||
@@ -3341,16 +3347,21 @@ PHP_FUNCTION(openssl_cms_encrypt)
|
|||||||
/* tack on extra headers */
|
/* tack on extra headers */
|
||||||
if (zheaders && encoding == ENCODING_SMIME) {
|
if (zheaders && encoding == ENCODING_SMIME) {
|
||||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
|
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
|
||||||
|
int ret;
|
||||||
zend_string *str = zval_try_get_string(zcertval);
|
zend_string *str = zval_try_get_string(zcertval);
|
||||||
if (UNEXPECTED(!str)) {
|
if (UNEXPECTED(!str)) {
|
||||||
goto clean_exit;
|
goto clean_exit;
|
||||||
}
|
}
|
||||||
if (strindex) {
|
if (strindex) {
|
||||||
BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
|
ret = BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
|
||||||
} else {
|
} else {
|
||||||
BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
|
ret = BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
|
||||||
}
|
}
|
||||||
zend_string_release(str);
|
zend_string_release(str);
|
||||||
|
if (ret < 0) {
|
||||||
|
php_openssl_store_errors();
|
||||||
|
goto clean_exit;
|
||||||
|
}
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3631,6 +3642,7 @@ PHP_FUNCTION(openssl_cms_sign)
|
|||||||
zend_string_release(str);
|
zend_string_release(str);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
php_openssl_store_errors();
|
php_openssl_store_errors();
|
||||||
|
goto clean_exit;
|
||||||
}
|
}
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user