From de8da9ddf67f36977e43d2168c4847fd9923c875 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 22 Nov 2016 15:54:51 -0800 Subject: Simplify Encryptor API Surface At least, the portion of it that we use. Moved salting within the encryptor, so it does not need to be managed externally. KeyringController now caches the password instead of a passwordDerivedKey, since it is ignorant of the salt. Encryptor payload is now in a JSON format, so its portions are both base64 encoded *and* labeled appropriately. The format is `{ "data": "0x0", "iv": "0x0", "salt": "string" }`. Fixes #843 Fixes #859 --- test/unit/keyring-controller-test.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/unit/keyring-controller-test.js b/test/unit/keyring-controller-test.js index 437441e0e..c32141cc6 100644 --- a/test/unit/keyring-controller-test.js +++ b/test/unit/keyring-controller-test.js @@ -82,13 +82,15 @@ describe('KeyringController', function() { }) - describe('#migrateAndGetKey', function() { + describe('#migrateOldVaultIfAny', function() { it('should return the key for that password', function(done) { - keyringController.migrateAndGetKey(password) - .then((key) => { - assert(key, 'a key is returned') + keyringController.migrateOldVaultIfAny(password) + .then(() => { done() }) + .catch((reason) => { + assert.ifError(reason) + }) }) }) -- cgit v1.2.3