Skip to content

Commit

Permalink
accounts/scwallet: change format 0x%x to %#x (ethereum#25221)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Jan 10, 2025
1 parent 8e8e0f7 commit 744d170
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions accounts/scwallet/securechannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (s *SecureChannelSession) mutuallyAuthenticate() error {
return err
}
if response.Sw1 != 0x90 || response.Sw2 != 0x00 {
return fmt.Errorf("got unexpected response from MUTUALLY_AUTHENTICATE: 0x%x%x", response.Sw1, response.Sw2)
return fmt.Errorf("got unexpected response from MUTUALLY_AUTHENTICATE: %#x%x", response.Sw1, response.Sw2)
}

if len(response.Data) != scSecretLength {
Expand Down Expand Up @@ -261,7 +261,7 @@ func (s *SecureChannelSession) transmitEncrypted(cla, ins, p1, p2 byte, data []b
rapdu.deserialize(plainData)

if rapdu.Sw1 != sw1Ok {
return nil, fmt.Errorf("unexpected response status Cla=0x%x, Ins=0x%x, Sw=0x%x%x", cla, ins, rapdu.Sw1, rapdu.Sw2)
return nil, fmt.Errorf("unexpected response status Cla=%#x, Ins=%#x, Sw=%#x%x", cla, ins, rapdu.Sw1, rapdu.Sw2)
}

return rapdu, nil
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func transmit(card *pcsc.Card, command *commandAPDU) (*responseAPDU, error) {
}

if response.Sw1 != sw1Ok {
return nil, fmt.Errorf("unexpected insecure response status Cla=0x%x, Ins=0x%x, Sw=0x%x%x", command.Cla, command.Ins, response.Sw1, response.Sw2)
return nil, fmt.Errorf("unexpected insecure response status Cla=%#x, Ins=%#x, Sw=%#x%x", command.Cla, command.Ins, response.Sw1, response.Sw2)
}

return response, nil
Expand Down

0 comments on commit 744d170

Please sign in to comment.