update to go 1.25, use the cool new ECDSA key marshalling functions (#1483)

* update to go 1.25, use the cool new ECDSA key marshalling functions

* bonk the runners

* actually bump go.mod

* bump golangci-lint
This commit is contained in:
Jack Doan
2025-09-29 13:02:25 -05:00
committed by GitHub
parent 4cdeb284ef
commit 1ea5f776d7
8 changed files with 23 additions and 27 deletions

View File

@@ -110,8 +110,10 @@ func (c *certificateV1) CheckSignature(key []byte) bool {
case Curve_CURVE25519:
return ed25519.Verify(key, b, c.signature)
case Curve_P256:
x, y := elliptic.Unmarshal(elliptic.P256(), key)
pubKey := &ecdsa.PublicKey{Curve: elliptic.P256(), X: x, Y: y}
pubKey, err := ecdsa.ParseUncompressedPublicKey(elliptic.P256(), key)
if err != nil {
return false
}
hashed := sha256.Sum256(b)
return ecdsa.VerifyASN1(pubKey, hashed[:], c.signature)
default: