Commit 0395f07 1 parent fa46e63 commit 0395f07 Copy full SHA for 0395f07
File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ fn hashpw<'p>(
78
78
// bytes on the updated prefix $2b$, but leaving $2a$ unchanged for
79
79
// compatibility. However, pyca/bcrypt 2.0.0 *did* correctly truncate inputs
80
80
// on $2a$, so we do it here to preserve compatibility with 2.0.0
81
- // Silent truncation is _probably_ not the best idea, even if the "original"
81
+ // Silent truncation is _probably_ not the best idea, even if the "original"
82
82
// OpenBSD implementation did/does this.
83
83
// We prefer to raise a ValueError in this case - if the user _wants_ to truncate,
84
84
// they can always do so manually by passing s[:72] instead of s into hashpw().
85
85
86
86
if password. len ( ) > 72 {
87
87
return Err ( pyo3:: exceptions:: PyValueError :: new_err (
88
- "Password cannot be longer than 72 bytes" ,
88
+ "password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72]) " ,
89
89
) ) ;
90
90
}
91
91
You can’t perform that action at this time.
0 commit comments