[-]
[+]
|
Changed |
php7.spec
|
|
[-]
[+]
|
Added |
php5-crypt_revert1.patch
^
|
@@ -0,0 +1,57 @@
+X-Git-Url: http://72.52.91.13:8000/?p=php-src.git;a=blobdiff_plain;f=ext%2Fstandard%2Fcrypt.c;h=66b37eb79ea77cf1e6127c746e40cdc5c0f4a560;hp=6bc90e2b07ab03d191a554955d153b5a88dffea3;hb=bd90f5507f63b2b624c9ad04668c67cc3d1b8952;hpb=1929fc9b16c836c1449dee3fd3570031ff8dcba1
+
+diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
+index 6bc90e2..66b37eb 100644
+--- a/ext/standard/crypt.c
++++ b/ext/standard/crypt.c
+@@ -246,6 +246,13 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
+ }
+ #else
+
++ if (salt[0] != '$' && salt[0] != '_' && (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1]))) {
++ if (!quiet) {
++ /* error consistently about invalid DES fallbacks */
++ php_error_docref(NULL, E_DEPRECATED, DES_INVALID_SALT_ERROR);
++ }
++ }
++
+ # if defined(HAVE_CRYPT_R) && (defined(_REENTRANT) || defined(_THREAD_SAFE))
+ {
+ # if defined(CRYPT_R_STRUCT_CRYPT_DATA)
+@@ -254,24 +261,23 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
+ # elif defined(CRYPT_R_CRYPTD)
+ CRYPTD buffer;
+ # else
+-# error Data struct used by crypt_r() is unknown. Please report.
++# error Data struct used by crypt_r() is unknown. Please report.
+ # endif
+- if (salt[0] != '$' && salt[0] != '_' && (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1]))) {
+- if (!quiet) {
+- /* error consistently about invalid DES fallbacks */
+- php_error_docref(NULL, E_DEPRECATED, DES_INVALID_SALT_ERROR);
+- }
+- }
+ crypt_res = crypt_r(password, salt, &buffer);
+- if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
+- return NULL;
+- } else {
+- result = zend_string_init(crypt_res, strlen(crypt_res), 0);
+- return result;
+- }
+ }
++# elif defined(HAVE_CRYPT)
++ crypt_res = crypt(password, salt);
++# else
++# error No crypt() implementation
+ # endif
+ #endif
++
++ if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
++ return NULL;
++ } else {
++ result = zend_string_init(crypt_res, strlen(crypt_res), 0);
++ return result;
++ }
+ }
+ /* }}} */
+
|
[-]
[+]
|
Added |
php5-crypt_revert2.patch
^
|
@@ -0,0 +1,37 @@
+X-Git-Url: http://72.52.91.13:8000/?p=php-src.git;a=blobdiff_plain;f=ext%2Fstandard%2Fcrypt.c;h=1b83d6e12770869f6cde71e65e8d88caecd310a1;hp=b7ac8d64bde30c1b44f0cbd6cf89b9369cedb9d8;hb=54da966883bacf28808e26eeda48fe38e21b118e;hpb=c4681ec8e10b365a83bcff34a261e7c5e62dea60
+
+diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
+index b7ac8d6..1b83d6e 100644
+--- a/ext/standard/crypt.c
++++ b/ext/standard/crypt.c
+@@ -236,18 +236,23 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt,
+ # elif defined(CRYPT_R_CRYPTD)
+ CRYPTD buffer;
+ # else
+-# error Data struct used by crypt_r() is unknown. Please report.
++# error Data struct used by crypt_r() is unknown. Please report.
+ # endif
+ crypt_res = crypt_r(password, salt, &buffer);
+- if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
+- return FAILURE;
+- } else {
+- *result = estrdup(crypt_res);
+- return SUCCESS;
+- }
+ }
++# elif defined(HAVE_CRYPT)
++ crypt_res = crypt(password, salt);
++# else
++# error No crypt() implementation
+ # endif
+ #endif
++
++ if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
++ return FAILURE;
++ } else {
++ *result = estrdup(crypt_res);
++ return SUCCESS;
++ }
+ }
+ /* }}} */
+
|