提交 bad3c174 authored 作者: Thomas Mueller's avatar Thomas Mueller

A old databases without user name and password (created with H2 version 1.2.142…

A old databases without user name and password (created with H2 version 1.2.142 or older) couldn't be opened with version 1.2.143.
上级 6b0bc96e
...@@ -187,6 +187,9 @@ public class User extends RightOwner { ...@@ -187,6 +187,9 @@ public class User extends RightOwner {
return true; return true;
} }
SHA256 sha = new SHA256(); SHA256 sha = new SHA256();
if (userPasswordHash.length == 0) {
userPasswordHash = sha.getKeyPasswordHash(getName(), new char[0]);
}
byte[] hash = sha.getHashWithSalt(userPasswordHash, salt); byte[] hash = sha.getHashWithSalt(userPasswordHash, salt);
return Utils.compareSecure(hash, passwordHash); return Utils.compareSecure(hash, passwordHash);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论