From dac4b267cab31fb3a4ce301f1bcdf364fcb541a1 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 5 Jun 2022 21:36:17 -0700 Subject: fix finger actor --- activitypub/actor.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'activitypub/actor.go') diff --git a/activitypub/actor.go b/activitypub/actor.go index c6283c8..e54088d 100644 --- a/activitypub/actor.go +++ b/activitypub/actor.go @@ -951,8 +951,7 @@ func (actor Actor) Verify(signature string, verify string) error { sig, _ := base64.StdEncoding.DecodeString(signature) if actor.PublicKey.PublicKeyPem == "" { - // TODO: this should be Finger but its not getting PublicKeyPem atm - _actor, err := GetActorFromDB(actor.Id) + _actor, err := FingerActor(actor.Id) if err != nil { return util.MakeError(err, "Verify") @@ -962,7 +961,12 @@ func (actor Actor) Verify(signature string, verify string) error { } block, _ := pem.Decode([]byte(actor.PublicKey.PublicKeyPem)) - pub, _ := x509.ParsePKIXPublicKey(block.Bytes) + + pub, err := x509.ParsePKIXPublicKey(block.Bytes) + + if err != nil { + return util.MakeError(err, "Verify") + } hashed := sha256.New() hashed.Write([]byte(verify)) -- cgit v1.2.3