pollita Mon Oct 2 01:38:06 2006 UTC Modified files: /php-src/ext/hash hash.c /php-src/ext/hash/tests adler32.phpt crc32.phpt gost.phpt haval.phpt hmac-md5.phpt md2.phpt md4.phpt md5.phpt ripemd128.phpt ripemd160.phpt ripemd256.phpt ripemd320.phpt sha1.phpt sha256.phpt sha384.phpt sha512.phpt snefru.phpt tiger.phpt whirlpool.phpt Log: Allow hash()/hash_hmac() to accept ascii-unicode data, Update tests to work in unicode.semantics mode.
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash.c?r1=1.31&r2=1.32&diff_format=u Index: php-src/ext/hash/hash.c diff -u php-src/ext/hash/hash.c:1.31 php-src/ext/hash/hash.c:1.32 --- php-src/ext/hash/hash.c:1.31 Wed Sep 20 01:48:06 2006 +++ php-src/ext/hash/hash.c Mon Oct 2 01:38:05 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hash.c,v 1.31 2006/09/20 01:48:06 pollita Exp $ */ +/* $Id: hash.c,v 1.32 2006/10/02 01:38:05 pollita Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -84,9 +84,12 @@ RETURN_FALSE; } } else { - /* Unicode string passed for raw hashing */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unicode strings can not be hashed. Convert to a binary type."); - RETURN_FALSE; + data = zend_unicode_to_ascii((UChar*)data, data_len TSRMLS_CC); + if (!data) { + /* Non-ASCII Unicode string passed for raw hashing */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received"); + RETURN_FALSE; + } } } #else @@ -94,25 +97,19 @@ return; } #endif + /* Assume failure */ + RETVAL_FALSE; ops = php_hash_fetch_ops(algo, algo_len); if (!ops) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo); - if (data_type != IS_STRING) { - /* Original filename was UNICODE, this string is a converted copy */ - efree(data); - } - RETURN_FALSE; + goto hash_done; } if (isfilename) { stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT); - if (data_type != IS_STRING) { - /* Original filename was UNICODE, this string is a converted copy */ - efree(data); - } if (!stream) { /* Stream will report errors opening file */ - RETURN_FALSE; + goto hash_done; } } @@ -137,14 +134,27 @@ if (raw_output) { digest[ops->digest_size] = 0; - RETURN_STRINGL(digest, ops->digest_size, 0); + + /* Raw output is binary only */ + RETVAL_STRINGL(digest, ops->digest_size, 0); } else { char *hex_digest = safe_emalloc(ops->digest_size, 2, 1); php_hash_bin2hex(hex_digest, (unsigned char *) digest, ops->digest_size); hex_digest[2 * ops->digest_size] = 0; efree(digest); - RETURN_STRINGL(hex_digest, 2 * ops->digest_size, 0); + + /* hexits can be binary or unicode */ +#if PHP_MAJOR_VERSION >= 6 + RETVAL_RT_STRINGL(hex_digest, 2 * ops->digest_size, ZSTR_AUTOFREE); +#else + RETVAL_STRINGL(hex_digest, 2 * ops->digest_size, 0); +#endif + } + +hash_done: + if (data_type != IS_STRING) { + efree(data); } } @@ -168,14 +178,14 @@ { char *algo, *data, *digest, *key, *K; int algo_len, data_len, key_len, i; - zend_uchar data_type = IS_STRING; + zend_uchar data_type = IS_STRING, key_type = IS_STRING; zend_bool raw_output = 0; php_hash_ops *ops; void *context; php_stream *stream = NULL; #if PHP_MAJOR_VERSION >= 6 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "stS|b", &algo, &algo_len, &data, &data_len, &data_type, &key, &key_len, &raw_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "stt|b", &algo, &algo_len, &data, &data_len, &data_type, &key, &key_len, &key_type, &raw_output) == FAILURE) { return; } @@ -185,8 +195,22 @@ RETURN_FALSE; } } else { - /* Unicode string passed for raw hashing */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unicode strings can not be hashed. Convert to a binary type."); + data = zend_unicode_to_ascii((UChar*)data, data_len TSRMLS_CC); + if (!data) { + /* Non-ASCII Unicode string passed for raw hashing */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received"); + RETURN_FALSE; + } + } + } + if (key_type == IS_UNICODE) { + key = zend_unicode_to_ascii((UChar*)key, key_len TSRMLS_CC); + if (!key) { + /* Non-ASCII Unicode key passed for raw hashing */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode key expected, non-ASCII-Unicode key received"); + if (data_type == IS_UNICODE) { + efree(data); + } RETURN_FALSE; } } @@ -195,25 +219,19 @@ return; } #endif + /* Assume failure */ + RETVAL_FALSE; ops = php_hash_fetch_ops(algo, algo_len); if (!ops) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo); - if (data_type != IS_STRING) { - /* Original filename was UNICODE, this string is a converted copy */ - efree(data); - } - RETURN_FALSE; + goto hmac_done; } if (isfilename) { stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT); - if (data_type != IS_STRING) { - /* Original filename was UNICODE, this string is a converted copy */ - efree(data); - } if (!stream) { /* Stream will report errors opening file */ - RETURN_FALSE; + goto hmac_done; } } @@ -227,6 +245,7 @@ /* Reduce the key first */ ops->hash_update(context, (unsigned char *) key, key_len); ops->hash_final((unsigned char *) K, context); + /* Make the context ready to start over */ ops->hash_init(context); } else { @@ -272,14 +291,30 @@ if (raw_output) { digest[ops->digest_size] = 0; - RETURN_STRINGL(digest, ops->digest_size, 0); + + /* Raw output is binary only */ + RETVAL_STRINGL(digest, ops->digest_size, 0); } else { char *hex_digest = safe_emalloc(ops->digest_size, 2, 1); php_hash_bin2hex(hex_digest, (unsigned char *) digest, ops->digest_size); hex_digest[2 * ops->digest_size] = 0; efree(digest); - RETURN_STRINGL(hex_digest, 2 * ops->digest_size, 0); + + /* hexits can be binary or unicode */ +#if PHP_MAJOR_VERSION >= 6 + RETVAL_RT_STRINGL(hex_digest, 2 * ops->digest_size, ZSTR_AUTOFREE); +#else + RETVAL_STRINGL(hex_digest, 2 * ops->digest_size, 0); +#endif + } + +hmac_done: + if (data_type != IS_STRING) { + efree(data); + } + if (key_type != IS_STRING) { + efree(key); } } @@ -306,12 +341,13 @@ { char *algo, *key = NULL; int algo_len, key_len = 0, argc = ZEND_NUM_ARGS(); + zend_uchar key_type; long options = 0; void *context; php_hash_ops *ops; php_hash_data *hash; - if (zend_parse_parameters(argc TSRMLS_CC, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, "s|lt", &algo, &algo_len, &options, &key, &key_len, &key_type) == FAILURE) { return; } @@ -328,6 +364,15 @@ RETURN_FALSE; } + if (key_type == IS_UNICODE) { + key = zend_unicode_to_ascii((UChar*)key, key_len TSRMLS_CC); + if (!key) { + /* Non-ASCII Unicode key passed for raw hashing */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode key expected, non-ASCII-Unicode key received"); + RETURN_FALSE; + } + } + context = emalloc(ops->context_size); ops->hash_init(context); @@ -361,16 +406,14 @@ hash->key = (unsigned char *) K; } + if (key_type == IS_UNICODE) { + efree(key); + } + ZEND_REGISTER_RESOURCE(return_value, hash, php_hash_le_hash); } /* }}} */ -#if PHP_MAJOR_VERSION >= 6 -# define PHP_HASH_UPDATE_ARGS "rS" -#else -# define PHP_HASH_UPDATE_ARGS "rs" -#endif - /* {{{ proto bool hash_update(resource context, string data) U Pump data into the hashing algorithm */ PHP_FUNCTION(hash_update) @@ -379,15 +422,35 @@ php_hash_data *hash; char *data; int data_len; + zend_uchar data_type = IS_STRING; + +#if PHP_MAJOR_VERSION >= 6 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rt", &zhash, &data, &data_len, &data_type) == FAILURE) { + return; + } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, PHP_HASH_UPDATE_ARGS, &zhash, &data, &data_len) == FAILURE) { + if (data_type == IS_UNICODE) { + data = zend_unicode_to_ascii((UChar*)data, data_len TSRMLS_CC); + if (!data) { + /* Non-ASCII Unicode string passed for raw hashing */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received"); + RETURN_FALSE; + } + } +#else + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zhash, &data, &data_len) == FAILURE) { return; } +#endif ZEND_FETCH_RESOURCE(hash, php_hash_data*, &zhash, -1, PHP_HASH_RESNAME, php_hash_le_hash); hash->ops->hash_update(hash->context, (unsigned char *) data, data_len); + if (data_type != IS_STRING) { + efree(data); + } + RETURN_TRUE; } /* }}} */ @@ -534,6 +597,7 @@ zend_list_delete(Z_RESVAL_P(zhash)); if (raw_output) { + /* Raw output can only be binary */ RETURN_STRINGL(digest, digest_len, 0); } else { char *hex_digest = safe_emalloc(digest_len,2,1); @@ -541,7 +605,13 @@ php_hash_bin2hex(hex_digest, (unsigned char *) digest, digest_len); hex_digest[2 * digest_len] = 0; efree(digest); - RETURN_STRINGL(hex_digest, 2 * digest_len, 0); + + /* Hexits can be either binary or unicode */ +#if PHP_MAJOR_VERSION >= 6 + RETURN_RT_STRINGL(hex_digest, 2 * digest_len, ZSTR_AUTOFREE); +#else + RETURN_STRINGL(hex_digest, 2 * digest_len, 0); +#endif } } /* }}} */ @@ -565,7 +635,7 @@ (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) { #if (PHP_MAJOR_VERSION >= 6) - add_next_index_stringl(return_value, str.s, str_len-1, 1); + add_next_index_ascii_stringl(return_value, str.s, str_len-1, 1); #else add_next_index_stringl(return_value, str, str_len-1, 1); #endif http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/adler32.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/adler32.phpt diff -u php-src/ext/hash/tests/adler32.phpt:1.3 php-src/ext/hash/tests/adler32.phpt:1.4 --- php-src/ext/hash/tests/adler32.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/adler32.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- ADLER32 --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('adler32', ''), "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/crc32.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/crc32.phpt diff -u php-src/ext/hash/tests/crc32.phpt:1.2 php-src/ext/hash/tests/crc32.phpt:1.3 --- php-src/ext/hash/tests/crc32.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/crc32.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- CRC32 --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('crc32', ''), "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/gost.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/gost.phpt diff -u php-src/ext/hash/tests/gost.phpt:1.2 php-src/ext/hash/tests/gost.phpt:1.3 --- php-src/ext/hash/tests/gost.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/gost.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- gost --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('gost', ''), "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/haval.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/haval.phpt diff -u php-src/ext/hash/tests/haval.phpt:1.3 php-src/ext/hash/tests/haval.phpt:1.4 --- php-src/ext/hash/tests/haval.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/haval.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- haval algorithm (multi-vector, multi-pass, multi-width) --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo "Empty String\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hmac-md5.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/hash/tests/hmac-md5.phpt diff -u php-src/ext/hash/tests/hmac-md5.phpt:1.4 php-src/ext/hash/tests/hmac-md5.phpt:1.5 --- php-src/ext/hash/tests/hmac-md5.phpt:1.4 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/hmac-md5.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,8 @@ --TEST-- hmac-md5 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php +if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php /* Test Vectors from RFC 2104 */ @@ -18,3 +19,8 @@ 9294727a3638bb1c13f48ef8158bfc9d 750c783e6ab0b503eaa86e310a5db738 56be34521d144c88dbb8c733f0e8b3f6 +--UEXPECTF-- +9294727a3638bb1c13f48ef8158bfc9d +750c783e6ab0b503eaa86e310a5db738 + +Warning: hash_hmac(): Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received in %s/tests/hmac-md5.php on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/md2.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/md2.phpt diff -u php-src/ext/hash/tests/md2.phpt:1.2 php-src/ext/hash/tests/md2.phpt:1.3 --- php-src/ext/hash/tests/md2.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/md2.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- md2 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('md2', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/md4.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/md4.phpt diff -u php-src/ext/hash/tests/md4.phpt:1.2 php-src/ext/hash/tests/md4.phpt:1.3 --- php-src/ext/hash/tests/md4.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/md4.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- md4 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php /* RFC 1320 vectors */ http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/md5.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/md5.phpt diff -u php-src/ext/hash/tests/md5.phpt:1.3 php-src/ext/hash/tests/md5.phpt:1.4 --- php-src/ext/hash/tests/md5.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/md5.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- md5 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('md5', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/ripemd128.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/ripemd128.phpt diff -u php-src/ext/hash/tests/ripemd128.phpt:1.3 php-src/ext/hash/tests/ripemd128.phpt:1.4 --- php-src/ext/hash/tests/ripemd128.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/ripemd128.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- ripemd128 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('ripemd128', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/ripemd160.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/ripemd160.phpt diff -u php-src/ext/hash/tests/ripemd160.phpt:1.3 php-src/ext/hash/tests/ripemd160.phpt:1.4 --- php-src/ext/hash/tests/ripemd160.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/ripemd160.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- ripemd160 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('ripemd160', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/ripemd256.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/hash/tests/ripemd256.phpt diff -u php-src/ext/hash/tests/ripemd256.phpt:1.1 php-src/ext/hash/tests/ripemd256.phpt:1.2 --- php-src/ext/hash/tests/ripemd256.phpt:1.1 Wed Sep 20 01:48:06 2006 +++ php-src/ext/hash/tests/ripemd256.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- ripemd256 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('ripemd256', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/ripemd320.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/hash/tests/ripemd320.phpt diff -u php-src/ext/hash/tests/ripemd320.phpt:1.1 php-src/ext/hash/tests/ripemd320.phpt:1.2 --- php-src/ext/hash/tests/ripemd320.phpt:1.1 Wed Sep 20 01:48:06 2006 +++ php-src/ext/hash/tests/ripemd320.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- ripemd320 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('ripemd320', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/sha1.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/sha1.phpt diff -u php-src/ext/hash/tests/sha1.phpt:1.3 php-src/ext/hash/tests/sha1.phpt:1.4 --- php-src/ext/hash/tests/sha1.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/sha1.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- sha1 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('sha1', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/sha256.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/sha256.phpt diff -u php-src/ext/hash/tests/sha256.phpt:1.3 php-src/ext/hash/tests/sha256.phpt:1.4 --- php-src/ext/hash/tests/sha256.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/sha256.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- sha256 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('sha256', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/sha384.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/hash/tests/sha384.phpt diff -u php-src/ext/hash/tests/sha384.phpt:1.4 php-src/ext/hash/tests/sha384.phpt:1.5 --- php-src/ext/hash/tests/sha384.phpt:1.4 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/sha384.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- sha384 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('sha384', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/sha512.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/sha512.phpt diff -u php-src/ext/hash/tests/sha512.phpt:1.3 php-src/ext/hash/tests/sha512.phpt:1.4 --- php-src/ext/hash/tests/sha512.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/sha512.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- sha512 algorithm --SKIPIF-- -<?php if(!extension_loaded("hash") || ini_get('unicode.semantics')) print "skip"; ?> +<?php if(!extension_loaded("hash")) print "skip"; ?> --FILE-- <?php echo hash('sha512', '') . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/snefru.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/snefru.phpt diff -u php-src/ext/hash/tests/snefru.phpt:1.2 php-src/ext/hash/tests/snefru.phpt:1.3 --- php-src/ext/hash/tests/snefru.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/snefru.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- snefru --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('snefru', ''), "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/tiger.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/hash/tests/tiger.phpt diff -u php-src/ext/hash/tests/tiger.phpt:1.3 php-src/ext/hash/tests/tiger.phpt:1.4 --- php-src/ext/hash/tests/tiger.phpt:1.3 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/tiger.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- tiger --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('tiger192,3', ''),"\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/whirlpool.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/hash/tests/whirlpool.phpt diff -u php-src/ext/hash/tests/whirlpool.phpt:1.2 php-src/ext/hash/tests/whirlpool.phpt:1.3 --- php-src/ext/hash/tests/whirlpool.phpt:1.2 Wed Sep 20 00:32:54 2006 +++ php-src/ext/hash/tests/whirlpool.phpt Mon Oct 2 01:38:05 2006 @@ -1,7 +1,7 @@ --TEST-- whirlpool --SKIPIF-- -<?php if (!extension_loaded('hash') || ini_get('unicode.semantics')) die('skip'); ?> +<?php if (!extension_loaded('hash')) die('skip'); ?> --FILE-- <?php echo hash('whirlpool', ''), "\n";
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php