]> granicus.if.org Git - php/commitdiff
Implemented Change crypt() behavior w/o salt RFC
authorYasuo Ohgaki <yohgaki@php.net>
Tue, 29 Oct 2013 09:53:45 +0000 (18:53 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Tue, 29 Oct 2013 09:53:45 +0000 (18:53 +0900)
NEWS
ext/standard/crypt.c
ext/standard/tests/strings/crypt.phpt

diff --git a/NEWS b/NEWS
index 0c45a234697c492cc297cb1bef7de942d4658bbf..ed8bcc93b154f6aea2e58c6c94d0c823caa81d68 100644 (file)
--- 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). 
index 113a5bd0f516ccde844b2fd9bd0601600d1ab32e..81c0bf3e0c53602434298c15a66936411ac27864 100644 (file)
@@ -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) */
index ce178f684e08e906a5fc2a69395890ce4b914799..3dcff2eaf265636813e103d4eb012a37ca75c2db 100644 (file)
@@ -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