Commit 9fffe417892 for php.net
commit 9fffe4178925bbf0a348bc01491996a1e4c6294e
Merge: 0880433e61d 006788b9ef0
Author: Niels Dossche <7771979+ndossche@users.noreply.github.com>
Date: Sun Dec 21 22:29:43 2025 +0100
Merge branch 'PHP-8.5'
* PHP-8.5:
Use EVP_MD_CTX_destroy() instead of EVP_MD_CTX_free() for compatibility and consistency
diff --cc ext/phar/util.c
index 82c784e6217,cb7370658b8..5e5495d8d96
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@@ -1881,27 -1923,33 +1881,27 @@@ ZEND_ATTRIBUTE_NONNULL zend_result phar
if (!EVP_SignInit(md_ctx, mdtype)) {
EVP_PKEY_free(key);
- EVP_MD_CTX_free(md_ctx);
+ EVP_MD_CTX_destroy(md_ctx);
efree(sigbuf);
- if (error) {
- spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
- }
+ spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
return FAILURE;
}
while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) {
if (!EVP_SignUpdate(md_ctx, buf, sig_len)) {
EVP_PKEY_free(key);
- EVP_MD_CTX_free(md_ctx);
+ EVP_MD_CTX_destroy(md_ctx);
efree(sigbuf);
- if (error) {
- spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
- }
+ spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
return FAILURE;
}
}
if (!EVP_SignFinal (md_ctx, sigbuf, &siglen, key)) {
EVP_PKEY_free(key);
- EVP_MD_CTX_free(md_ctx);
+ EVP_MD_CTX_destroy(md_ctx);
efree(sigbuf);
- if (error) {
- spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
- }
+ spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
return FAILURE;
}