com php-src: Implemented Change crypt() behavior w/o salt RFC: NEWS ext/standard/crypt.c ext/standard/tests/strings/crypt.phpt

From: Date: Tue, 29 Oct 2013 09:53:45 +0000
Subject: com php-src: Implemented Change crypt() behavior w/o salt RFC: NEWS ext/standard/crypt.c ext/standard/tests/strings/crypt.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73827@lists.php.net to get a copy of this message
Commit: 416f8fce5cebb7d5859c28aede2d1b3d793acec2 Author: Yasuo Ohgaki <yohgaki@php.net> Tue, 29 Oct 2013 18:53:45 +0900 Parents: 3cf2682083fc1c8635b02c4cf77bdf12c5e5da35 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=416f8fce5cebb7d5859c28aede2d1b3d793acec2 Log: Implemented Change crypt() behavior w/o salt RFC Changed paths: M NEWS M ext/standard/crypt.c M ext/standard/tests/strings/crypt.phpt Diff: diff --git a/NEWS b/NEWS index 0c45a23..ed8bcc9 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,8 @@ PHP NEWS - Standard: . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version 1.1). (Adam) + . Implemented Change crypt() behavior w/o salt RFC. (Yasuo) + https://wiki.php.net/rfc/crypt_function_salt - XMLReader: . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 113a5bd..81c0bf3 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -272,6 +272,8 @@ PHP_FUNCTION(crypt) if (salt_in) { memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len)); + } else { + php_error_docref(NULL TSRMLS_C, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash."); } /* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */ diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index ce178f6..3dcff2e 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -34,6 +34,8 @@ STD EXT MD5 BLO + +Notice: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash. in %s on line %d string(%d) "%s" Warning: crypt() expects at least 1 parameter, 0 given in %s on line %d

« previous php.cvs (#73827) next »