aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/key_store_passphrase.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/key_store_passphrase.go')
-rw-r--r--accounts/key_store_passphrase.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/accounts/key_store_passphrase.go b/accounts/key_store_passphrase.go
index 87c7cb98f..3a5155e13 100644
--- a/accounts/key_store_passphrase.go
+++ b/accounts/key_store_passphrase.go
@@ -107,7 +107,8 @@ func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) {
return nil, err
}
encryptKey := derivedKey[:16]
- keyBytes := crypto.FromECDSA(key.PrivateKey)
+ keyBytes0 := crypto.FromECDSA(key.PrivateKey)
+ keyBytes := common.LeftPadBytes(keyBytes0, 32)
iv := randentropy.GetEntropyCSPRNG(aes.BlockSize) // 16
cipherText, err := aesCTRXOR(encryptKey, keyBytes, iv)