diff options
author | FChannel <> | 2022-06-05 21:36:17 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | dac4b267cab31fb3a4ce301f1bcdf364fcb541a1 (patch) | |
tree | 22852a6457e08f3ea047d2c20900db73c26e2fda /activitypub/actor.go | |
parent | 3ac22385f2cb2256db718e47f5ae3c6d13353b70 (diff) |
fix finger actor
Diffstat (limited to 'activitypub/actor.go')
-rw-r--r-- | activitypub/actor.go | 10 |
1 files changed, 7 insertions, 3 deletions
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)) |