summaryrefslogtreecommitdiffstats
path: root/Core/Encoder/Pbkdf2PasswordEncoder.php
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Encoder/Pbkdf2PasswordEncoder.php')
-rw-r--r--Core/Encoder/Pbkdf2PasswordEncoder.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/Core/Encoder/Pbkdf2PasswordEncoder.php b/Core/Encoder/Pbkdf2PasswordEncoder.php
index 4f37ba3..a4b5c3b 100644
--- a/Core/Encoder/Pbkdf2PasswordEncoder.php
+++ b/Core/Encoder/Pbkdf2PasswordEncoder.php
@@ -54,6 +54,8 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder
*/
public function encodePassword($raw, $salt)
{
+ $this->checkPasswordLength($raw);
+
if (!in_array($this->algorithm, hash_algos(), true)) {
throw new \LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
}
@@ -72,6 +74,8 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder
*/
public function isPasswordValid($encoded, $raw, $salt)
{
+ $this->checkPasswordLength($raw);
+
return $this->comparePasswords($encoded, $this->encodePassword($raw, $salt));
}