Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

feat: allow keychain interactions without a password #25

Closed
wants to merge 1 commit into from
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
3 changes: 2 additions & 1 deletion src/keychain.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const defaultOptions = {
iterationCount: 10000,
salt: 'you should override this value with a crypto secure random number',
hash: 'sha2-512'
}
},
passPhrase: 'correcthorsebatterystaple'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the default password is just empty string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

function validateKeyName (name) {
Expand Down
4 changes: 2 additions & 2 deletions test/keychain.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = (datastore1, datastore2) => {
done()
})

it('needs a pass phrase to encrypt a key', () => {
expect(() => new Keychain(datastore2)).to.throw()
it('does not need a pass phrase to encrypt a key', () => {
expect(() => new Keychain(datastore2)).to.not.throw()
})

it('needs a NIST SP 800-132 non-weak pass phrase', () => {
Expand Down