diff --git a/include/import.php b/include/import.php index 87721935b..813ea3230 100644 --- a/include/import.php +++ b/include/import.php @@ -1625,7 +1625,7 @@ function sync_files($channel, $files) '(request-target)' => 'post ' . $m['path'] . '/' . $att['hash'] ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel,true), true, 'sha512'); $x = Url::post($fetch_url . '/' . $att['hash'], $parr, [ 'filep' => $fp, 'headers' => $headers]); @@ -1717,7 +1717,7 @@ function sync_files($channel, $files) '(request-target)' => 'post ' . $m['path'] . '/' . $att['hash'] ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel, true), true, 'sha512'); $x = Url::post($fetch_url . '/' . $att['hash'], $parr, [ 'filep' => $fp, 'headers' => $headers]); diff --git a/src/Daemon/Content_importer.php b/src/Daemon/Content_importer.php index 9dacd42e9..f9ee1188d 100644 --- a/src/Daemon/Content_importer.php +++ b/src/Daemon/Content_importer.php @@ -39,7 +39,7 @@ class Content_importer implements DaemonInterface '(request-target)' => 'get /api/z/1.0/item/export_page?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page , ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel,true), true, 'sha512'); $x = Url::get($hz_server . '/api/z/1.0/item/export_page?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page, [ 'headers' => $headers ]); diff --git a/src/Daemon/File_importer.php b/src/Daemon/File_importer.php index 24f670bba..b6dee7f69 100644 --- a/src/Daemon/File_importer.php +++ b/src/Daemon/File_importer.php @@ -37,7 +37,7 @@ class File_importer implements DaemonInterface '(request-target)' => 'get /api/z/1.0/file/export?f=&zap_compat=1&file_id=' . $attach_id, ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel,true), true, 'sha512'); $x = Url::get($hz_server . '/api/z/1.0/file/export?f=&zap_compat=1&file_id=' . $attach_id, [ 'headers' => $headers ]); if (! $x['success']) { diff --git a/src/Lib/Channel.php b/src/Lib/Channel.php index ab05daee7..4fc418f55 100644 --- a/src/Lib/Channel.php +++ b/src/Lib/Channel.php @@ -2630,6 +2630,9 @@ class Channel return z_root() . '#rsakey'; } $nomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP'); + if ($legacy) { + $nomadic = false; + } $url = $nomadic ? self::getDidResolver($channel, true) : z_root() . '/channel/' . $channel['channel_address']; return $url . (($legacy) ? '' : '#rsakey'); diff --git a/src/Lib/Libzot.php b/src/Lib/Libzot.php index 6e7931860..a02463cdf 100644 --- a/src/Lib/Libzot.php +++ b/src/Lib/Libzot.php @@ -235,7 +235,7 @@ class Libzot $h = HTTPSig::create_sig( $headers, $channel['channel_prvkey'], - Channel::keyId($channel), + Channel::keyId($channel,true), false, 'sha512', (($crypto) ? ['key' => $crypto['hubloc_sitekey'], 'algorithm' => self::best_algorithm($crypto['site_crypto'])] : false) @@ -257,7 +257,7 @@ class Libzot '(request-target)' => 'post ' . get_request_string($url) ]; - $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],Channel::keyId($channel),false,'sha512', + $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],Channel::keyId($channel,true),false,'sha512', (($crypto) ? [ 'key' => $crypto['hubloc_sitekey'], 'algorithm' => self::best_algorithm($crypto['site_crypto']) ] : false)); } else { diff --git a/src/Module/Activity.php b/src/Module/Activity.php index 1d1e3e2b2..3a6533c82 100644 --- a/src/Module/Activity.php +++ b/src/Module/Activity.php @@ -300,7 +300,7 @@ class Activity extends Controller $ret = json_encode($x, JSON_UNESCAPED_SLASHES); $headers['Digest'] = HTTPSig::generate_digest_header($ret); $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; - $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan)); + $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan, true)); HTTPSig::set_headers($h); echo $ret; killme(); diff --git a/src/Module/Channel.php b/src/Module/Channel.php index d313f87f9..8aa0729bd 100644 --- a/src/Module/Channel.php +++ b/src/Module/Channel.php @@ -201,7 +201,7 @@ class Channel extends Controller 'Digest' => HTTPSig::generate_digest_header($data), '(request-target)' => strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'] ]; - $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Zlib\Channel::keyId($channel)); + $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Zlib\Channel::keyId($channel,true)); HTTPSig::set_headers($h); echo $data; killme(); diff --git a/src/Module/Id.php b/src/Module/Id.php index 8746f20cb..4a10a51da 100644 --- a/src/Module/Id.php +++ b/src/Module/Id.php @@ -103,7 +103,7 @@ class Id extends Controller $ret = json_encode($x, JSON_UNESCAPED_SLASHES); $headers['Digest'] = HTTPSig::generate_digest_header($ret); $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; - $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan)); + $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan,true)); HTTPSig::set_headers($h); echo $ret; killme(); diff --git a/src/Module/Import.php b/src/Module/Import.php index 9e7571094..7b1e5f2d2 100644 --- a/src/Module/Import.php +++ b/src/Module/Import.php @@ -631,7 +631,7 @@ class Import extends Controller '(request-target)' => 'get /api/z/1.0/item/export_page?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page, ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel,true), true, 'sha512'); $x = Url::get($hz_server . '/api/z/1.0/item/export_page?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page, ['headers' => $headers]); @@ -664,7 +664,7 @@ class Import extends Controller '(request-target)' => 'get /api/z/1.0/files?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until), ]; - $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), true, 'sha512'); + $headers = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel,true), true, 'sha512'); $x = Url::get($hz_server . '/api/z/1.0/files?f=&zap_compat=1&since=' . urlencode($since) . '&until=' . urlencode($until), ['headers' => $headers]); diff --git a/src/Module/Item.php b/src/Module/Item.php index fedec963c..bd2f6b939 100644 --- a/src/Module/Item.php +++ b/src/Module/Item.php @@ -325,7 +325,7 @@ class Item extends Controller $ret = json_encode($x, JSON_UNESCAPED_SLASHES); $headers['Digest'] = HTTPSig::generate_digest_header($ret); $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; - $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan)); + $h = HTTPSig::create_sig($headers, $chan['channel_prvkey'], Channel::keyId($chan, true)); HTTPSig::set_headers($h); echo $ret; killme();