aboutsummaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--registry/registry.go5
1 files changed, 3 insertions, 2 deletions
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