From 50571901b9cab14fa55e39973184757c1b1f406b Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Tue, 7 Jan 2014 16:01:04 -0800 Subject: [PATCH] jshint cleanup --- client/index.js | 7 +------ crypto/butil.js | 4 ++++ db/heap.js | 6 +++--- routes/account.js | 1 - routes/password.js | 2 -- scripts/tap-coverage.js | 3 +++ test/run/account_reset_token_tests.js | 1 - 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/client/index.js b/client/index.js index b08b89a2..aa7fed06 100644 --- a/client/index.js +++ b/client/index.js @@ -2,16 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -var crypto = require('crypto') var P = require('p-promise') var ClientApi = require('./api') var butil = require('../crypto/butil') var pbkdf2 = require('../crypto/pbkdf2') var hkdf = require('../crypto/hkdf') var tokens = require('../tokens')({ trace: function () {}}) -var Bundle = tokens.Bundle - -var NULL = Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') function Client(origin) { this.uid = null @@ -139,7 +135,7 @@ Client.prototype.auth = function () { return this.api.accountLoginAndGetKeys(this.email, this.authPW) .then( function (data) { - this.uid = data.uid, + this.uid = data.uid this.sessionToken = data.sessionToken this.keyFetchToken = data.keyFetchToken this.verified = data.verified @@ -309,7 +305,6 @@ Client.prototype.resetPassword = function (newPassword) { throw new Error("call verifyPasswordResetCode before calling resetPassword"); } // this will generate a new wrapKb on the server - var wrapKb = NULL return this.setupCredentials(this.email, newPassword) .then( function (bundle) { diff --git a/crypto/butil.js b/crypto/butil.js index f75f0897..39798e3c 100644 --- a/crypto/butil.js +++ b/crypto/butil.js @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + module.exports.buffersAreEqual = function buffersAreEqual(buffer1, buffer2) { var mismatch = buffer1.length - buffer2.length if (mismatch) { diff --git a/db/heap.js b/db/heap.js index 171c2a83..1939a4c3 100644 --- a/db/heap.js +++ b/db/heap.js @@ -291,9 +291,9 @@ module.exports = function ( Heap.prototype.deletePasswordChangeToken = function (passwordChangeToken) { log.trace( { - op: 'Heap.deletePasswordForgotToken', - id: passwordForgotToken && passwordForgotToken.id, - uid: passwordForgotToken && passwordForgotToken.uid + op: 'Heap.deletePasswordChangeToken', + id: passwordChangeToken && passwordChangeToken.id, + uid: passwordChangeToken && passwordChangeToken.uid } ) delete this.passwordChangeTokens[passwordChangeToken.id] diff --git a/routes/account.js b/routes/account.js index 2cc0c490..739c2b72 100644 --- a/routes/account.js +++ b/routes/account.js @@ -5,7 +5,6 @@ var HEX_STRING = require('./validators').HEX_STRING var LAZY_EMAIL = require('./validators').LAZY_EMAIL -var P = require('p-promise') var password = require('../crypto/password') module.exports = function (log, crypto, P, uuid, isA, error, db, mailer, isProduction) { diff --git a/routes/password.js b/routes/password.js index aad97b5d..461ec231 100644 --- a/routes/password.js +++ b/routes/password.js @@ -28,8 +28,6 @@ module.exports = function (log, isA, error, db, mailer) { log.security({ event: 'pwd-change-request' }) var form = request.payload var oldAuthPW = Buffer(form.oldAuthPW, 'hex') - var newAuthSalt = crypto.randomBytes(32) - var newVerifyHash = null db.emailRecord(form.email) .then( diff --git a/scripts/tap-coverage.js b/scripts/tap-coverage.js index 3480544b..6cf57d6f 100755 --- a/scripts/tap-coverage.js +++ b/scripts/tap-coverage.js @@ -1,4 +1,7 @@ #!/usr/bin/env node +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ if (!process.env.NO_COVERAGE) { var ass = require('ass').enable( { diff --git a/test/run/account_reset_token_tests.js b/test/run/account_reset_token_tests.js index f5f114c4..5f8f58d6 100644 --- a/test/run/account_reset_token_tests.js +++ b/test/run/account_reset_token_tests.js @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var test = require('../ptaptest') -var crypto = require('crypto') var log = { trace: function() {} } var tokens = require('../../tokens')(log)