1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

Remove entropy from encryption and project.

This commit is contained in:
Kevin Serrano 2016-11-21 15:49:03 -08:00
parent 7cf6e372eb
commit 9123e70434
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4
7 changed files with 15 additions and 17 deletions

View File

@ -76,8 +76,8 @@ module.exports = class KeyringController extends EventEmitter {
this.ethStore = ethStore
}
createNewVaultAndKeychain (password, entropy, cb) {
this.createNewVault(password, entropy, (err) => {
createNewVaultAndKeychain (password, cb) {
this.createNewVault(password, (err) => {
if (err) return cb(err)
this.createFirstKeyTree(password, cb)
})
@ -94,7 +94,7 @@ module.exports = class KeyringController extends EventEmitter {
this.clearKeyrings()
this.createNewVault(password, '', (err) => {
this.createNewVault(password, (err) => {
if (err) return cb(err)
this.addNewKeyring('HD Key Tree', {
mnemonic: seed,
@ -135,7 +135,7 @@ module.exports = class KeyringController extends EventEmitter {
})
}
createNewVault (password, entropy, cb) {
createNewVault (password, cb) {
const configManager = this.configManager
const salt = this.encryptor.generateSalt()
configManager.setSalt(salt)

View File

@ -44,7 +44,7 @@ function IdentityStore (opts = {}) {
// public
//
IdentityStore.prototype.createNewVault = function (password, entropy, cb) {
IdentityStore.prototype.createNewVault = function (password, cb) {
delete this._keyStore
var serializedKeystore = this.configManager.getWallet()
@ -53,7 +53,7 @@ IdentityStore.prototype.createNewVault = function (password, entropy, cb) {
}
this.purgeCache()
this._createVault(password, null, entropy, (err) => {
this._createVault(password, null, (err) => {
if (err) return cb(err)
this._autoFaucet()
@ -77,7 +77,7 @@ IdentityStore.prototype.recoverSeed = function (cb) {
IdentityStore.prototype.recoverFromSeed = function (password, seed, cb) {
this.purgeCache()
this._createVault(password, seed, null, (err) => {
this._createVault(password, seed, (err) => {
if (err) return cb(err)
this._loadIdentities()
@ -497,7 +497,7 @@ IdentityStore.prototype.tryPassword = function (password, cb) {
})
}
IdentityStore.prototype._createVault = function (password, seedPhrase, entropy, cb) {
IdentityStore.prototype._createVault = function (password, seedPhrase, cb) {
const opts = {
password,
hdPathString: this.hdPathString,

View File

@ -52,7 +52,7 @@ describe('IdentityStore to KeyringController migration', function() {
},
})
idStore._createVault(password, mockVault.seed, null, (err) => {
idStore._createVault(password, mockVault.seed, (err) => {
assert.ifError(err, 'createNewVault threw error')
originalKeystore = idStore._idmgmt.keyStore

View File

@ -11,7 +11,6 @@ describe('IdentityStore', function() {
describe('#createNewVault', function () {
let idStore
let password = 'password123'
let entropy = 'entripppppyy duuude'
let seedWords
let accounts = []
let originalKeystore
@ -26,7 +25,7 @@ describe('IdentityStore', function() {
},
})
idStore.createNewVault(password, entropy, (err, seeds) => {
idStore.createNewVault(password, (err, seeds) => {
assert.ifError(err, 'createNewVault threw error')
seedWords = seeds
originalKeystore = idStore._idmgmt.keyStore

View File

@ -12,7 +12,6 @@ describe('KeyringController', function() {
let keyringController, state
let password = 'password123'
let entropy = 'entripppppyy duuude'
let seedWords = 'puzzle seed penalty soldier say clay field arctic metal hen cage runway'
let addresses = ['eF35cA8EbB9669A35c31b5F6f249A9941a812AC1'.toLowerCase()]
let accounts = []
@ -33,7 +32,7 @@ describe('KeyringController', function() {
// Browser crypto is tested in the integration test suite.
keyringController.encryptor = mockEncryptor
keyringController.createNewVaultAndKeychain(password, null, function (err, newState) {
keyringController.createNewVaultAndKeychain(password, function (err, newState) {
assert.ifError(err)
state = newState
done()
@ -51,7 +50,7 @@ describe('KeyringController', function() {
it('should set a vault on the configManager', function(done) {
keyringController.configManager.setVault(null)
assert(!keyringController.configManager.getVault(), 'no previous vault')
keyringController.createNewVaultAndKeychain(password, null, (err, state) => {
keyringController.createNewVaultAndKeychain(password, (err, state) => {
assert.ifError(err)
const vault = keyringController.configManager.getVault()
assert(vault, 'vault created')

View File

@ -201,9 +201,9 @@ function createNewVaultAndRestore (password, seed) {
}
}
function createNewVaultAndKeychain (password, entropy) {
function createNewVaultAndKeychain (password) {
return (dispatch) => {
background.createNewVaultAndKeychain(password, entropy, (err) => {
background.createNewVaultAndKeychain(password, (err) => {
if (err) {
return dispatch(actions.showWarning(err.message))
}

View File

@ -165,7 +165,7 @@ InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () {
return
}
this.props.dispatch(actions.createNewVaultAndKeychain(password, ''/* entropy*/))
this.props.dispatch(actions.createNewVaultAndKeychain(password))
}
InitializeMenuScreen.prototype.inputChanged = function (event) {