diff options
author | zotlabs <mike@macgirvin.com> | 2018-02-07 21:53:47 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-02-07 21:53:47 -0800 |
commit | 6cf2e9945a08451e3d53b6e79002843e9cdb8dc6 (patch) | |
tree | 5a26980d9fb6337857c091d0b428ec8ffc95216a /include/zot.php | |
parent | b21a5c3ce902c4c88b2bb3dcae5d63a93e25479c (diff) | |
download | volse-hubzilla-6cf2e9945a08451e3d53b6e79002843e9cdb8dc6.tar.gz volse-hubzilla-6cf2e9945a08451e3d53b6e79002843e9cdb8dc6.tar.bz2 volse-hubzilla-6cf2e9945a08451e3d53b6e79002843e9cdb8dc6.zip |
encrypt the httpsig for zot6 transport
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 6 |
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; |