Skip to content

Commit

Permalink
fix(packet): Fix pre-check error in public key signature verification
Browse files Browse the repository at this point in the history
  • Loading branch information
lubux committed Nov 22, 2023
1 parent 4863db4 commit ddb84e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openpgp/packet/public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err erro
signed.Write(sig.HashSuffix)
hashBytes := signed.Sum(nil)
// see discussion https://github.com/ProtonMail/go-crypto/issues/107
if sig.Version >= 5 && hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] {
if sig.Version >= 5 && (hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1]) {
return errors.SignatureError("hash tag doesn't match")
}

Expand Down

0 comments on commit ddb84e3

Please sign in to comment.