Commit graph

143 commits

Author SHA1 Message Date
Nikita Popov
bf92bddb87 Merge branch 'PHP-8.0'
* PHP-8.0:
  Create persistent interned string for password algos
2021-07-20 15:14:08 +02:00
Nikita Popov
b0d4d6ebb4 Create persistent interned string for password algos
These strings are returned to userland by password_algos(),
which violates thread-safety invariants. Create persistent
interned strings for them instead.
2021-07-20 15:13:50 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
bfbac70ec5 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't return null from password_get_info()
2021-02-11 10:23:09 +01:00
Nikita Popov
cec5e30889 Don't return null from password_get_info()
The get_info() handler should never fail, but even if it does,
we should still return a proper info array -- it doesn't make
sense that a completely incorrect hash returns an info array,
but a hash that is recognized but for which the options can't
be extracted would return null.
2021-02-11 10:21:31 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
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
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
George Peter Banyard
1b2ec73c1d Drop various unused macros/APIs
Also convert_libmagic_pattern() to return a zend_string*

Closes GH-6029
2020-08-26 12:59:43 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
twosee
1b85e749c7 Fix warning of strict-prototypes
Closes GH-5673.
2020-06-07 10:36:50 +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
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
31cf9a7ea9
Use RETURN_THROWS() when an exception is thrown
Closes GH-5036
2019-12-30 17:38:10 +01:00
Máté Kocsis
37c1171451
Promote warnings to exceptions in password_*() functions 2019-12-12 12:14:53 +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
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +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
17bfac6347 Merge branch 'PHP-7.4'
* PHP-7.4:
  Provide argon2i(d) password hashing from sodium when needed
2019-07-07 21:55:12 -04:00
Sara Golemon
0ba1db7a4a Provide argon2i(d) password hashing from sodium when needed 2019-07-07 21:53:43 -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
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
a1a8d14485 Update more func info information for ext/standard 2019-05-29 15:30:06 +02:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Nikita Popov
94ae35c9fb Remove ability to specify 'salt' in password_hash() 2019-01-30 13:13:47 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Zeev Suraski
38c337f22e Remove year range from copyright notice 2019-01-30 11:00:23 +02:00
Nikita Popov
e88a081641 Remove unnecessary Z_PARAM_ZVAL_DEREFs 2019-01-10 15:35:00 +01:00
Dmitry Stogov
9acfe1f8f0 Fixed compilation warnings 2018-12-19 16:15:49 +03:00
Dmitry Stogov
d206630f13 Fixed memory leaks 2018-12-13 16:21:08 +03: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
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
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
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
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Gabriel Caruso
affc20f891 Use bool instead of boolean in proto 2018-02-04 17:00:24 +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
Christoph M. Becker
eb4342eb14 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75221 (Argon2i always throws NUL at the end)
2017-10-12 12:52:58 +02: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] <20161029/src/argon2.c (L431-L436)>
2017-10-12 12:52:37 +02:00
Christoph M. Becker
597019d71e Remove pointless preprocessor directive
Obviously, that is a refactoring relict of e93f089.
2017-09-18 17:12:02 +02:00
Anatol Belski
6e4f3d1967 fix new password related pieces wrt failing tests 2017-07-17 08:01:26 +02:00
Anatol Belski
ea51bcd1fa fix typo 2017-07-17 07:01:07 +02:00
Sara Golemon
e93f089d6a
Refactor password_hash()
Pull salt generation out to a helper.
Merge options/hash into single switch.
Restore php_error->php_error_docref from last diff. (Error messages matter)
2017-07-16 17:37:45 -04:00