aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-11-11 15:12:01 -0800
committerzotlabs <mike@macgirvin.com>2018-11-11 15:12:01 -0800
commitda452decf695ceac249642ec9d12fb724fa547f7 (patch)
tree2412eadb628d7e24d09b4545a78883cd0e72244c /include
parentc80ac58effdb71fe457daa164053ea57c1513e68 (diff)
downloadvolse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.tar.gz
volse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.tar.bz2
volse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.zip
more z6 debugging
Diffstat (limited to 'include')
-rw-r--r--include/crypto.php9
-rw-r--r--include/queue_fn.php11
2 files changed, 12 insertions, 8 deletions
diff --git a/include/crypto.php b/include/crypto.php
index 1040ac29b..fc1029e55 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -225,9 +225,14 @@ function crypto_unencapsulate($data,$prvkey) {
if(! $data)
return;
- $alg = ((array_key_exists('alg',$data)) ? $data['alg'] : 'aes256cbc');
- if($alg === 'aes256cbc')
+ $alg = ((is_array($data) && array_key_exists('encrypted',$data)) ? $data['alg'] : '');
+ if(! $alg) {
+ return $data;
+ }
+
+ if($alg === 'aes256cbc') {
return aes_unencapsulate($data,$prvkey);
+ }
return other_unencapsulate($data,$prvkey,$alg);
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 074e3c407..f7e2922c6 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -237,7 +237,7 @@ function queue_deliver($outq, $immediate = false) {
$zot = new Receiver(new Zot6Handler(),$outq['outq_notify']);
$result = $zot->run(true);
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
- logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
+ logger('deliver: local zot6 delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
}
else {
@@ -250,8 +250,7 @@ function queue_deliver($outq, $immediate = false) {
$host_crypto = null;
if($channel && $base) {
- $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and\
- hubloc_network = 'zot6' order by hubloc_id desc limit 1",
+ $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc limit 1",
dbesc($base)
);
if($h) {
@@ -264,12 +263,12 @@ function queue_deliver($outq, $immediate = false) {
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
if($result['success']) {
- logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
+ logger('deliver: remote zot6 delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],$result, $outq);
}
else {
- logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);
- logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA);
+ logger('deliver: remote zot6 delivery failed to ' . $outq['outq_posturl']);
+ logger('deliver: remote zot6 delivery fail data: ' . print_r($result,true), LOGGER_DATA);
update_queue_item($outq['outq_hash'],10);
}