Skip to content

Commit

Permalink
accounts/keystore: fix staticcheck warnings (ethereum#20373)
Browse files Browse the repository at this point in the history
* accounts/keystore: fix staticcheck warnings

* review feedback
  • Loading branch information
gzliudan committed Jan 3, 2025
1 parent 283807d commit 7e0ecc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions accounts/keystore/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (ks keyStorePassphrase) StoreKey(filename string, key *Key, auth string) er
"Please file a ticket at:\n\n" +
"https://github.com/ethereum/go-ethereum/issues." +
"The error was : %s"
//lint:ignore ST1005 This is a message for the user
return fmt.Errorf(msg, tmpName, err)
}
}
Expand Down Expand Up @@ -235,7 +236,7 @@ func DecryptKey(keyjson []byte, auth string) (*Key, error) {

func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error) {
if cryptoJson.Cipher != "aes-128-ctr" {
return nil, fmt.Errorf("Cipher not supported: %v", cryptoJson.Cipher)
return nil, fmt.Errorf("cipher not supported: %v", cryptoJson.Cipher)
}
mac, err := hex.DecodeString(cryptoJson.MAC)
if err != nil {
Expand Down Expand Up @@ -271,7 +272,7 @@ func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error) {

func decryptKeyV3(keyProtected *encryptedKeyJSONV3, auth string) (keyBytes []byte, keyId []byte, err error) {
if keyProtected.Version != version {
return nil, nil, fmt.Errorf("Version not supported: %v", keyProtected.Version)
return nil, nil, fmt.Errorf("version not supported: %v", keyProtected.Version)
}
keyId = uuid.Parse(keyProtected.Id)
plainText, err := DecryptDataV3(keyProtected.Crypto, auth)
Expand Down

0 comments on commit 7e0ecc5

Please sign in to comment.