go.crypto/openpgp: fix user id signing.
Entity.SignIdentity used the wrong signature function and produced invalid
certification signatures. Fixed.
VerifyUserIdSignature was used for checking the self-signature on an identity,
but didn't support anything but a self-signature. This change alters the
low-level API so that checking cross-signatures is possible.
Fixes golang/go#7371.
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/96240043
diff --git a/openpgp/packet/public_key_test.go b/openpgp/packet/public_key_test.go
index 47168a4..7ad7d91 100644
--- a/openpgp/packet/public_key_test.go
+++ b/openpgp/packet/public_key_test.go
@@ -133,7 +133,7 @@
t.Error(err)
}
uidSig := p.(*Signature)
- err = pubkey.VerifyUserIdSignature(uid.Id, uidSig)
+ err = pubkey.VerifyUserIdSignature(uid.Id, pubkey, uidSig)
if err != nil {
t.Error(err, ": UID")
}