1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

58 Commits

Author SHA1 Message Date
Máté Kocsis c37a1cd650 Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
Máté Kocsis 9975986b7e Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Máté Kocsis 8107a1da5a Use ZPP instead of custom type checks
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
2020-09-04 14:32:34 +02:00
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Máté Kocsis fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Máté Kocsis bb6f374048 Improve argument error messages in ext/standard
Closes GH-5198
2020-03-18 19:56:10 +01:00
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00
Nikita Popov c3aa9132d6 Fix argon2 test if provided by sodium 2020-02-24 21:34:37 +01:00
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis d6a6a60ef9 Merge branch 'PHP-7.4' 2020-01-27 14:04:19 +01:00
Máté Kocsis ea1b878877 Fix #78969 Make PASSWORD_DEFAULT match PASSWORD_BCRYPT instead of being null
It was an unintentional BC break.
2020-01-27 13:57:00 +01:00
Máté Kocsis 37c1171451 Promote warnings to exceptions in password_*() functions 2019-12-12 12:14:53 +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
Nikita Popov 63a20cb400 Don't accept objects for options in password_hash()
This was likely a mixup of zpp modifiers in the original implementation.
Per the RFC only arrays should be accepted here.
2019-10-29 13:20:22 +01:00
Nikita Popov 2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Remi Collet b3438b2670 Merge branch 'PHP-7.4'
* PHP-7.4:
  improve libargon2/libsodium compatibility
2019-07-10 09:00:54 +02:00
Remi Collet db0eaa8cf1 improve libargon2/libsodium compatibility 2019-07-10 09:00:41 +02:00
Sara Golemon 23a90b2847 Merge branch 'PHP-7.4'
* PHP-7.4:
  Relax argon2 mem_cost down to 64k, bump time_cost to 4
2019-07-09 11:37:08 -04:00
Sara Golemon f65956e4fb Relax argon2 mem_cost down to 64k, bump time_cost to 4 2019-07-09 11:36:48 -04:00
Sara Golemon 488709aadb Merge branch 'PHP-7.4'
* PHP-7.4:
  Bugfix #78208 Needs rehash with an unknown algo should always return true.
2019-06-27 19:28:04 -04:00
Sara Golemon 27f1f3ed1a Bugfix #78208 Needs rehash with an unknown algo should always return true. 2019-06-27 19:26:03 -04:00
Nikita Popov 852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Nikita Popov a2343d1a40 Merge branch 'PHP-7.4' 2019-03-07 17:10:58 +01:00
Nikita Popov 2580a7ba09 More zpp error/variation test removals 2019-03-07 17:09:43 +01:00
Nikita Popov 94ae35c9fb Remove ability to specify 'salt' in password_hash() 2019-01-30 13:13:47 +01:00
Sara Golemon 534df87c9e Implement password mechanism registry
RFC: https://wiki.php.net/rfc/password_registry
2018-11-20 17:26:55 -05: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
Charles R. Portwood II 55277a6684 RFC: Argon2 Password Hash Enhancements Implementation of Argon2id per RFC https://wiki.php.net/rfc/argon2_password_hash_enhancements
- m4 and Windows configure scripts now forces Argon2 reference library version >= 20161029
- Implementation tested against 20161029 and 20171227 for Argon2id support
- Updates Argon2 ext/standard/password/tests to run tests for both Argon2i and Argon2id
2018-06-21 13:26:57 +02: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
Christoph M. Becker 3f8961dfac Fixed bug #75221 (Argon2i always throws NUL at the end)
Apparently, `argon2_encodedlen()` also counts the terminating NUL byte;
that doesn't appear to be documented somewhere, but from looking at the
implementation[1] it is pretty obvious.  Therefore, the respective
`zend_string` has to be one byte shorter.

[1] <https://github.com/P-H-C/phc-winner-argon2/blob/20161029/src/argon2.c#L431-L436>
2017-10-12 12:52:37 +02:00
Nikita Popov 45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Christoph M. Becker fd5f0e49cf Fix broken test case
Patch provided by Charles R. Portwood II.
2016-09-08 20:04:10 +02:00
Christoph M. Becker 6cd06d34d8 Fix skip messages 2016-09-08 18:55:40 +02:00
Charles R. Portwood II 35a74b9e4a Fixing typo in tests 2016-08-27 21:57:09 -05:00
Charles R. Portwood II 0e3b3b031f Changing m_cost and t_cost to memory_cost and time_cost
- Updating tests
- Adjusting cost factors:
 - memory_cost = 1 MiB
 - time_cost = 2
 - threads = 2
2016-08-17 13:45:06 -05:00
Charles R. Portwood II 0d4d8eab53 Removing Argon2d, changing config arg to --with-password-argon2
Argon2d is not suitable for password_hashing. To ensure best practices
within password_*, Argon2d was removed.

--with-argon2 implies the full feature set of Argon2, whereas this
feature only implements Argon2i within password_*. Consequently
the feature flag was renamed to --with-password-argon2
2016-08-01 18:53:24 -05:00
Charles R. Portwood II 1c954c9549 Untouching old tests 2016-07-12 16:38:49 -05:00
Charles R. Portwood II 9f37be5c43 Fixing failing tests for Argon2
- Added "Skipped:" flag so argon2 tests would be skipped when
  PHP is compiled without Argon2 support
2016-07-11 18:39:04 -05:00
Charles R. Portwood II bcfccdd9f4 Removing argon2 library files in favor of --with-argon2[=DIR]
- Configure flag now accepts --with-argon2 for dynamic linking with
  libargon2. Argon2 will be enabled in password_* only if this
  flag is passed.
- --with-argon2 config flag allows user passed directory for linking
- Added Argon2 specific tests to ensure existing tests do not fail
  when argon2 is disable
2016-07-11 16:44:40 -05:00
Charles R. Portwood II 0a1274f2b1 Adding test cases for Argon2i and Argon2d
Added Windows config.w32 changes
Updated constants in php_password.h
2016-07-09 13:18:45 -05:00
Charles R. Portwood II c2551a74d4 Working implementation with password_hash, password_verify 2016-07-08 23:45:19 -05:00
Anthony Ferrara ed4052f1d5 Fixed bug #69686 password_verify reports back error on PHP7 will null string.
The deprecation of DES salts created a warning when trying to verify them with password_hash. This bug fix adds a quiet mode to php_crypt() which is used by password_verify.
2015-05-21 17:12:51 -04:00
Anthony Ferrara 94e222c14d Deprecate password_hash salt option 2015-04-09 15:51:04 -04:00
Andrea Faulds 5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Andrea Faulds e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anthony Ferrara 1751d5fabe Really fix leaks, add test cases to prove it... 2012-10-06 10:38:41 -04:00
Anthony Ferrara 76f3295cdf Expose PASSWORD_BCRYPT_DEFAULT_COST constant and update test to use it 2012-09-12 11:47:50 -04:00
Anthony Ferrara e9a7bde829 Switch test to using strict comparison for crypt fallback 2012-09-12 11:37:56 -04:00
Anthony Ferrara e8b7f5b35d Add tests for password_get_info and password_needs_rehash 2012-09-12 11:21:08 -04:00