Update hash tests for consistency in their titles and remove the skipif sections (except for the mhash related tests)

This commit is contained in:
Kalle Sommer Nielsen 2018-10-03 08:48:11 +02:00
parent bf34442581
commit f73c0102d6
63 changed files with 67 additions and 198 deletions

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
ADLER32 Hash: ADLER32 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('adler32', ''), "\n"; echo hash('adler32', ''), "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes) Bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes)
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Bug #64745 hash_pbkdf2() truncates data when using default length and hex output Bug #64745 (hash_pbkdf2() truncates data when using default length and hex output)
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
$hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0); $hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0);

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Bug #70312 HAVAL gives wrong hashes in specific cases Bug #70312 (HAVAL gives wrong hashes in specific cases)
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
var_dump(hash('haval128,5', '1234567890123456789012345678901234567890123456789012345678901234')); var_dump(hash('haval128,5', '1234567890123456789012345678901234567890123456789012345678901234'));
@ -15,4 +13,4 @@ string(32) "f3f0d23819b87228b4b70ee350afaa9d"
string(40) "aded6485e137f11d7292212ba3fa961714df0564" string(40) "aded6485e137f11d7292212ba3fa961714df0564"
string(48) "e53da2b16269fe732e9a898a96707a9f28404d7333b02286" string(48) "e53da2b16269fe732e9a898a96707a9f28404d7333b02286"
string(56) "c574fb307f0817b514b9bb2e7c4bfaffb7ad667aca3c8b523fefcf10" string(56) "c574fb307f0817b514b9bb2e7c4bfaffb7ad667aca3c8b523fefcf10"
string(64) "fb73c19300b14d5cb393d929bf005e6c2d459a4c9c009e9813af1d2d3637ee8f" string(64) "fb73c19300b14d5cb393d929bf005e6c2d459a4c9c009e9813af1d2d3637ee8f"

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Bug #73127 (gost-crypto hash incorrect if input data contains long 0xFF sequence) Bug #73127 (gost-crypto hash incorrect if input data contains long 0xFF sequence)
--SKIPIF--
<?php if(!extension_loaded('hash')) die('skip hash extension not loaded'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
CRC32 Hash: CRC32 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('crc32', ''), "\n"; echo hash('crc32', ''), "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
FNV Hash: FNV132 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
FNV Hash: FNV164 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
FNV Hash: FNV1a32 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
FNV Hash: FNV1a64 algorithm
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
gost Hash: gost algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('gost', ''), "\n"; echo hash('gost', ''), "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
hash_copy() via clone Hash: hash_copy() via clone
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_algos() function : basic functionality Hash: hash_algos() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
hash_copy() basic tests Hash: hash_copy() basic tests
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
hash_copy() errors Hash: hash_copy() errors
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
hash_equals() function Hash: hash_equals() test
--SKIPIF--
<?php if(!extension_loaded('hash')) die('skip hash extension not loaded'); ?>
--FILE-- --FILE--
<?php <?php
var_dump(hash_equals("same", "same")); var_dump(hash_equals("same", "same"));

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash() function : error conditions Hash: hash() function : error conditions
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php
@ -45,4 +43,4 @@ NULL
Warning: hash(): Unknown hashing algorithm: foo in %s on line %d Warning: hash(): Unknown hashing algorithm: foo in %s on line %d
bool(false) bool(false)
===Done=== ===Done===

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_file() function : basic functionality Hash: hash_file() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--CREDITS-- --CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com> Felix De Vliegher <felix.devliegher@gmail.com>
--FILE-- --FILE--

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_file() function : basic functionality Hash: hash_file() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_file() function : error conditions Hash: hash_file() function : error conditions
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--CREDITS-- --CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com> Felix De Vliegher <felix.devliegher@gmail.com>
--FILE-- --FILE--

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hkdf() function: basic functionality Hash: hash_hkdf() function: basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hkdf() function: edge cases Hash: hash_hkdf() function: edge cases
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hkdf() function: error conditions Hash: hash_hkdf() function: error conditions
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hkdf() function: RFC 5869 test vectors Hash: hash_hkdf() function: RFC 5869 test vectors
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hmac_algos() function : basic functionality Hash: hash_hmac_algos() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_file() function : basic functionality Hash: hash_file() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hmac() function : basic functionality Hash: hash_hmac() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php
/* /*

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hmac_file() function : basic functionality Hash: hash_hmac_file() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_hmac_file() function : basic functionality Hash: hash_hmac_file() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,9 +1,5 @@
--TEST-- --TEST--
hash_init() function - errors test Hash: hash_init() function - errors test
--SKIPIF--
<?php
if (!extension_loaded('hash')) die('skip hash extension not available');
?>
--FILE-- --FILE--
<?php <?php
echo "*** Testing hash_init(): error conditions ***\n"; echo "*** Testing hash_init(): error conditions ***\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_pbkdf2() function : basic functionality Hash: hash_pbkdf2() function : basic functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Test hash_pbkdf2() function : error functionality Hash: Test hash_pbkdf2() function : error functionality
--SKIPIF--
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,11 +1,7 @@
--TEST-- --TEST--
hash_update_file() function - basic test Hash: hash_update_file() test
--CREDITS-- --CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
--SKIPIF--
<?php
if (!extension_loaded('hash')) die('skip hash extension not available');
?>
--FILE-- --FILE--
<?php <?php
$filePath = __DIR__ . DIRECTORY_SEPARATOR . 'hash_update_stream.txt'; $filePath = __DIR__ . DIRECTORY_SEPARATOR . 'hash_update_stream.txt';

View file

@ -1,11 +1,7 @@
--TEST-- --TEST--
int hash_update_stream ( resource $context , resource $handle [, int $length = -1 ] ); Hash: hash_update_stream() test
--CREDITS-- --CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
--SKIPIF--
<?php
if (!extension_loaded('hash')) die('skip hash extension not available');
?>
--FILE-- --FILE--
<?php <?php
$fp = tmpfile(); $fp = tmpfile();

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
haval algorithm (multi-vector, multi-pass, multi-width) Hash: haval algorithm (multi-vector, multi-pass, multi-width)
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo "Empty String\n"; echo "Empty String\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
hmac-md5 algorithm Hash: hmac-md5 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
/* Test Vectors from RFC 2104 */ /* Test Vectors from RFC 2104 */

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Jenkins's one-at-a-time Hash: Jenkins's one-at-a-time
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE-- --FILE--
<?php <?php
$tests = array( $tests = array(

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
md2 algorithm Hash: md2 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('md2', '') . "\n"; echo hash('md2', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
md4 algorithm Hash: md4 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
/* RFC 1320 vectors */ /* RFC 1320 vectors */

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
md5 algorithm Hash: md5 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('md5', '') . "\n"; echo hash('md5', '') . "\n";

View file

@ -1,9 +1,7 @@
--TEST-- --TEST--
mhash() test MHash: mhash() test
--SKIPIF-- --SKIPIF--
<?php <?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?>
include "skip_mhash.inc";
?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,9 +1,7 @@
--TEST-- --TEST--
mhash_get_block_size() & mhash_get_hash_name() test MHash: mhash_get_block_size() & mhash_get_hash_name() test
--SKIPIF-- --SKIPIF--
<?php <?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?>
include "skip_mhash.inc";
?>
--FILE-- --FILE--
<?php <?php
$supported_hash_al = array( $supported_hash_al = array(

View file

@ -1,9 +1,7 @@
--TEST-- --TEST--
mhash_keygen_s2k() test MHash: mhash_keygen_s2k() test
--SKIPIF-- --SKIPIF--
<?php <?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?>
include "skip_mhash.inc";
?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,9 +1,7 @@
--TEST-- --TEST--
mhash() modifying algorithm parameter MHash: mhash() modifying algorithm parameter
--SKIPIF-- --SKIPIF--
<?php <?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?>
include "skip_mhash.inc";
?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
Attempt to instantiate a HashContext directly Hash: Attempt to instantiate a HashContext directly
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded('hash')) echo 'skip'; <?php if (!extension_loaded('hash')) echo 'skip';
--FILE-- --FILE--

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
Attempt to reuse a closed hash context Hash: Attempt to reuse a closed hash context
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded('hash')) echo 'skip'; <?php if (!extension_loaded('hash')) echo 'skip';
--FILE-- --FILE--

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
ripemd128 algorithm Hash: ripemd128 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('ripemd128', '') . "\n"; echo hash('ripemd128', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
ripemd160 algorithm Hash: ripemd160 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('ripemd160', '') . "\n"; echo hash('ripemd160', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
ripemd256 algorithm Hash: ripemd256 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('ripemd256', '') . "\n"; echo hash('ripemd256', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
ripemd320 algorithm Hash: ripemd320 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('ripemd320', '') . "\n"; echo hash('ripemd320', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
Serialize a context Hash: Context serialization
--SKIPIF--
<?php if (!extension_loaded('hash')) echo 'skip';
--FILE-- --FILE--
<?php <?php
@ -12,4 +10,4 @@ try {
echo "Exception: {$e->getMessage()}\n"; echo "Exception: {$e->getMessage()}\n";
} }
--EXPECT-- --EXPECT--
Exception: Serialization of 'HashContext' is not allowed Exception: Serialization of 'HashContext' is not allowed

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha1 algorithm Hash: sha1 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha1', '') . "\n"; echo hash('sha1', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha224 algorithm Hash: sha224 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha224', '') . "\n"; echo hash('sha224', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha256 algorithm Hash: sha256 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha256', '') . "\n"; echo hash('sha256', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha3 algorithm Hash: sha3 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha384 algorithm Hash: sha384 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha384', '') . "\n"; echo hash('sha384', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha512/224 algorithm Hash: sha512/224 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha512/224', '') . "\n"; echo hash('sha512/224', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha512/256 algorithm Hash: sha512/256 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha512/256', '') . "\n"; echo hash('sha512/256', '') . "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
sha512 algorithm Hash: sha512 algorithm
--SKIPIF--
<?php if(!extension_loaded("hash")) print "skip"; ?>
--FILE-- --FILE--
<?php <?php
echo hash('sha512', '') . "\n"; echo hash('sha512', '') . "\n";

View file

@ -1,5 +0,0 @@
<?php
if (!function_exists("mhash")) {
die("skip mhash extension is not available");
}
?>

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
snefru Hash: snefru algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('snefru', ''), "\n"; echo hash('snefru', ''), "\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
tiger Hash: tiger algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('tiger192,3', ''),"\n"; echo hash('tiger192,3', ''),"\n";

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
whirlpool Hash: whirlpool algorithm
--SKIPIF--
<?php extension_loaded('hash') or die('skip'); ?>
--FILE-- --FILE--
<?php <?php
echo hash('whirlpool', ''), "\n"; echo hash('whirlpool', ''), "\n";