Commit Graph

100 Commits

Author SHA1 Message Date
Mark
ee104cf1bb
Warnings become errors for hash_hkdf 2019-08-29 16:10:40 +02:00
Mark
960da6dff8
Warnings become errors hash stream functions (other than hash_init) 2019-08-29 16:10:08 +02:00
Mark
14c07fef74
Warnings become errors hash_init 2019-08-29 16:09:29 +02:00
Mark
21587854b4
Warnings become errors hash_hmac hash_hmac_file 2019-08-29 16:08:16 +02:00
Peter Kokot
221494f4de Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync HAVE_HASH, HAVE_HASH_EXT, PHAR_HASH_OK symbols
2019-06-27 23:29:11 +02:00
Peter Kokot
033cafacbd Sync HAVE_HASH, HAVE_HASH_EXT, PHAR_HASH_OK symbols
The hash extension is always available since PHP-7.4. The symbol
HAVE_HASH_EXT is kept for BC reasons and removed in PHP-8.0.

This patch also removes the PHAR_HASH_OK since it is no longer
relevant.
2019-06-27 23:25:33 +02:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Andrew Brampton
c79ce48ddb Fix #71890: Add support for crc32c Castagnoli's polynomial.
This variant of crc32 is heavily used by storage systems, such as iSCSI, SCTP,
Btrfs, ext4, and is increasingly being used in API (such as Google Cloud
Storage, and Apache Kafka).
2019-03-11 10:19:35 +01:00
Nikita Popov
10b4113638 Remove more zpp error tests 2019-03-05 17:09:09 +01:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Kalle Sommer Nielsen
f73c0102d6 Update hash tests for consistency in their titles and remove the skipif sections (except for the mhash related tests) 2018-10-03 08:48:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Christoph M. Becker
701d1ab0cc Fix skip condition
The test is not about mhash, but rather about hash.
2018-02-23 16:23:55 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
9a4cc52c23 Remove superfluous PHP version check in tests
Also remove tests that target only old PHP versions.
2018-02-04 16:58:54 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Sara Golemon
a6e4a713ea
Add hash_hmac_algos() for filtered is_crypto methods 2017-07-23 15:17:09 -04:00
Nikita Popov
1817a8622d Merge branch 'PHP-7.1' 2017-02-24 23:22:46 +01:00
Nikita Popov
f678b0eae2 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-24 23:22:24 +01:00
Grundik
eac8166bd4 Fix bug #73127
gost-crypto hash was incorrect if input data contained long 0xFF
sequence, due to a carry-propagation bug.
2017-02-24 23:20:49 +01:00
Nikita Popov
c61daf415d Deprecate track_errors / $php_errormsg 2017-02-03 21:02:52 +01:00
Anatol Belski
17f6f713ad fix test portability 2017-02-01 12:18:55 +01:00
=?UTF-8?q?Rouven=20We=C3=9Fling?=
b7f59be9f4 Refactor HashContext into an object.
This allows better type hinting as well as potentially adding
methods in a followup diff.

Original patch by Rouven Weßling (github.com/realityking)
Heavily modified by Sara Golemon (github.com/sgolemon)
2017-01-31 19:28:35 -08:00
Andrey Andreev
423c192791 Use hash_ops->is_crypto in hash_init() 2017-01-22 10:37:10 +01:00
Andrey Andreev
d89d149edf Disallow non-crypto hashes in HMAC and PBKDF2
For this purpose add is_crypto flag to php_hash_ops.
2017-01-18 21:13:54 +01:00
Nikita Popov
a3115b05b4 Merge branch 'PHP-7.1' 2017-01-14 13:28:52 +01:00
Andrey Andreev
4bf7ef0806 Add hash_hkdf() 2017-01-14 13:28:21 +01:00
Pedro Magalhães
9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Christoph M. Becker
35b19cd2d9 Make this test meaningful
We're not only checking that hash_update_file() succeeds, but rather
that it properly works.

Furthermore, we fix the SKIPIF section – we don't need mhash to run the
test, and we don't need to check for unsupported PHP versions.

We also shorten the test name to avoid cluttering the test reports with
unnecessary detail.
2016-10-18 14:57:41 +02:00
Joe Watkins
dcae3ce1e6 Merge branch 'pull-request/1817' 2016-10-17 17:02:22 +01:00
Joe Watkins
4dfd5f4403 Merge branch 'pull-request/1816' 2016-10-17 17:02:19 +01:00
Joe Watkins
39ee3184ee Merge branch 'pull-request/1817' 2016-10-17 17:01:39 +01:00
Joe Watkins
5eb84337a6 Merge branch 'pull-request/1816' 2016-10-17 17:01:28 +01:00
Joe Watkins
acefa44014 Merge branch 'pull-request/1816' 2016-10-17 16:50:12 +01:00
Joe Watkins
f9beeacc25 Merge branch 'pull-request/1817' 2016-10-17 16:49:24 +01:00
Sara Golemon
49a7be0697 Implement FIPS 180-4 algos: sha512/256 and sha512/224
These algorithms are simple extensions to the existing sha512 algo
using different initialization vectors and producing truncated output.
2016-05-14 04:39:39 +00:00
marcosptf
547118e2f1 test to function hash_update_file();
was added new test to uncoverage function from hash module
2016-03-13 14:14:03 -03:00
marcosptf
e609b05d5b Update hash_update_stream.phpt 2016-03-13 14:00:01 -03:00
marcosptf
1b683c34ae test to function hash_update_stream();
was added a new function to module hash
2016-03-13 12:46:48 -03:00
Sara Golemon
d244b54c67 Implement SHA3 hashing algorithm 2015-10-15 20:36:49 -07:00
Stanislav Malyshev
9b1a224d4e Merge branch 'PHP-5.6'
* PHP-5.6: (21 commits)
  fix unit tests
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix bug ##70284 (Use after free vulnerability in unserialize() with GMP)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  ...

Conflicts:
	ext/exif/exif.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
	ext/session/session.c
	ext/session/tests/session_decode_variation3.phpt
	ext/soap/soap.c
	ext/spl/spl_observer.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/xsl/xsltprocessor.c
2015-09-02 00:37:20 -07:00
Stanislav Malyshev
3fe509443c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix unit tests
2015-09-01 12:24:14 -07:00
Stanislav Malyshev
4aeff30337 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix unit tests
2015-09-01 12:23:55 -07:00
Stanislav Malyshev
1922c650ba fix unit tests 2015-09-01 12:23:22 -07:00
Stanislav Malyshev
c19d59c550 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  5.4.45 next

Conflicts:
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/zip/php_zip.c
2015-09-01 12:06:41 -07:00