mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-21 20:43:18 +00:00
commit
dedc81c00f
1 changed files with 7 additions and 10 deletions
|
@ -107,9 +107,6 @@ class DeleteWorker implements ShouldQueue
|
|||
if($this->verifySignature($headers, $payload) == true) {
|
||||
(new Inbox($headers, $profile, $payload))->handle();
|
||||
return 1;
|
||||
} else if($this->blindKeyRotation($headers, $payload) == true) {
|
||||
(new Inbox($headers, $profile, $payload))->handle();
|
||||
return 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
@ -122,15 +119,15 @@ class DeleteWorker implements ShouldQueue
|
|||
$signature = is_array($headers['signature']) ? $headers['signature'][0] : $headers['signature'];
|
||||
$date = is_array($headers['date']) ? $headers['date'][0] : $headers['date'];
|
||||
if(!$signature) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if(!$date) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if(!now()->parse($date)->gt(now()->subDays(1)) ||
|
||||
!now()->parse($date)->lt(now()->addDays(1))
|
||||
) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
$signatureData = HttpSignature::parseSignatureHeader($signature);
|
||||
$keyId = Helpers::validateUrl($signatureData['keyId']);
|
||||
|
@ -150,11 +147,11 @@ class DeleteWorker implements ShouldQueue
|
|||
}
|
||||
}
|
||||
if(parse_url($attr, PHP_URL_HOST) !== $keyDomain) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
$actor = Profile::whereKeyId($keyId)->first();
|
||||
if(!$actor) {
|
||||
|
@ -162,11 +159,11 @@ class DeleteWorker implements ShouldQueue
|
|||
$actor = Helpers::profileFirstOrNew($actorUrl);
|
||||
}
|
||||
if(!$actor) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
$pkey = openssl_pkey_get_public($actor->public_key);
|
||||
if(!$pkey) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
$inboxPath = "/f/inbox";
|
||||
list($verified, $headers) = HttpSignature::verify($pkey, $signatureData, $headers, $inboxPath, $body);
|
||||
|
|
Loading…
Reference in a new issue