Skip to content

Commit 006788b

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Use EVP_MD_CTX_destroy() instead of EVP_MD_CTX_free() for compatibility and consistency
2 parents 38e8aca + 9cde911 commit 006788b

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
@@ -34,6 +34,7 @@ PHP NEWS
3434
. Fixed bug GH-20732 (Phar::LoadPhar undefined behavior when reading fails).
3535
(ndossche)
3636
. Fix SplFileInfo::openFile() in write mode. (ndossche)
37+
. Fix build on legacy OpenSSL 1.1.0 systems. (Giovanni Giacobbi)
3738

3839
- Sqlite3:
3940
. Fixed bug GH-20699 (SQLite3Result fetchArray return array|false,

ext/phar/util.c

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

19241924
if (!EVP_SignInit(md_ctx, mdtype)) {
19251925
EVP_PKEY_free(key);
1926-
EVP_MD_CTX_free(md_ctx);
1926+
EVP_MD_CTX_destroy(md_ctx);
19271927
efree(sigbuf);
19281928
if (error) {
19291929
spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
@@ -1934,7 +1934,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19341934
while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) {
19351935
if (!EVP_SignUpdate(md_ctx, buf, sig_len)) {
19361936
EVP_PKEY_free(key);
1937-
EVP_MD_CTX_free(md_ctx);
1937+
EVP_MD_CTX_destroy(md_ctx);
19381938
efree(sigbuf);
19391939
if (error) {
19401940
spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
@@ -1945,7 +1945,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19451945

19461946
if (!EVP_SignFinal (md_ctx, sigbuf, &siglen, key)) {
19471947
EVP_PKEY_free(key);
1948-
EVP_MD_CTX_free(md_ctx);
1948+
EVP_MD_CTX_destroy(md_ctx);
19491949
efree(sigbuf);
19501950
if (error) {
19511951
spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
@@ -1955,7 +1955,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
19551955

19561956
sigbuf[siglen] = '\0';
19571957
EVP_PKEY_free(key);
1958-
EVP_MD_CTX_free(md_ctx);
1958+
EVP_MD_CTX_destroy(md_ctx);
19591959
#else
19601960
size_t siglen;
19611961
sigbuf = NULL;

0 commit comments

Comments
 (0)