encrypt the httpsig for zot6 transport
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user