diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-10-10 08:30:51 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-10-10 14:05:52 +0200 |
commit | 41cbe3694a5332d7e5bdb285c81bbfe23f31a220 (patch) | |
tree | 48b09420b041421ce1ee3e35d21d98ab11e7d793 /Core/Encoder/BasePasswordEncoder.php | |
parent | e3a08775fbfb1062167a56e3c5f606b3300d40a8 (diff) | |
download | symfony-security-41cbe3694a5332d7e5bdb285c81bbfe23f31a220.zip symfony-security-41cbe3694a5332d7e5bdb285c81bbfe23f31a220.tar.gz symfony-security-41cbe3694a5332d7e5bdb285c81bbfe23f31a220.tar.bz2 |
[Security] limited the password length passed to encodersv2.2.9
Diffstat (limited to 'Core/Encoder/BasePasswordEncoder.php')
-rw-r--r-- | Core/Encoder/BasePasswordEncoder.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Core/Encoder/BasePasswordEncoder.php b/Core/Encoder/BasePasswordEncoder.php index c26c9ce..b83eb30 100644 --- a/Core/Encoder/BasePasswordEncoder.php +++ b/Core/Encoder/BasePasswordEncoder.php @@ -20,6 +20,8 @@ use Symfony\Component\Security\Core\Util\StringUtils; */ abstract class BasePasswordEncoder implements PasswordEncoderInterface { + const MAX_PASSWORD_LENGTH = 4096; + /** * Demerges a merge password and salt string. * @@ -83,4 +85,14 @@ abstract class BasePasswordEncoder implements PasswordEncoderInterface { return StringUtils::equals($password1, $password2); } + + /** + * Checks if the password is too long. + * + * @return Boolean true if the password is too long, false otherwise + */ + protected function isPasswordTooLong($password) + { + return strlen($password) > self::MAX_PASSWORD_LENGTH; + } } |