From 6ef71d5d1c97a135b479effb4858a3e6e45edec1 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Fri, 6 Jan 2023 11:55:24 -0500 Subject: was the preamble wrong the whole time? --- registry/registry.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'registry/registry.go') diff --git a/registry/registry.go b/registry/registry.go index 290c2bd..6733c74 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -90,7 +90,7 @@ func (r *Registry) Actor(name string) (map[string]interface{}, error) { privKey := &keypair.PrivateKey pemdata := pem.EncodeToMemory( &pem.Block{ - Type: "PUBLIC KEY", + Type: "RSA PUBLIC KEY", Bytes: x509.MarshalPKCS1PublicKey(&privKey.PublicKey), }, ) @@ -302,7 +302,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol return err } - // verify our own signature to ensure sanity + // sanity check: decode our own public key from our PEM representation and attempt to verify + err = rsa.VerifyPKCS1v15(&privKey.PublicKey, crypto.SHA256, digestBytes[:], signature) if err != nil { return err -- cgit v1.2.3