Commit Graph

349 Commits

Author SHA1 Message Date
Máté Kocsis
d5871e26ad
Promote warnings to exceptions in ext/hash 2020-03-24 10:22:29 +01:00
Nikita Popov
80392253e0 Add arginfo for HashContext::__construct()
Arginfo was already generated, just not referenced.
2020-02-13 16:51:23 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov
169805777c Merge branch 'PHP-7.4'
* PHP-7.4:
  Apply tidy formatting
2020-02-03 13:42:08 +01:00
Nikita Popov
58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Anatol Belski
6352e9a989 Backport 7d2ef3d2e5 into 7.4
As the data structures are public, the fix for 64-bit consists
on replacing the blanket memcpy with individual assignments.
2020-01-29 13:38:46 +01:00
Anatol Belski
7d2ef3d2e5 Fix datatype
This has been introduced by 84b0d0faba.
Besides it causes runtime issues on POWER5 (and presumably later), the
implementation would expect this array to consist on 32-bit integers.
2020-01-29 12:36:37 +01:00
Máté Kocsis
99db00b1f2
Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Nikita Popov
a6486088f8 Switch hash() function to use fastzpp
For short inputs ZPP can be a large fraction of the hash()
execution time.
2020-01-02 10:06:16 +01:00
Nikita Popov
7c787e56b0 Switch php_hash_fetch_ops() to use zend_string
This has two advantages: If the string is already lowercase, we
do not need to copy it, and it will hopefully match the interned
string name of the hash, making the comparison more efficient.
2020-01-02 10:05:12 +01:00
Máté Kocsis
349a286461
Use RETURN_THROWS() after zend_throw_error() 2020-01-01 16:42:30 +01:00
Máté Kocsis
9099dbd961
Use RETURN_THROWS() after zend_type_error() 2020-01-01 14:23:21 +01:00
Máté Kocsis
d9ac1ca8de
Use ZEND_THROWS() during ZPP in the GD, gettext, GMP, and hash extensions 2019-12-31 00:21:38 +01:00
Máté Kocsis
d59bc80782
Fix smaller issues with stubs
GH-5025
2019-12-20 14:31:07 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Gabriel Caruso
95181553c8
Add missing zend_parse_parameters_none() checks
Closes GH-4796.
2019-10-08 23:10:18 +02:00
Nikita Popov
5f80eb7842 Fix required number of arguments in stubs
* get_parent_class() argument is optional
* Mark array_filter() $callback as optional
* The $base of gmp_strval() is optional
* DateTime constructor also accepts zero arguments
* hash_update_file() stream context is optional
* xmlwriter_write_dtd_entity() $isparam argument is optional
2019-10-07 16:33:41 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
8a66cb35a3 Merge branch 'PHP-7.4' 2019-09-17 16:18:03 +02:00
Nikita Popov
66351025c8 Enable --with-mhash on CI 2019-09-17 16:16:31 +02:00
Thomas Gerbet
ef27bd60d0 Add stubs for ext-hash 2019-09-16 09:17:47 +02:00
Christoph M. Becker
7a20ba43d3 Add missing ZPP_none() 2019-09-15 21:30:15 +02:00
Christoph M. Becker
39ab4104ed Remove duplicate md5/sha1 implementation
This code was actually unused since its introduction, and since at
least the md5 implementation in the core was completely overhauled,
we're dropping the md5 and sha1 related stuff from ext/hash.
2019-08-30 13:21:48 +02:00
Mark
1f863399d5
Warnings to Errors hash_equals 2019-08-29 16:13:06 +02:00
Mark
e18bac96b7
Errorfy hash_pbkdf2 2019-08-29 16:11:21 +02:00
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
Nikita Popov
a1e2c8870e Merge branch 'PHP-7.4' 2019-07-22 17:26:01 +02:00
Nikita Popov
d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Peter Kokot
f91ffe5915 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove conditional calls of always available macros
2019-07-14 22:24:59 +02:00
Peter Kokot
94421e5724 Remove conditional calls of always available macros
These checks were once relevant for these extensions in PECL and PHP
versions without availability of the checked macros.

Closes GH-4405
2019-07-14 22:24:21 +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
Nikita Popov
6ae9c10534 Merge branch 'PHP-7.4' 2019-06-19 16:36:29 +02:00
Nikita Popov
555d68be10 Fix shift UB in hash_snefru 2019-06-19 15:55:56 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Stanislav Malyshev
e1a39387d1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:06:29 -07:00
Stanislav Malyshev
3eae4f677a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:06:21 -07:00
Stanislav Malyshev
805a330681 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:06:16 -07:00
Stanislav Malyshev
d1d692abe7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:05:37 -07:00
Stanislav Malyshev
588db7cecf Always use ZEND_SECURE_ZERO() when cleaning up data
Optimizing compilers have an annoying tendency to throw out
memsets over data that they think aren't used anymore. Apply secure
zero-out in cases where this has potential to happen.
2019-04-06 18:15:42 -07:00
Kalle Sommer Nielsen
e632537c83 Remove usage of HAVE_HASH_EXT and COMPILE_DL_HASH as ext/hash is always available (master only) 2019-03-20 20:43:35 +02:00
Peter Kokot
61d9e53ed9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove extension readmes
2019-03-19 20:26:07 +01:00
Peter Kokot
38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00