1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
Máté Kocsis
9d9bcc2b7c Improve parameter names in ext/hash and ext/openssl
Closes GH-6156
2020-09-24 22:15:30 +02:00
Máté Kocsis
de912821e0 Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
Máté Kocsis
f83368c6d9 Fix ZPP for mhash()
Closes GH-5985
2020-08-14 10:02:45 +02:00
Máté Kocsis
0d330e1a02 Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Eddie Kohler
ada776c84c Make HashContexts serializable.
* Modify php_hash_ops to contain the algorithm name and
  serialize and unserialize methods.

* Implement __serialize and __unserialize magic methods on
  HashContext.

Note that serialized HashContexts are not necessarily portable
between PHP versions or from architecture to architecture.
(Most are, though Keccak and slow SHA3s are not.)

An exception is thrown when an unsupported serialization is
attempted.

Because of security concerns, HASH_HMAC contexts are not
currently serializable; attempting to serialize one throws
an exception.

Serialization exposes the state of HashContext memory, so ensure
that memory is zeroed before use by allocating it with a new
php_hash_alloc_context function. Performance impact is
negligible.

Some hash internal states have logical pointers into a buffer,
or sponge, that absorbs input provided in bytes rather than
chunks. The unserialize functions for these hash functions
must validate that the logical pointers are all within bounds,
lest future hash operations cause out-of-bounds memory accesses.

* Adler32, CRC32, FNV, joaat: simple state, no buffer positions
* Gost, MD2, SHA3, Snefru, Tiger, Whirlpool: buffer positions
  must be validated
* MD4, MD5, SHA1, SHA2, haval, ripemd: buffer positions encoded
  bitwise, forced to within bounds on use; no need to validate
2020-06-30 14:30:33 +02:00
Máté Kocsis
ed6cf67879 Fix some final classes in stubs 2020-05-19 14:54:37 +02:00
Máté Kocsis
3ebce8e9fc Fix UNKNOWN default values in various extensions
Closes GH-5514
2020-05-05 19:08:20 +02:00
Máté Kocsis
5322de1ba8 Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02: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
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
Thomas Gerbet
ef27bd60d0 Add stubs for ext-hash 2019-09-16 09:17:47 +02:00