feature(auth) rm deprecated oldSha

This commit is contained in:
coderaiser 2014-11-17 09:45:21 -05:00
parent 27747d6d69
commit 3e88d6b23e

View file

@ -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;
}
})();