mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(auth) rm deprecated oldSha
This commit is contained in:
parent
27747d6d69
commit
3e88d6b23e
1 changed files with 0 additions and 20 deletions
|
|
@ -8,7 +8,6 @@
|
|||
tryRequire = require(DIR + 'tryRequire', {log: true}),
|
||||
config = require(DIR + 'config'),
|
||||
Util = require(DIR_LIB + 'util'),
|
||||
isDeprecatedShown,
|
||||
oldPass,
|
||||
oldName;
|
||||
|
||||
|
|
@ -63,28 +62,9 @@
|
|||
equal = pass === hash && equal;
|
||||
}
|
||||
|
||||
if (!equal) {
|
||||
equal = oldSha(password, pass);
|
||||
|
||||
if (equal && !isDeprecatedShown) {
|
||||
console.error('Change password: sha1 is not safe. New passwords would be saved in config in sha512+RSA');
|
||||
isDeprecatedShown = true;
|
||||
}
|
||||
}
|
||||
|
||||
callback(equal);
|
||||
});
|
||||
|
||||
return auth;
|
||||
}
|
||||
|
||||
function oldSha(password, hash) {
|
||||
var hashNew,
|
||||
sha = crypto.createHash('sha1');
|
||||
|
||||
sha.update(password);
|
||||
hashNew = sha.digest('hex');
|
||||
|
||||
return hash === hashNew;
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue