diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-02-22 02:43:14 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2019-04-08 19:19:37 +0800 |
commit | ae82c58631c05bebdb064ffabf2ce8c974585b34 (patch) | |
tree | 2c19699c0333e1b4a22b9c3697b7c9390ba38314 | |
parent | 7b230b7ef18391ded47caec65fae132490f6712d (diff) | |
download | go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar.gz go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar.bz2 go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar.lz go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar.xz go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.tar.zst go-tangerine-ae82c58631c05bebdb064ffabf2ce8c974585b34.zip |
Fix some linter issues
-rw-r--r-- | accounts/scwallet/securechannel.go | 6 | ||||
-rw-r--r-- | accounts/scwallet/wallet.go | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index acafaf967..1650dfbe5 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -165,11 +165,7 @@ func (s *SecureChannelSession) Open() error { // The IV is the last bytes returned from the Open APDU. s.iv = response.Data[scSecretLength:] - if err := s.mutuallyAuthenticate(); err != nil { - return err - } - - return nil + return s.mutuallyAuthenticate() } // mutuallyAuthenticate is an internal method to authenticate both ends of the diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index 0496ccc15..39e80eb3b 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -1060,7 +1060,7 @@ func determinePublicKey(sig, pubkeyX []byte) ([]byte, error) { sig[64] = byte(v) pubkey, err := crypto.Ecrecover(DerivationSignatureHash[:], sig) if err == nil { - if bytes.Compare(pubkey[1:33], pubkeyX) == 0 { + if bytes.Equal(pubkey[1:33], pubkeyX) { return pubkey, nil } } else if v == 1 || err != secp256k1.ErrRecoverFailed { @@ -1077,7 +1077,7 @@ func makeRecoverableSignature(hash, sig, expectedPubkey []byte) ([]byte, error) sig[64] = byte(v) pubkey, err := crypto.Ecrecover(hash, sig) if err == nil { - if bytes.Compare(pubkey, expectedPubkey) == 0 { + if bytes.Equal(pubkey, expectedPubkey) { return sig, nil } } else if v == 1 || err != secp256k1.ErrRecoverFailed { |