mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix Bcrypt bug
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
* 【core 】 修复Tailer无stop问题(issue#I3PQLQ@Gitee)
|
* 【core 】 修复Tailer无stop问题(issue#I3PQLQ@Gitee)
|
||||||
* 【core 】 修复空白excel读取报错问题(issue#1552@Github)
|
* 【core 】 修复空白excel读取报错问题(issue#1552@Github)
|
||||||
* 【extra 】 修复Sftp.mkDirs报错问题(issue#1536@Github)
|
* 【extra 】 修复Sftp.mkDirs报错问题(issue#1536@Github)
|
||||||
|
* 【core 】 修复Bcrypt不支持$2y$盐前缀问题(pr#1560@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -424,7 +424,9 @@ public class BCrypt {
|
|||||||
off = 3;
|
off = 3;
|
||||||
else {
|
else {
|
||||||
minor = salt.charAt(2);
|
minor = salt.charAt(2);
|
||||||
if (minor != 'a' || salt.charAt(3) != '$')
|
// pr#1560@Github
|
||||||
|
// 修正一个在Blowfish实现上的安全风险
|
||||||
|
if ((minor != 'a' && minor != 'x' && minor != 'y' && minor != 'b') || salt.charAt(3) != '$')
|
||||||
throw new IllegalArgumentException("Invalid salt revision");
|
throw new IllegalArgumentException("Invalid salt revision");
|
||||||
off = 4;
|
off = 4;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user