LD signatures will now be checked when receiving messages

This commit is contained in:
Michael 2018-09-21 03:39:32 +00:00
parent 752b5fe284
commit 355346298b
3 changed files with 39 additions and 4 deletions

View file

@ -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'];
}
}

View file

@ -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;