forked from cerc-io/plugeth
Fix some linter issues
This commit is contained in:
parent
7b230b7ef1
commit
ae82c58631
@ -165,11 +165,7 @@ func (s *SecureChannelSession) Open() error {
|
|||||||
// The IV is the last bytes returned from the Open APDU.
|
// The IV is the last bytes returned from the Open APDU.
|
||||||
s.iv = response.Data[scSecretLength:]
|
s.iv = response.Data[scSecretLength:]
|
||||||
|
|
||||||
if err := s.mutuallyAuthenticate(); err != nil {
|
return s.mutuallyAuthenticate()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// mutuallyAuthenticate is an internal method to authenticate both ends of the
|
// mutuallyAuthenticate is an internal method to authenticate both ends of the
|
||||||
|
@ -1060,7 +1060,7 @@ func determinePublicKey(sig, pubkeyX []byte) ([]byte, error) {
|
|||||||
sig[64] = byte(v)
|
sig[64] = byte(v)
|
||||||
pubkey, err := crypto.Ecrecover(DerivationSignatureHash[:], sig)
|
pubkey, err := crypto.Ecrecover(DerivationSignatureHash[:], sig)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if bytes.Compare(pubkey[1:33], pubkeyX) == 0 {
|
if bytes.Equal(pubkey[1:33], pubkeyX) {
|
||||||
return pubkey, nil
|
return pubkey, nil
|
||||||
}
|
}
|
||||||
} else if v == 1 || err != secp256k1.ErrRecoverFailed {
|
} else if v == 1 || err != secp256k1.ErrRecoverFailed {
|
||||||
@ -1077,7 +1077,7 @@ func makeRecoverableSignature(hash, sig, expectedPubkey []byte) ([]byte, error)
|
|||||||
sig[64] = byte(v)
|
sig[64] = byte(v)
|
||||||
pubkey, err := crypto.Ecrecover(hash, sig)
|
pubkey, err := crypto.Ecrecover(hash, sig)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if bytes.Compare(pubkey, expectedPubkey) == 0 {
|
if bytes.Equal(pubkey, expectedPubkey) {
|
||||||
return sig, nil
|
return sig, nil
|
||||||
}
|
}
|
||||||
} else if v == 1 || err != secp256k1.ErrRecoverFailed {
|
} else if v == 1 || err != secp256k1.ErrRecoverFailed {
|
||||||
|
Loading…
Reference in New Issue
Block a user