Skip to content

Commit 9cde911

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Use EVP_MD_CTX_destroy() instead of EVP_MD_CTX_free() for compatibility and consistency
2 parents cf4e8e0 + f89a350 commit 9cde911

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ PHP NEWS
3333
. Fixed bug GH-20732 (Phar::LoadPhar undefined behavior when reading fails).
3434
(ndossche)
3535
. Fix SplFileInfo::openFile() in write mode. (ndossche)
36+
. Fix build on legacy OpenSSL 1.1.0 systems. (Giovanni Giacobbi)
3637

3738
- SPL:
3839
. Fixed bug GH-20678 (resource created by GlobIterator crashes with fclose()).

ext/phar/util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19541954

19551955
if (!EVP_SignInit(md_ctx, mdtype)) {
19561956
EVP_PKEY_free(key);
1957-
EVP_MD_CTX_free(md_ctx);
1957+
EVP_MD_CTX_destroy(md_ctx);
19581958
efree(sigbuf);
19591959
if (error) {
19601960
spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
@@ -1965,7 +1965,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19651965
while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) {
19661966
if (!EVP_SignUpdate(md_ctx, buf, sig_len)) {
19671967
EVP_PKEY_free(key);
1968-
EVP_MD_CTX_free(md_ctx);
1968+
EVP_MD_CTX_destroy(md_ctx);
19691969
efree(sigbuf);
19701970
if (error) {
19711971
spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
@@ -1976,7 +1976,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19761976

19771977
if (!EVP_SignFinal (md_ctx, sigbuf, &siglen, key)) {
19781978
EVP_PKEY_free(key);
1979-
EVP_MD_CTX_free(md_ctx);
1979+
EVP_MD_CTX_destroy(md_ctx);
19801980
efree(sigbuf);
19811981
if (error) {
19821982
spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
@@ -1986,7 +1986,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19861986

19871987
sigbuf[siglen] = '\0';
19881988
EVP_PKEY_free(key);
1989-
EVP_MD_CTX_free(md_ctx);
1989+
EVP_MD_CTX_destroy(md_ctx);
19901990
#else
19911991
size_t siglen;
19921992
sigbuf = NULL;

0 commit comments

Comments
 (0)