Little security fix for avoid ddos password attack if not using bcrypt encrypting
This commit is contained in:
parent
dd0f330f5f
commit
86125bf06d
1 changed files with 5 additions and 1 deletions
|
|
@ -63,12 +63,16 @@ class PasswordField extends CharField {
|
|||
|
||||
$this->error=1;
|
||||
|
||||
$this->std_error=I18n::lang('common', 'error_null_password', 'Bcrypt have problems using null characters...');
|
||||
$this->std_error=I18n::lang('common', 'error_null_password', 'Password not valid');
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
//Cut the password if is longer than 128 characters. If password_hash use a different password system to bcrypt (have a 72 character limit) is useful for stop ddos passwords attack.
|
||||
|
||||
$value=substr ($value, 0, 128);
|
||||
|
||||
$hash_password=password_hash($value, PASSWORD_DEFAULT);
|
||||
|
||||
return $hash_password;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue