mirror of
https://github.com/friendica/friendica
synced 2025-05-01 19:04:23 +02:00
LD signatures will now be checked when receiving messages
This commit is contained in:
parent
752b5fe284
commit
355346298b
3 changed files with 39 additions and 4 deletions
|
@ -393,10 +393,12 @@ class HTTPSignature
|
|||
|
||||
$profile = ActivityPub::fetchprofile($url);
|
||||
if (!empty($profile)) {
|
||||
logger('Taking key from id ' . $id, LOGGER_DEBUG);
|
||||
return $profile['pubkey'];
|
||||
} elseif ($url != $actor) {
|
||||
$profile = ActivityPub::fetchprofile($actor);
|
||||
if (!empty($profile)) {
|
||||
logger('Taking key from actor ' . $actor, LOGGER_DEBUG);
|
||||
return $profile['pubkey'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,24 @@ class LDSignature
|
|||
}
|
||||
|
||||
if (empty($pubkey)) {
|
||||
/*
|
||||
$creator = $data['signature']['creator'];
|
||||
$actor = JsonLD::fetchElement($data, 'actor', 'id');
|
||||
|
||||
$url = (strpos($creator, '#') ? substr($creator, 0, strpos($creator, '#')) : $creator);
|
||||
|
||||
$profile = ActivityPub::fetchprofile($url);
|
||||
if (!empty($profile)) {
|
||||
logger('Taking key from creator ' . $creator, LOGGER_DEBUG);
|
||||
} elseif ($url != $actor) {
|
||||
$profile = ActivityPub::fetchprofile($actor);
|
||||
if (empty($profile)) {
|
||||
return false;
|
||||
}
|
||||
logger('Taking key from actor ' . $actor, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
*/
|
||||
$actor = JsonLD::fetchElement($data, 'actor', 'id');
|
||||
if (empty($actor)) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue