Bug #69271 [NEW]: ext/phar/tests/zip/phar_setsignaturealgo2.phpt fails
| From: | ondrej@php.net | Date: | Fri, 20 Mar 2015 15:05:11 +0000 |
| Subject: | Bug #69271 [NEW]: ext/phar/tests/zip/phar_setsignaturealgo2.phpt fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-191488@lists.php.net to get a copy of this message | ||
From: ondrej
Operating system: Debian wheezy
PHP version: 5.4.39
Package: PHAR related
Bug Type: Bug
Bug description:ext/phar/tests/zip/phar_setsignaturealgo2.phpt fails
Description:
------------
It looks like there's something fishy going on in phar/zip, as the test
fails with the SHA-512 output listed twice instead of one SHA-512 and
one OpenSSL.
Rerunning the test manually (copying out the script part from .phpt)
works fine:
php -n -d phar.require_hash=0 -d phar.readonly=0
phar_setsignaturealgo2.php
[...see Expected results...]
so this might happen only in a very rare cases, but I don't recall this
happening before, so it might have been introduced in 5.4.39.
Looks like this might happen if signing with openssl fails (the SHA-512
signature is retained), related bug:
https://bugs.php.net/bug.php?id=61906
Unfortunately no warnings were provided this time and I cannot reproduce
the issue except this one build.
Test script:
---------------
Standard test as found in
ext/phar/tests/zip/phar_setsignaturealgo2.phpt
Expected result:
----------------
array(2) {
["hash"]=>
string(32) "41F52A687D44E275EDD28190A95BA9A7"
["hash_type"]=>
string(3) "MD5"
}
array(2) {
["hash"]=>
string(32) "41F52A687D44E275EDD28190A95BA9A7"
["hash_type"]=>
string(3) "MD5"
}
array(2) {
["hash"]=>
string(40) "BB20CA7A9336A23FABA77DF462D249AA17EF8BA1"
["hash_type"]=>
string(5) "SHA-1"
}
array(2) {
["hash"]=>
string(64)
"2B70E40D73E36B241804714D2F66DE10A00763AE17911EB0385181F98841CB3A"
["hash_type"]=>
string(7) "SHA-256"
}
array(2) {
["hash"]=>
string(128)
"624BECAE7FE58642594E0A2ECDE2729D86E35955E6461CE287C1A1A5D040CF902CE2EA2DB1EB5D76B2B64F5F7DDA9613FE63C15A46435120408FE92ED67F104A"
["hash_type"]=>
string(7) "SHA-512"
}
array(2) {
["hash"]=>
string(256)
"CD8B9E756A7096EE51420C130814AA8585E05E8004DA05EE6B1E035087CB05574BF5C40D8353E432EE2C904E99D1E77F71F6942E2F2CB747695CE6C7C46EC3F3E41DE636C7077DAC54E7049A4F361C1C9B39EA8E535B816AB3D8794DAD5915A09D1A505FD4C165ACAF46D78D9A6CDDBE7AFE6FC65C67AB7684A0EC593B8361AF"
["hash_type"]=>
string(7) "OpenSSL"
}
Actual result:
--------------
array(2) {
["hash"]=>
string(40) "3D26CC3B912BBB02C55F649706E8B39883C60E88"
["hash_type"]=>
string(5) "SHA-1"
}
array(2) {
["hash"]=>
string(32) "B8B09BC157C79208E9E8FF6D65C22591"
["hash_type"]=>
string(3) "MD5"
}
array(2) {
["hash"]=>
string(40) "3D26CC3B912BBB02C55F649706E8B39883C60E88"
["hash_type"]=>
string(5) "SHA-1"
}
array(2) {
["hash"]=>
string(64)
"ED774B2ACAC8AE2C806CC0C205B26EF3E757C5F5893AC59B7F0B432D8F777939"
["hash_type"]=>
string(7) "SHA-256"
}
array(2) {
["hash"]=>
string(128)
"F6A3978098FA4ED528FB354C5AC026F82C7A33561C1D7A89753830B33666BB304EAB062C4C9A808547F5C220F0B13CBD7F548D401489F8645BB12302F689D09E"
["hash_type"]=>
string(7) "SHA-512"
}
array(2) {
["hash"]=>
string(128)
"F6A3978098FA4ED528FB354C5AC026F82C7A33561C1D7A89753830B33666BB304EAB062C4C9A808547F5C220F0B13CBD7F548D401489F8645BB12302F689D09E"
["hash_type"]=>
string(7) "SHA-512"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=69271&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69271&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69271&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69271&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69271&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69271&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69271&r=mysqlcfg