Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_js:
- "0.12"
- "4"
- "5"
- "6"
install:
- npm install
script:
Expand Down
6 changes: 3 additions & 3 deletions credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var crypto = require('crypto'),
pbkdf2 = function pbkdf2 (password, salt, iterations,
keyLength, callback) {
crypto.pbkdf2(password, salt,
iterations, keyLength, function (err, hash) {
iterations, keyLength, 'SHA1', function (err, hash) {
if (err) {
return callback(err);
}
Expand Down Expand Up @@ -163,7 +163,7 @@ var crypto = require('crypto'),

if (typeof (password) !== 'string' || password.length === 0) {
return callback(new Error('Password must be a ' +
' non-empty string.'));
'non-empty string.'));
}

// Create the salt
Expand Down Expand Up @@ -217,7 +217,7 @@ var crypto = require('crypto'),
'hash.'));
} else if (typeof (input) !== 'string' || input.length === 0) {
return callback(new Error('Input password must ' +
' be a non-empty string.'));
'be a non-empty string.'));
}

var n = storedHash.iterations;
Expand Down
4 changes: 2 additions & 2 deletions test/cli-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ test('cli - hash - no password', function (t){
t.ifError(err);

var actual = stderr.trim();
var expected = '[Error: Password must be a non-empty string.]';
var expected = /Error: Password must be a non-empty string/;

t.is(actual, expected);
t.ok(expected.test(actual));

t.end();
});
Expand Down