aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php
index 5fb18d5a7..c00caebb4 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -288,9 +288,11 @@ function zot_best_algorithm($methods) {
*
* @param string $url
* @param array $data
+ * @param array $channel (optional if using zot6 delivery)
+ * @param array $crypto (optional if encrypted httpsig, requires hubloc_sitekey and site_crypto elements)
* @return array see z_post_url() for returned data format
*/
-function zot_zot($url, $data, $channel = null) {
+function zot_zot($url, $data, $channel = null,$crypto = null) {
$headers = [];
@@ -298,7 +300,7 @@ function zot_zot($url, $data, $channel = null) {
$headers['X-Zot-Token'] = random_string();
$hash = \Zotlabs\Web\HTTPSig::generate_digest($data,false);
$headers['X-Zot-Digest'] = 'SHA-256=' . $hash;
- $h = \Zotlabs\Web\HTTPSig::create_sig('',$headers,$channel['channel_prvkey'],'acct:' . $channel['channel_address'] . '@' . \App::get_hostname(),false,false,'sha512');
+ $h = \Zotlabs\Web\HTTPSig::create_sig('',$headers,$channel['channel_prvkey'],'acct:' . $channel['channel_address'] . '@' . \App::get_hostname(),false,false,'sha512',(($crypto) ? $crypto['hubloc_sitekey'] : ''), (($crypto) ? zot_best_algorithm($crypto['site_crypto']) : ''));
}
$redirects = 0;