Annotation of embedaddon/php/ext/hash/tests/bug52240.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes)
3: --SKIPIF--
4: <?php extension_loaded('hash') or die('skip'); ?>
5: --FILE--
6: <?php
7:
8: $h = hash_init('crc32b', HASH_HMAC, '123456' );
9: $h2 = hash_copy($h);
10: var_dump(hash_final($h));
11: $h3 = hash_copy($h2);
12: var_dump(hash_final($h2));
13: var_dump(hash_final($h3));
14:
15: ?>
16: --EXPECT--
17: string(8) "278af264"
18: string(8) "278af264"
19: string(8) "278af264"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>