Browse Source

migrated to a new version of scrypt

master
mort 8 years ago
parent
commit
437b595992
3 changed files with 4 additions and 4 deletions
  1. 1
    1
      package.json
  2. 2
    2
      web/api/account_create.node.js
  3. 1
    1
      web/api/account_login.node.js

+ 1
- 1
package.json View File

@@ -22,7 +22,7 @@
"jshint": "^2.8.0",
"mlogger": "^1.1.0",
"pg": "^4.4.0",
"scrypt": "^4.0.7",
"scrypt": "^5.1.0",
"uglify-js": "^2.4.24",
"uglifycss": "0.0.15",
"wrench": "^1.5.8"

+ 2
- 2
web/api/account_create.node.js View File

@@ -11,8 +11,8 @@ module.exports = function(ctx) {
if (!/^[a-zA-Z0-9_\-]+$/.test(data.username))
return ctx.fail("Username contains illegal characters.");

var params = scrypt.params(ctx.conf.scrypt.maxtime);
scrypt.hash(new Buffer(data.password), params, function(err, hash) {
var params = scrypt.paramsSync(ctx.conf.scrypt.maxtime);
scrypt.kdf(new Buffer(data.password), params, function(err, hash) {
if (err)
return ctx.fail(err);


+ 1
- 1
web/api/account_login.node.js View File

@@ -28,7 +28,7 @@ module.exports = function(ctx) {

ctx.login(user.username, user.id);

scrypt.verify(
scrypt.verifyKdf(
new Buffer(user.pass_hash, "hex"),
new Buffer(ctx.postData.data.password),
function(err, success) {

Loading…
Cancel
Save