Commit Graph

107 Commits

Author SHA1 Message Date
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] <https://github.com/P-H-C/phc-winner-argon2/blob/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
Sara Golemon
7165e28738
Refactor password.c
Use zend_string instread of char*/size_t
Clean up use of scope vars
Get rid of some temporaries/overstacked expressions.
2017-07-16 17:02:39 -04:00
Charles R. Portwood II
498716c2f7 Compatibility with libargon2 versions 20161029 and 20160821
libargon2 20161029 introduces the `type` parameter to the argon2_encodedlen
function that is not present in 20160821. This change ensures the Argon2
functionality introduced in RFC `argon2_password_hash` is compatible with
both versions, as the library version that package maintainers package may
differ.
2017-06-18 19:19:20 -04:00
Xinchen Hui
696bd37e67 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed condition check
  Fixed condition check
  another place

Conflicts:
	ext/mcrypt/mcrypt.c
2017-04-10 14:49:13 +08:00
Xinchen Hui
65d77812fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed condition check
2017-04-10 14:47:42 +08:00
Xinchen Hui
4bebcb84ad Fixed condition check 2017-04-10 14:47:24 +08: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
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
a23f08a33c Use new param API in standard 2016-12-30 17:28:55 -08:00
Nikita Popov
1a94b24ca5 Use zend_string_free instead of efree
Fingers crossed I didn't break the build.
2016-09-16 21:30:26 +02: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
ab837a6a0a Fixing potential memory leak with encoded in password_hash
Using zend_string_alloc instead of char* for out and encoded
variables
2016-07-18 13:15:29 -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
1bc381848a Reverting PASSWORD_DEFAULT to PASSWORD_BCRYPT
Indicating constants as defaults
Minor coding standards change
2016-07-10 08:16:55 -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
Charles R. Portwood II
3c7fb71a90 Introducing Argon2 memory, time, and lanes constants
PASSWORD_ARGON2_MEMORY_COST
PASSWORD_ARGON2_TIME_COST
PASSWORD_ARGON2_LANES
2016-07-08 15:31:30 -05:00
Charles R. Portwood II
de85c2e526 Implementing password_verify and password_get_info for Argon2 2016-07-08 15:27:20 -05:00
Dmitry Stogov
adc95c5114 Fixed compilation warnings 2016-06-23 12:47:06 +03:00
Nikita Popov
d3ed75b9eb Remove HAVE_CRYPT checks
We always provide a crypt implementation. HAVE_CRYPT is only
relevant as to whether the crypt() C function exists.
2016-03-25 21:09:47 +01:00
Julien Pauli
ef4dc15831 Moved buffer from heap to stack 2016-01-06 11:41:16 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
3d3782c328 Unused vars 2015-12-14 09:23:01 -08:00
Anthony Ferrara
02e85045dc Refactor password_hash to use random_bytes internally to generate salts 2015-12-14 09:05:16 +01:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02: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
Nikita Popov
40e465e357 Clean up some type conversions
While at it also fix some type checks in iconv and drop dead and
unported code in standard/filters.
2015-04-27 18:50:08 +02:00
Anthony Ferrara
94e222c14d Deprecate password_hash salt option 2015-04-09 15:51:04 -04:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00