aboutsummaryrefslogtreecommitdiff
path: root/activitypub/actor.go
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub/actor.go')
-rw-r--r--activitypub/actor.go10
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))