ax(ueps): rename expectedMAC to expectedMessageAuthCode
MAC is an abbreviation requiring context; expectedMessageAuthCode matches the established messageAuthCode pattern and is self-describing (AX §1). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
865a690853
commit
db124cff82
1 changed files with 2 additions and 2 deletions
|
|
@ -112,9 +112,9 @@ func ReadAndVerify(reader *bufio.Reader, sharedSecret []byte) (*ParsedPacket, er
|
|||
messageAuthCode := hmac.New(sha256.New, sharedSecret)
|
||||
messageAuthCode.Write(signedData.Bytes())
|
||||
messageAuthCode.Write(payload)
|
||||
expectedMAC := messageAuthCode.Sum(nil)
|
||||
expectedMessageAuthCode := messageAuthCode.Sum(nil)
|
||||
|
||||
if !hmac.Equal(signature, expectedMAC) {
|
||||
if !hmac.Equal(signature, expectedMessageAuthCode) {
|
||||
return nil, errIntegrityViolation
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue