aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-02-15 13:33:23 +0000
committerMario <mario@mariovavti.com>2023-02-15 13:33:23 +0000
commit09a60774d746de57d6f9e479a1f6cf70c691f031 (patch)
tree1c93fee3a5a88b4cbcd9d9b9237451cf2fee99a1 /Zotlabs
parent1ca988b177834467671137c94f17a5948b465f6f (diff)
downloadvolse-hubzilla-09a60774d746de57d6f9e479a1f6cf70c691f031.tar.gz
volse-hubzilla-09a60774d746de57d6f9e479a1f6cf70c691f031.tar.bz2
volse-hubzilla-09a60774d746de57d6f9e479a1f6cf70c691f031.zip
we can sign messages which are not from the primary location
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Libzot.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 5610a21b2..8b4662bee 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -101,7 +101,6 @@ class Libzot {
static function build_packet($channel, $type = 'activity', $recipients = null, $msg = [], $encoding = 'activitystreams', $remote_key = null, $methods = '') {
$sig_method = get_config('system', 'signature_algorithm', 'sha256');
-
$data = [
'type' => $type,
'encoding' => $encoding,
@@ -115,9 +114,9 @@ class Libzot {
}
if ($msg) {
- $actor = channel_url($channel);
- if ($encoding === 'activitystreams' && array_key_exists('actor', $msg) && is_string($msg['actor']) && $actor === $msg['actor']) {
- $msg = JSalmon::sign($msg, $actor, $channel['channel_prvkey']);
+ $actors = get_hubloc_id_urls_by_x($channel['channel_hash']);
+ if ($encoding === 'activitystreams' && array_key_exists('actor', $msg) && is_string($msg['actor']) && in_array($msg['actor'], $actors)) {
+ $msg = JSalmon::sign($msg, $actors[0], $channel['channel_prvkey']);
}
$data['data'] = $msg;
}