diff options
author | Mario <mario@mariovavti.com> | 2021-02-09 13:50:03 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-02-09 13:50:03 +0000 |
commit | b4693870ba647455e6bd0a3919a544130cee118b (patch) | |
tree | 97fe6de09c5ce3b5e6ed247c6a6105008631e79a /Zotlabs/Lib/Zotfinger.php | |
parent | 5aee2f172ecdf58e13dd328c787fd199c48d24c5 (diff) | |
download | volse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.tar.gz volse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.tar.bz2 volse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.zip |
port Lib/Crypto from zap
Diffstat (limited to 'Zotlabs/Lib/Zotfinger.php')
-rw-r--r-- | Zotlabs/Lib/Zotfinger.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Zotfinger.php b/Zotlabs/Lib/Zotfinger.php index faaf28f35..840d91403 100644 --- a/Zotlabs/Lib/Zotfinger.php +++ b/Zotlabs/Lib/Zotfinger.php @@ -18,8 +18,8 @@ class Zotfinger { if($channel && $m) { - $headers = [ - 'Accept' => 'application/x-zot+json', + $headers = [ + 'Accept' => 'application/x-zot+json', 'Content-Type' => 'application/x-zot+json', 'X-Zot-Token' => random_string(), 'Digest' => HTTPSig::generate_digest_header($data), @@ -29,9 +29,9 @@ class Zotfinger { $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false); } else { - $h = [ 'Accept: application/x-zot+json' ]; + $h = [ 'Accept: application/x-zot+json' ]; } - + $result = []; $redirects = 0; @@ -43,11 +43,11 @@ class Zotfinger { if ($verify) { $result['signature'] = HTTPSig::verify($x, EMPTY_STR, 'zot6'); } - + $result['data'] = json_decode($x['body'],true); if($result['data'] && is_array($result['data']) && array_key_exists('encrypted',$result['data']) && $result['data']['encrypted']) { - $result['data'] = json_decode(crypto_unencapsulate($result['data'],get_config('system','prvkey')),true); + $result['data'] = json_decode(Crypto::unencapsulate($result['data'],get_config('system','prvkey')),true); } logger('decrypted: ' . print_r($result,true)); |