Commit graph

246 commits

Author SHA1 Message Date
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Peter Kokot
02294f0c84 Make PHP development tools files and scripts executable
This patch makes several scripts and PHP development tools files
executable and adds more proper shebangs to the PHP scripts.

The `#!/usr/bin/env php` shebang provides running the script via
`./script.php` and uses env to find PHP script location on the system.
At the same time it still provides running the script with a user
defined PHP location using `php script.php`.
2018-08-29 20:58:17 +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
Dmitry Stogov
b6cc4d2009 Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 11:54:26 +03:00
Peter Kokot
3f96f01e9e Bump phar and hash extension version to match PHP version 2018-06-21 13:15:32 +02:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
f9822b143e Remove unused argument 2018-03-14 16:33:57 +01:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
Dmitry Stogov
4d75504d4f Avoid double copying and string length recalculation 2018-03-06 21:19:18 +03: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
Anatol Belski
d3cb224eb3 Avoid conditions inside loop 2018-02-09 19:28:20 +01:00
Anatol Belski
3e6492f305 Improve loop vectorization 2018-02-09 19:28:20 +01:00
Anatol Belski
e87dfb1da2 Improve loop vectorization 2018-02-09 19:28:20 +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
Gabriel Caruso
8034fdc9d9 Use int instead of integer in proto 2018-02-02 22:32:15 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Nikita Popov
b72b1a4e4d Add zend_object_alloc() API
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.

Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Anatol Belski
80d6eb6806 Fix unsigned comparisons and remove dead code
Fix unsigned comparison

Cleanup never executed block

Fix unsigned comparison

Fix unsigned comparison, diff can't be < 0

Fix unsigned comparison

Fix unsigned comparison

Remove dead code
2017-11-17 22:38:44 +01:00
Dmitry Stogov
0056f52f50 Use interned strings for hash algorithm names (not copyied into SHM) 2017-11-01 02:40:39 +03:00
Remi Collet
d68879c734 Merge branch 'PHP-7.2'
* PHP-7.2:
  NEWS
  Fix Bug #75284 sha3 is not supported on bigendian machine
  NEWS
2017-10-03 06:42:48 +02:00
Remi Collet
d67873ec99 Fix Bug #75284 sha3 is not supported on bigendian machine 2017-10-03 06:41:46 +02:00
Kalle Sommer Nielsen
8e47faabe6 Kill compiler warnings in ext/hash 2017-08-24 01:05:26 +02:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Sara Golemon
a6e4a713ea
Add hash_hmac_algos() for filtered is_crypto methods 2017-07-23 15:17:09 -04:00
Remi Collet
c6c654c303 fix hash build (when build dir != src dir) 2017-05-29 09:55:51 +02:00
Anatol Belski
85b0b8a739 fix typo 2017-05-28 21:15:52 +02:00
Christian Schneider
91663a92d1 Replace slow generic sha3 implementation by https://github.com/gvanas/KeccakCodePackage
Fix hash_copy() tests by using correct size for sha3 context

sync config.w32 with with new sha3 files

Move dependency on KeccakHash.h to hash_sha3.c so we do not rely on it to install php_hash_sha3.h

Allocate memory for KeccacInstance in hash_sha3.c so header files do not need to know about implementation details while keeping API backward compatible to original sha3 implementation

Fix memory leak because hash_copy is called after init which already allocates the hashinstance
2017-05-28 12:50:33 +02: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
Sara Golemon
f149f62d58 Merge branch 'PHP-7.1'
* PHP-7.1:
  Securely zero the hash context key
2017-01-30 09:03:01 -08:00
Sara Golemon
3475c0c035 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Securely zero the hash context key
2017-01-30 09:02:42 -08:00
Sara Golemon
bf0f53270f Securely zero the hash context key 2017-01-30 08:57:17 -08:00
Andrey Andreev
423c192791 Use hash_ops->is_crypto in hash_init() 2017-01-22 10:37:10 +01:00
Joe Watkins
1c807377fd
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix bug #73961 environmental build dependency in hash sha3 source
2017-01-21 07:46:52 +00:00
Joe Watkins
1ff27053f9
Fix bug #73961 environmental build dependency in hash sha3 source 2017-01-21 07:45:28 +00: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
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00