Do not fail on an invalid input for EtherWallet

This commit is contained in:
Alex Beregszaszi 2016-03-16 13:03:11 +00:00
parent 06e1c1dfb4
commit f97ad5dbe5
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,10 @@ Thirdparty.fromEtherWallet = function (input, password) {
// decode openssl ciphertext + salt encoding
cipher = decodeCryptojsSalt(cipher)
if (!cipher.salt) {
throw new Error('Unsupported EtherWallet key format')
}
// derive key/iv using OpenSSL EVP as implemented in CryptoJS
var evp = evp_kdf(new Buffer(password), cipher.salt, { keysize: 32, ivsize: 16 })