diff --git a/LambdAuthChangePassword/index.js b/LambdAuthChangePassword/index.js index b54fa62..ab22005 100644 --- a/LambdAuthChangePassword/index.js +++ b/LambdAuthChangePassword/index.js @@ -14,7 +14,7 @@ function computeHash(password, salt, fn) { var iterations = 4096; if (3 == arguments.length) { - crypto.pbkdf2(password, salt, iterations, len, function(err, derivedKey) { + crypto.pbkdf2(password, salt, iterations, len, 'sha1', function(err, derivedKey) { if (err) return fn(err); else fn(null, salt, derivedKey.toString('base64')); }); diff --git a/LambdAuthCreateUser/index.js b/LambdAuthCreateUser/index.js index 84059d2..4b22526 100644 --- a/LambdAuthCreateUser/index.js +++ b/LambdAuthCreateUser/index.js @@ -22,7 +22,7 @@ function computeHash(password, salt, fn) { crypto.randomBytes(len, function(err, salt) { if (err) return fn(err); salt = salt.toString('base64'); - crypto.pbkdf2(password, salt, iterations, len, function(err, derivedKey) { + crypto.pbkdf2(password, salt, iterations, len, 'sha1', function(err, derivedKey) { if (err) return fn(err); fn(null, salt, derivedKey.toString('base64')); }); diff --git a/LambdAuthLogin/index.js b/LambdAuthLogin/index.js index 885b382..297d96f 100644 --- a/LambdAuthLogin/index.js +++ b/LambdAuthLogin/index.js @@ -15,7 +15,7 @@ function computeHash(password, salt, fn) { var iterations = 4096; if (3 == arguments.length) { - crypto.pbkdf2(password, salt, iterations, len, function(err, derivedKey) { + crypto.pbkdf2(password, salt, iterations, len, 'sha1', function(err, derivedKey) { if (err) return fn(err); else fn(null, salt, derivedKey.toString('base64')); }); diff --git a/LambdAuthResetPassword/index.js b/LambdAuthResetPassword/index.js index 8736984..11c7f91 100644 --- a/LambdAuthResetPassword/index.js +++ b/LambdAuthResetPassword/index.js @@ -14,7 +14,7 @@ function computeHash(password, salt, fn) { var iterations = 4096; if (3 == arguments.length) { - crypto.pbkdf2(password, salt, iterations, len, function(err, derivedKey) { + crypto.pbkdf2(password, salt, iterations, len, 'sha1', function(err, derivedKey) { if (err) return fn(err); else fn(null, salt, derivedKey.toString('base64')); }); diff --git a/init.sh b/init.sh index b630cb5..491257b 100755 --- a/init.sh +++ b/init.sh @@ -138,7 +138,7 @@ for f in $(ls -1|grep ^LambdAuth); do cd $f zip -r $f.zip index.js config.json aws lambda create-function --function-name ${f} \ - --runtime nodejs4.3 \ + --runtime nodejs10.x \ --role arn:aws:iam::"$AWS_ACCOUNT_ID":role/${f} \ --handler index.handler \ --zip-file fileb://${f}.zip \