diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-11-16 13:25:37 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-11-16 13:25:37 +0100 |
commit | 0b82e05fe264306004119e30119e665365331e17 (patch) | |
tree | b6ee689804e9ca3946a644a80760d821a032d42f /ext/phar | |
parent | b57a2691d5b72c3894e2d4e0f945cecc6b3a1953 (diff) | |
download | php-0b82e05fe264306004119e30119e665365331e17.tar.gz |
Imported Upstream version 5.5.0~alpha1upstream/5.5.0_alpha1
Diffstat (limited to 'ext/phar')
74 files changed, 25 insertions, 11 deletions
diff --git a/ext/phar/phar/clicommand.inc b/ext/phar/phar/clicommand.inc index 79bf5c885..79bf5c885 100755..100644 --- a/ext/phar/phar/clicommand.inc +++ b/ext/phar/phar/clicommand.inc diff --git a/ext/phar/phar/directorygraphiterator.inc b/ext/phar/phar/directorygraphiterator.inc index 5a658ddab..5a658ddab 100755..100644 --- a/ext/phar/phar/directorygraphiterator.inc +++ b/ext/phar/phar/directorygraphiterator.inc diff --git a/ext/phar/phar/directorytreeiterator.inc b/ext/phar/phar/directorytreeiterator.inc index 9ed2e1a1b..9ed2e1a1b 100755..100644 --- a/ext/phar/phar/directorytreeiterator.inc +++ b/ext/phar/phar/directorytreeiterator.inc diff --git a/ext/phar/phar/invertedregexiterator.inc b/ext/phar/phar/invertedregexiterator.inc index aec87e6ab..aec87e6ab 100755..100644 --- a/ext/phar/phar/invertedregexiterator.inc +++ b/ext/phar/phar/invertedregexiterator.inc diff --git a/ext/phar/phar/phar.inc b/ext/phar/phar/phar.inc index 7e7d61851..7e7d61851 100755..100644 --- a/ext/phar/phar/phar.inc +++ b/ext/phar/phar/phar.inc diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index cb343675b..cb343675b 100755..100644 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc diff --git a/ext/phar/phar_path_check.c b/ext/phar/phar_path_check.c index 7ca339d26..7a8ea6089 100644 --- a/ext/phar/phar_path_check.c +++ b/ext/phar/phar_path_check.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Feb 25 04:35:39 2011 */ +/* Generated by re2c 0.13.5 on Sun Jan 1 10:36:11 2012 */ #line 1 "ext/phar/phar_path_check.re" /* +----------------------------------------------------------------------+ diff --git a/ext/phar/tests/003a.phpt b/ext/phar/tests/003a.phpt index 37e31072d..37e31072d 100755..100644 --- a/ext/phar/tests/003a.phpt +++ b/ext/phar/tests/003a.phpt diff --git a/ext/phar/tests/015b.phpt b/ext/phar/tests/015b.phpt index 08ead2d9c..08ead2d9c 100755..100644 --- a/ext/phar/tests/015b.phpt +++ b/ext/phar/tests/015b.phpt diff --git a/ext/phar/tests/016b.phpt b/ext/phar/tests/016b.phpt index 8fe66826d..8fe66826d 100755..100644 --- a/ext/phar/tests/016b.phpt +++ b/ext/phar/tests/016b.phpt diff --git a/ext/phar/tests/019b.phpt b/ext/phar/tests/019b.phpt index 5a0ef7133..5a0ef7133 100755..100644 --- a/ext/phar/tests/019b.phpt +++ b/ext/phar/tests/019b.phpt diff --git a/ext/phar/tests/019c.phpt b/ext/phar/tests/019c.phpt index 2cb508c46..2cb508c46 100755..100644 --- a/ext/phar/tests/019c.phpt +++ b/ext/phar/tests/019c.phpt diff --git a/ext/phar/tests/023.phpt b/ext/phar/tests/023.phpt index 808f91dea..808f91dea 100755..100644 --- a/ext/phar/tests/023.phpt +++ b/ext/phar/tests/023.phpt diff --git a/ext/phar/tests/024.phpt b/ext/phar/tests/024.phpt index ad30d2644..ad30d2644 100755..100644 --- a/ext/phar/tests/024.phpt +++ b/ext/phar/tests/024.phpt diff --git a/ext/phar/tests/025.phpt b/ext/phar/tests/025.phpt index bbb5bc4e8..bbb5bc4e8 100755..100644 --- a/ext/phar/tests/025.phpt +++ b/ext/phar/tests/025.phpt diff --git a/ext/phar/tests/026.phpt b/ext/phar/tests/026.phpt index 696fbcf41..696fbcf41 100755..100644 --- a/ext/phar/tests/026.phpt +++ b/ext/phar/tests/026.phpt diff --git a/ext/phar/tests/027.phpt b/ext/phar/tests/027.phpt index 8736efbeb..8736efbeb 100755..100644 --- a/ext/phar/tests/027.phpt +++ b/ext/phar/tests/027.phpt diff --git a/ext/phar/tests/028.phpt b/ext/phar/tests/028.phpt index 087f82277..087f82277 100755..100644 --- a/ext/phar/tests/028.phpt +++ b/ext/phar/tests/028.phpt diff --git a/ext/phar/tests/029.phpt b/ext/phar/tests/029.phpt index 41fcec03e..41fcec03e 100755..100644 --- a/ext/phar/tests/029.phpt +++ b/ext/phar/tests/029.phpt diff --git a/ext/phar/tests/030.phpt b/ext/phar/tests/030.phpt index e1e94dba8..e1e94dba8 100755..100644 --- a/ext/phar/tests/030.phpt +++ b/ext/phar/tests/030.phpt diff --git a/ext/phar/tests/031.phpt b/ext/phar/tests/031.phpt index 4d5988621..4d5988621 100755..100644 --- a/ext/phar/tests/031.phpt +++ b/ext/phar/tests/031.phpt diff --git a/ext/phar/tests/032.phpt b/ext/phar/tests/032.phpt index faf3dcbf5..faf3dcbf5 100755..100644 --- a/ext/phar/tests/032.phpt +++ b/ext/phar/tests/032.phpt diff --git a/ext/phar/tests/create_new_and_modify.phpt b/ext/phar/tests/create_new_and_modify.phpt index d6c469d9c..d6c469d9c 100755..100644 --- a/ext/phar/tests/create_new_and_modify.phpt +++ b/ext/phar/tests/create_new_and_modify.phpt diff --git a/ext/phar/tests/create_new_phar_b.phpt b/ext/phar/tests/create_new_phar_b.phpt index 39fc31e27..39fc31e27 100755..100644 --- a/ext/phar/tests/create_new_phar_b.phpt +++ b/ext/phar/tests/create_new_phar_b.phpt diff --git a/ext/phar/tests/create_new_phar_c.phpt b/ext/phar/tests/create_new_phar_c.phpt index 6beaa2eb6..6beaa2eb6 100755..100644 --- a/ext/phar/tests/create_new_phar_c.phpt +++ b/ext/phar/tests/create_new_phar_c.phpt diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt index d3fc03586..d3fc03586 100755..100644 --- a/ext/phar/tests/create_path_error.phpt +++ b/ext/phar/tests/create_path_error.phpt diff --git a/ext/phar/tests/delete_in_phar_b.phpt b/ext/phar/tests/delete_in_phar_b.phpt index a6d5b3a35..a6d5b3a35 100755..100644 --- a/ext/phar/tests/delete_in_phar_b.phpt +++ b/ext/phar/tests/delete_in_phar_b.phpt diff --git a/ext/phar/tests/metadata_write.phpt b/ext/phar/tests/metadata_write.phpt index 1aaa30d63..1aaa30d63 100755..100644 --- a/ext/phar/tests/metadata_write.phpt +++ b/ext/phar/tests/metadata_write.phpt diff --git a/ext/phar/tests/metadata_write_commit.phpt b/ext/phar/tests/metadata_write_commit.phpt index fd2f10762..fd2f10762 100755..100644 --- a/ext/phar/tests/metadata_write_commit.phpt +++ b/ext/phar/tests/metadata_write_commit.phpt diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index ef48906de..ef48906de 100755..100644 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index f64d538ef..f64d538ef 100755..100644 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 45131c489..45131c489 100755..100644 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index d79005111..d79005111 100755..100644 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt diff --git a/ext/phar/tests/phar_begin_setstub_commit.phpt b/ext/phar/tests/phar_begin_setstub_commit.phpt index 9d3e38323..9d3e38323 100755..100644 --- a/ext/phar/tests/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/phar_begin_setstub_commit.phpt diff --git a/ext/phar/tests/phar_commitwrite.phpt b/ext/phar/tests/phar_commitwrite.phpt index 8e3668133..36d473e5c 100644 --- a/ext/phar/tests/phar_commitwrite.phpt +++ b/ext/phar/tests/phar_commitwrite.phpt @@ -39,4 +39,4 @@ Phar::mapPhar('brandnewphar.phar'); include 'phar://brandnewphar.phar/startup.php'; __HALT_COMPILER(); ?> " -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt index 1828fe745..4b0e6594f 100644 --- a/ext/phar/tests/phar_create_in_cwd.phpt +++ b/ext/phar/tests/phar_create_in_cwd.phpt @@ -42,4 +42,4 @@ Phar::mapPhar('brandnewphar.phar'); include 'phar://brandnewphar.phar/startup.php'; __HALT_COMPILER(); ?> " -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/phar/tests/phar_gobyebye.phpt b/ext/phar/tests/phar_gobyebye.phpt index 93e153bdf..608e95076 100644 --- a/ext/phar/tests/phar_gobyebye.phpt +++ b/ext/phar/tests/phar_gobyebye.phpt @@ -44,4 +44,4 @@ bool(false) bool(false) Warning: opendir(foo/hi): failed to open dir: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/phar/tests/phar_mount.phpt b/ext/phar/tests/phar_mount.phpt index 73bd489a2..80f8cda38 100644 --- a/ext/phar/tests/phar_mount.phpt +++ b/ext/phar/tests/phar_mount.phpt @@ -60,4 +60,4 @@ Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.tar failed Mounting of /oops to /home/oops/../../etc/passwd: within phar %sphar_mount.phar.php failed <?php $fname = dirname(__FILE__) . '/' . basename( -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/phar/tests/phar_offset_get_error.phpt b/ext/phar/tests/phar_offset_get_error.phpt index dade4726d..dade4726d 100755..100644 --- a/ext/phar/tests/phar_offset_get_error.phpt +++ b/ext/phar/tests/phar_offset_get_error.phpt diff --git a/ext/phar/tests/phar_oo_001.phpt b/ext/phar/tests/phar_oo_001.phpt index 7a81bbb4b..7a81bbb4b 100755..100644 --- a/ext/phar/tests/phar_oo_001.phpt +++ b/ext/phar/tests/phar_oo_001.phpt diff --git a/ext/phar/tests/phar_oo_002.phpt b/ext/phar/tests/phar_oo_002.phpt index 3754151d4..3754151d4 100755..100644 --- a/ext/phar/tests/phar_oo_002.phpt +++ b/ext/phar/tests/phar_oo_002.phpt diff --git a/ext/phar/tests/phar_oo_003.phpt b/ext/phar/tests/phar_oo_003.phpt index ccaf7c65f..ccaf7c65f 100755..100644 --- a/ext/phar/tests/phar_oo_003.phpt +++ b/ext/phar/tests/phar_oo_003.phpt diff --git a/ext/phar/tests/phar_oo_004.phpt b/ext/phar/tests/phar_oo_004.phpt index ba6774984..ba6774984 100755..100644 --- a/ext/phar/tests/phar_oo_004.phpt +++ b/ext/phar/tests/phar_oo_004.phpt diff --git a/ext/phar/tests/phar_oo_005.phpt b/ext/phar/tests/phar_oo_005.phpt index cb3f29872..cb3f29872 100755..100644 --- a/ext/phar/tests/phar_oo_005.phpt +++ b/ext/phar/tests/phar_oo_005.phpt diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt index 556c98ce0..556c98ce0 100755..100644 --- a/ext/phar/tests/phar_oo_006.phpt +++ b/ext/phar/tests/phar_oo_006.phpt diff --git a/ext/phar/tests/phar_oo_007.phpt b/ext/phar/tests/phar_oo_007.phpt index 788b11f1f..788b11f1f 100755..100644 --- a/ext/phar/tests/phar_oo_007.phpt +++ b/ext/phar/tests/phar_oo_007.phpt diff --git a/ext/phar/tests/phar_oo_008.phpt b/ext/phar/tests/phar_oo_008.phpt index 80d1ece0c..80d1ece0c 100755..100644 --- a/ext/phar/tests/phar_oo_008.phpt +++ b/ext/phar/tests/phar_oo_008.phpt diff --git a/ext/phar/tests/phar_oo_009.phpt b/ext/phar/tests/phar_oo_009.phpt index 6abd03ee3..6abd03ee3 100755..100644 --- a/ext/phar/tests/phar_oo_009.phpt +++ b/ext/phar/tests/phar_oo_009.phpt diff --git a/ext/phar/tests/phar_oo_010.phpt b/ext/phar/tests/phar_oo_010.phpt index 1d3ff7324..1d3ff7324 100755..100644 --- a/ext/phar/tests/phar_oo_010.phpt +++ b/ext/phar/tests/phar_oo_010.phpt diff --git a/ext/phar/tests/phar_oo_011b.phpt b/ext/phar/tests/phar_oo_011b.phpt index 36d9963a2..36d9963a2 100755..100644 --- a/ext/phar/tests/phar_oo_011b.phpt +++ b/ext/phar/tests/phar_oo_011b.phpt diff --git a/ext/phar/tests/phar_oo_012b.phpt b/ext/phar/tests/phar_oo_012b.phpt index 80d8ed8dc..80d8ed8dc 100755..100644 --- a/ext/phar/tests/phar_oo_012b.phpt +++ b/ext/phar/tests/phar_oo_012b.phpt diff --git a/ext/phar/tests/phar_oo_compressed_001b.phpt b/ext/phar/tests/phar_oo_compressed_001b.phpt index 6d4c73286..6d4c73286 100755..100644 --- a/ext/phar/tests/phar_oo_compressed_001b.phpt +++ b/ext/phar/tests/phar_oo_compressed_001b.phpt diff --git a/ext/phar/tests/phar_oo_compressed_002.phpt b/ext/phar/tests/phar_oo_compressed_002.phpt index d4ec5cb72..d4ec5cb72 100755..100644 --- a/ext/phar/tests/phar_oo_compressed_002.phpt +++ b/ext/phar/tests/phar_oo_compressed_002.phpt diff --git a/ext/phar/tests/phar_oo_compressed_002b.phpt b/ext/phar/tests/phar_oo_compressed_002b.phpt index d7213fdba..d7213fdba 100755..100644 --- a/ext/phar/tests/phar_oo_compressed_002b.phpt +++ b/ext/phar/tests/phar_oo_compressed_002b.phpt diff --git a/ext/phar/tests/phar_stub_error.phpt b/ext/phar/tests/phar_stub_error.phpt index bb5d63bcf..bb5d63bcf 100755..100644 --- a/ext/phar/tests/phar_stub_error.phpt +++ b/ext/phar/tests/phar_stub_error.phpt diff --git a/ext/phar/tests/phar_stub_write.phpt b/ext/phar/tests/phar_stub_write.phpt index ecdb3b9b6..ecdb3b9b6 100755..100644 --- a/ext/phar/tests/phar_stub_write.phpt +++ b/ext/phar/tests/phar_stub_write.phpt diff --git a/ext/phar/tests/phar_stub_write_file.phpt b/ext/phar/tests/phar_stub_write_file.phpt index e4c867681..e4c867681 100755..100644 --- a/ext/phar/tests/phar_stub_write_file.phpt +++ b/ext/phar/tests/phar_stub_write_file.phpt diff --git a/ext/phar/tests/refcount1_5_2.phpt b/ext/phar/tests/refcount1_5_2.phpt index bf2c2b76b..bf2c2b76b 100755..100644 --- a/ext/phar/tests/refcount1_5_2.phpt +++ b/ext/phar/tests/refcount1_5_2.phpt diff --git a/ext/phar/tests/rename_dir_and_mount.phpt b/ext/phar/tests/rename_dir_and_mount.phpt index b74f47b91..b74f47b91 100755..100644 --- a/ext/phar/tests/rename_dir_and_mount.phpt +++ b/ext/phar/tests/rename_dir_and_mount.phpt diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index fa631e618..fa631e618 100755..100644 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index aeb28b02b..aeb28b02b 100755..100644 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index 2ea557b8a..2ea557b8a 100755..100644 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index f7cbb3a9a..f7cbb3a9a 100755..100644 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt diff --git a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt index d18f32ed3..d18f32ed3 100755..100644 --- a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt diff --git a/ext/phar/tests/tar/phar_stub_error.phpt b/ext/phar/tests/tar/phar_stub_error.phpt index 61532b9b4..61532b9b4 100755..100644 --- a/ext/phar/tests/tar/phar_stub_error.phpt +++ b/ext/phar/tests/tar/phar_stub_error.phpt diff --git a/ext/phar/tests/tar/refcount1_5_2.phpt b/ext/phar/tests/tar/refcount1_5_2.phpt index 18587d91a..18587d91a 100755..100644 --- a/ext/phar/tests/tar/refcount1_5_2.phpt +++ b/ext/phar/tests/tar/refcount1_5_2.phpt diff --git a/ext/phar/tests/zip/open_for_write_existing_b.phpt b/ext/phar/tests/zip/open_for_write_existing_b.phpt index b997c6829..b997c6829 100755..100644 --- a/ext/phar/tests/zip/open_for_write_existing_b.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_b.phpt diff --git a/ext/phar/tests/zip/open_for_write_existing_c.phpt b/ext/phar/tests/zip/open_for_write_existing_c.phpt index 313ee4ab3..313ee4ab3 100755..100644 --- a/ext/phar/tests/zip/open_for_write_existing_c.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_c.phpt diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index 96fd2e426..96fd2e426 100755..100644 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index ef580cb22..ef580cb22 100755..100644 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt diff --git a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt index dc59f2f3a..dc59f2f3a 100755..100644 --- a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt diff --git a/ext/phar/tests/zip/phar_stub_error.phpt b/ext/phar/tests/zip/phar_stub_error.phpt index dafb312cf..dafb312cf 100755..100644 --- a/ext/phar/tests/zip/phar_stub_error.phpt +++ b/ext/phar/tests/zip/phar_stub_error.phpt diff --git a/ext/phar/tests/zip/refcount1_5_2.phpt b/ext/phar/tests/zip/refcount1_5_2.phpt index f3b2771f4..f3b2771f4 100755..100644 --- a/ext/phar/tests/zip/refcount1_5_2.phpt +++ b/ext/phar/tests/zip/refcount1_5_2.phpt diff --git a/ext/phar/util.c b/ext/phar/util.c index 5fcb2b657..f674bca4f 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -2118,8 +2118,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat #ifdef PHAR_HAVE_OPENSSL BIO *in; EVP_PKEY *key; - EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); - EVP_MD_CTX md_ctx; + EVP_MD_CTX *md_ctx; in = BIO_new_mem_buf(PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len)); @@ -2140,15 +2139,30 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat return FAILURE; } + md_ctx = EVP_MD_CTX_create(); + siglen = EVP_PKEY_size(key); sigbuf = emalloc(siglen + 1); - EVP_SignInit(&md_ctx, mdtype); + + if (!EVP_SignInit(md_ctx, EVP_sha1())) { + efree(sigbuf); + if (error) { + 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) { - EVP_SignUpdate(&md_ctx, buf, sig_len); + if (!EVP_SignUpdate(md_ctx, buf, sig_len)) { + efree(sigbuf); + if (error) { + spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); + } + return FAILURE; + } } - if (!EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, key)) { + if (!EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, key)) { efree(sigbuf); if (error) { spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); @@ -2157,7 +2171,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat } sigbuf[siglen] = '\0'; - EVP_MD_CTX_cleanup(&md_ctx); + EVP_MD_CTX_destroy(md_ctx); #else sigbuf = NULL; siglen = 0; |