1--TEST-- 2Phar: verify signature parsing works 3--EXTENSIONS-- 4phar 5--SKIPIF-- 6<?php 7$arr = Phar::getSupportedSignatures(); 8if (!in_array("OpenSSL", $arr)) die("skip openssl support required"); 9?> 10--INI-- 11phar.require_hash=0 12phar.readonly=0 13--FILE-- 14<?php 15$a = new Phar(__DIR__ . '/files/sha1.phar'); 16$r = $a->getSignature(); 17var_dump($r['hash_type']); 18$a = new Phar(__DIR__ . '/files/sha512.phar'); 19$r = $a->getSignature(); 20var_dump($r['hash_type']); 21$a = new Phar(__DIR__ . '/files/sha256.phar'); 22$r = $a->getSignature(); 23var_dump($r['hash_type']); 24$a = new Phar(__DIR__ . '/files/md5.phar'); 25$r = $a->getSignature(); 26var_dump($r['hash_type']); 27$a = new Phar(__DIR__ . '/files/openssl.phar'); 28$r = $a->getSignature(); 29var_dump($r['hash_type']); 30$a = new Phar(__DIR__ . '/files/openssl256.phar'); 31$r = $a->getSignature(); 32var_dump($r['hash_type']); 33$a = new Phar(__DIR__ . '/files/openssl512.phar'); 34$r = $a->getSignature(); 35var_dump($r['hash_type']); 36?> 37--EXPECT-- 38string(5) "SHA-1" 39string(7) "SHA-512" 40string(7) "SHA-256" 41string(3) "MD5" 42string(7) "OpenSSL" 43string(14) "OpenSSL_SHA256" 44string(14) "OpenSSL_SHA512" 45