aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/key_store_passphrase.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-21 21:52:10 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-05-12 23:19:39 +0800
commit313eec33ad7add82bfdd00e3a076091fa990c799 (patch)
treea6aaf9167c122e7357b7c2c55251068325021056 /crypto/key_store_passphrase.go
parent8754f2b768ba00d8507a7990dccca80e6cea1cc0 (diff)
downloaddexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar.gz
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar.bz2
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar.lz
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar.xz
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.tar.zst
dexon-313eec33ad7add82bfdd00e3a076091fa990c799.zip
Revert "Add key header to unencrypted key file"
This reverts commit a94d4ba0b53c4558ab838aaed635a2ff66ddfa53.
Diffstat (limited to 'crypto/key_store_passphrase.go')
-rw-r--r--crypto/key_store_passphrase.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/key_store_passphrase.go b/crypto/key_store_passphrase.go
index 96227e4d1..00717b5d1 100644
--- a/crypto/key_store_passphrase.go
+++ b/crypto/key_store_passphrase.go
@@ -153,7 +153,7 @@ func (ks keyStorePassphrase) StoreKey(key *Key, auth string) (err error) {
keyHeaderJSON := keyHeaderJSON{
Version: keyHeaderVersion,
Kdf: keyHeaderKDF,
- KdfParams: &paramsJSON,
+ KdfParams: paramsJSON,
}
keyHeaderJSONStr, err := json.Marshal(keyHeaderJSON)
@@ -167,12 +167,12 @@ func (ks keyStorePassphrase) StoreKey(key *Key, auth string) (err error) {
mac,
salt,
iv,
+ keyHeaderJSON,
cipherText,
}
keyStruct := encryptedKeyJSON{
key.Id,
key.Address.Bytes(),
- keyHeaderJSON,
cipherStruct,
}
keyJSON, err := json.Marshal(keyStruct)
@@ -204,11 +204,10 @@ func DecryptKey(ks keyStorePassphrase, keyAddr common.Address, auth string) (key
err = json.Unmarshal(fileContent, keyProtected)
keyId = keyProtected.Id
- keyHeader := keyProtected.KeyHeader
-
mac := keyProtected.Crypto.MAC
salt := keyProtected.Crypto.Salt
iv := keyProtected.Crypto.IV
+ keyHeader := keyProtected.Crypto.KeyHeader
cipherText := keyProtected.Crypto.CipherText
// used in MAC