Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions ext/phar/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,10 +1539,8 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type,
#ifndef PHAR_HAVE_OPENSSL
tempsig = sig_len;

if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, pubkey ? ZSTR_VAL(pubkey) : NULL, pubkey ? ZSTR_LEN(pubkey) : 0, &sig, &tempsig, sig_type)) {
if (pubkey) {
zend_string_release_ex(pubkey, 0);
}
if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, ZSTR_VAL(pubkey), ZSTR_LEN(pubkey), &sig, &tempsig, sig_type)) {
zend_string_release_ex(pubkey, 0);

if (error) {
spprintf(error, 0, "openssl signature could not be verified");
Expand All @@ -1551,13 +1549,11 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type,
return FAILURE;
}

if (pubkey) {
zend_string_release_ex(pubkey, 0);
}
zend_string_release_ex(pubkey, 0);

sig_len = tempsig;
#else
in = BIO_new_mem_buf(pubkey ? ZSTR_VAL(pubkey) : NULL, pubkey ? ZSTR_LEN(pubkey) : 0);
in = BIO_new_mem_buf(ZSTR_VAL(pubkey), ZSTR_LEN(pubkey));

if (NULL == in) {
zend_string_release_ex(pubkey, 0);
Expand Down