forked from svrjs/svrjs
Make the improvement consistent with password verification function
This commit is contained in:
parent
32a92804fa
commit
c85df7cd26
1 changed files with 6 additions and 6 deletions
12
svr.js
12
svr.js
|
@ -4651,10 +4651,10 @@ if (!cluster.isPrimary) {
|
|||
var scryptCount = 0;
|
||||
if (!authcode.userList || authcode.userList.indexOf(username) > -1) {
|
||||
usernameMatch = users.filter(function (entry) {
|
||||
if(entry.pbkdf2) {
|
||||
pbkdf2Count++;
|
||||
} else if(entry.scrypt) {
|
||||
if(entry.scrypt) {
|
||||
scryptCount++;
|
||||
} else if(entry.pbkdf2) {
|
||||
pbkdf2Count++;
|
||||
} else {
|
||||
sha256Count++;
|
||||
}
|
||||
|
@ -4669,10 +4669,10 @@ if (!cluster.isPrimary) {
|
|||
salt: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0"
|
||||
};
|
||||
if (!process.isBun) {
|
||||
if (pbkdf2Count > sha256Count && pbkdf2Count > scryptCount) {
|
||||
fakeCredentials.pbkdf2 = true;
|
||||
} else if (scryptCount > sha256Count) {
|
||||
if (scryptCount > sha256Count && scryptCount > pbkdf2Count) {
|
||||
fakeCredentials.scrypt = true;
|
||||
} else if (pbkdf2Count > sha256Count) {
|
||||
fakeCredentials.pbkdf2 = true;
|
||||
}
|
||||
}
|
||||
usernameMatch.push(fakeCredentials);
|
||||
|
|
Reference in a new issue