php-src/ext/standard
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
..
html_tables Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
tests Add ZPP macros for class name or object parameters 2020-06-30 11:19:30 +02:00
array.c Fix uninitialized reads in min/max 2020-06-26 09:36:17 +02:00
assert.c Implement #47074: phpinfo() reports "On" as 1 for the some extensions 2020-06-04 11:25:45 +02:00
base64.c More precise ifunc resolver return type 2020-04-15 11:01:12 +02:00
base64.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
basic_functions.c Merge branch 'PHP-7.4' 2020-06-24 11:44:47 +02:00
basic_functions.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
basic_functions.stub.php Add tests to check mismatching function signatures 2020-06-06 09:23:34 +02:00
basic_functions_arginfo.h Include stub hash in generated arginfo files 2020-06-24 09:55:19 +02:00
browscap.c Move extra checks after zpp in get_browser() 2019-11-06 17:50:48 +01:00
config.m4 Move __alignof__ support check into main configure.ac. 2020-06-30 14:26:48 +02:00
config.w32 Remove convert_cyr_string() function 2019-12-05 13:15:54 +01:00
crc32.c Merge branch 'PHP-7.4' 2020-05-14 09:39:03 +02:00
crc32.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
credits.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
credits.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
credits_ext.h Update CREDITS 2020-06-17 13:04:01 +00:00
credits_sapi.h
crypt.c Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
crypt_blowfish.c Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
crypt_blowfish.h Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
crypt_freesec.c Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
crypt_freesec.h Use unsigned char in _crypt_extended_r 2019-06-19 15:09:00 +02:00
crypt_sha256.c Enforce min/max rounds in sha256/sha512 crypt 2020-06-24 12:41:56 +02:00
crypt_sha512.c Enforce min/max rounds in sha256/sha512 crypt 2020-06-24 12:41:56 +02:00
css.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
css.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
datetime.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
datetime.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
dir.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
dir.stub.php Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
dir_arginfo.h Include stub hash in generated arginfo files 2020-06-24 09:55:19 +02:00
dl.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
dl.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
dl.stub.php Add stubs for some SAPIs 2020-05-14 13:35:12 +02:00
dl_arginfo.h Include stub hash in generated arginfo files 2020-06-24 09:55:19 +02:00
dns.c Merge branch 'PHP-7.4' 2020-05-04 23:02:00 +02:00
dns_win32.c Merge branch 'PHP-7.4' 2020-05-04 23:02:00 +02:00
exec.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
exec.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
file.c Merge branch 'PHP-7.4' 2020-06-30 10:48:58 +02:00
file.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
filestat.c Reduce code duplication using for loop 2020-04-27 17:03:40 +02:00
filters.c Merge branch 'PHP-7.4' 2020-06-08 23:28:36 +02:00
flock_compat.c Fix expression warnings and break warnings 2020-06-07 10:41:11 +02:00
flock_compat.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
formatted_print.c Add support for * width and precision in printf() 2020-05-27 10:42:25 +02:00
fsock.c Make error messages more consistent by fixing capitalization 2020-01-17 14:52:46 +01:00
fsock.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
ftok.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
ftp_fopen_wrapper.c Fix format for tm member objects as they are stored as integers 2020-03-30 17:09:49 +02:00
head.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
head.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
hrtime.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
hrtime.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
html.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
html.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
html_tables.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
http.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
http_fopen_wrapper.c Merge branch 'PHP-7.4' 2020-02-24 10:20:49 +01:00
image.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
incomplete_class.c Implemented FR #78638 (__PHP_Incomplete_Class should be final) 2019-12-24 17:09:44 +08:00
info.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
info.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
iptc.c Drop unnecessary stdint and inttypes header checks 2020-04-22 20:18:19 +02:00
lcg.c Convert zend_parse_parameters_none() to fast ZPP in standard lib 2019-12-30 15:28:37 +01:00
levenshtein.c Use RETURN_THROWS() when an exception is thrown 2019-12-30 17:38:10 +01:00
link.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
mail.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
Makefile.frag
Makefile.frag.w32
math.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
md5.c Avoid used of "named fn" in ext/standard 2020-02-25 10:21:31 +01:00
md5.h Make HashContexts serializable. 2020-06-30 14:30:33 +02:00
metaphone.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
microtime.c Fix Haiku build 2020-06-19 17:21:55 +02:00
mt_rand.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
net.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
pack.c Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +01:00
pack.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
pageinfo.c Convert zend_parse_parameters_none() to fast ZPP in standard lib 2019-12-30 15:28:37 +01:00
pageinfo.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
password.c Fix warning of strict-prototypes 2020-06-07 10:36:50 +02:00
php_array.h Make sorting stable 2020-06-25 10:49:34 +02:00
php_assert.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_browscap.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_crypt.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_crypt_r.c Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
php_crypt_r.h Clean house in cryptographic hashing code 2020-06-24 13:40:27 +02:00
php_dir.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_dns.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_ext_syslog.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_filestat.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_fopen_wrapper.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
php_fopen_wrappers.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_http.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_image.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_incomplete_class.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_lcg.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_mail.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_math.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_mt_rand.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_net.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_password.h Fix warning of strict-prototypes 2020-06-07 10:36:50 +02:00
php_rand.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_random.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_smart_string.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_smart_string_public.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_standard.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_string.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_uuencode.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_var.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_versioning.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
proc_open.c Implements an openpty wrapper for solaris based systems 2020-06-16 11:19:00 +02:00
proc_open.h Further refactoring of proc_open.c 2020-05-14 10:25:52 +02:00
quot_print.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
quot_print.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
rand.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
random.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
scanf.c Promote warnings to exceptions in *scanf() functions 2019-12-10 13:01:59 +01:00
scanf.h Promote warnings to exceptions in *scanf() functions 2019-12-10 13:01:59 +01:00
sha1.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
sha1.h Make HashContexts serializable. 2020-06-30 14:30:33 +02:00
soundex.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
streamsfuncs.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
streamsfuncs.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
string.c Clean up some unused code (and fix some comments) in build scripts 2020-06-19 22:04:52 +02:00
strnatcmp.c
syslog.c Revert "Make BG(syslog_device) per request" 2020-01-30 16:18:02 +01:00
type.c Rename zend_zval_get_type() API 2020-05-13 14:56:05 +02:00
uniqid.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
url.c Fix {{{ comment to match function name for php_replace_controlchars_ex 2020-06-24 22:26:00 +02:00
url.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
url_scanner_ex.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
url_scanner_ex.re Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
user_filters.c Improve some TypeError and ValueError messages 2020-04-14 14:38:45 +02:00
user_filters.stub.php Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
user_filters_arginfo.h Include stub hash in generated arginfo files 2020-06-24 09:55:19 +02:00
uuencode.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
var.c Cache __unserialize() instead of unserialize() 2020-06-26 10:54:40 +02:00
var_unserializer.re Cache __unserialize() instead of unserialize() 2020-06-26 10:54:40 +02:00
versioning.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
winver.h