Update InboxPipeline, fail earlier for invalid public keys. Fixes #2648

This commit is contained in:
Daniel Supernault 2021-02-12 22:25:34 -07:00
parent 40db9a1296
commit d1c5e9b867
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 6 additions and 0 deletions

View file

@ -173,6 +173,9 @@ class InboxValidator implements ShouldQueue
return;
}
$pkey = openssl_pkey_get_public($actor->public_key);
if(!$pkey) {
return 0;
}
$inboxPath = "/users/{$profile->username}/inbox";
list($verified, $headers) = HttpSignature::verify($pkey, $signatureData, $headers, $inboxPath, $body);
if($verified == 1) {

View file

@ -161,6 +161,9 @@ class InboxWorker implements ShouldQueue
return;
}
$pkey = openssl_pkey_get_public($actor->public_key);
if(!$pkey) {
return 0;
}
$inboxPath = "/f/inbox";
list($verified, $headers) = HttpSignature::verify($pkey, $signatureData, $headers, $inboxPath, $body);
if($verified == 1) {