File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/code/core/Mage/Core/Model Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,16 @@ class Mage_Core_Model_Encryption
37
37
*/
38
38
public const HASH_VERSION_LATEST = 3 ;
39
39
40
+ /**
41
+ * Maximum Password Length
42
+ */
43
+ public const MAXIMUM_PASSWORD_LENGTH = 256 ;
44
+
40
45
/**
41
46
* @var Varien_Crypt_Mcrypt
42
47
*/
43
48
protected $ _crypt ;
49
+
44
50
/**
45
51
* @var Mage_Core_Helper_Data
46
52
*/
@@ -126,6 +132,10 @@ public function hash($data, $version = self::HASH_VERSION_MD5)
126
132
*/
127
133
public function validateHash ($ password , $ hash )
128
134
{
135
+ if (strlen ($ password ) > self ::MAXIMUM_PASSWORD_LENGTH ) {
136
+ return false ;
137
+ }
138
+
129
139
return $ this ->validateHashByVersion ($ password , $ hash , self ::HASH_VERSION_LATEST )
130
140
|| $ this ->validateHashByVersion ($ password , $ hash , self ::HASH_VERSION_SHA512 )
131
141
|| $ this ->validateHashByVersion ($ password , $ hash , self ::HASH_VERSION_SHA256 )
You can’t perform that action at this time.
0 commit comments