aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-21 18:02:14 -0700
committerredmatrix <git@macgirvin.com>2016-05-21 18:02:14 -0700
commited56b6e67b27900e2ff413a7781c9095aa8251a0 (patch)
treed14a411191059ec875b2078ab265119a8ccd29cc
parentbf050121506aa4cb487d9efd9cfdaa501ada3b1a (diff)
downloadvolse-hubzilla-ed56b6e67b27900e2ff413a7781c9095aa8251a0.tar.gz
volse-hubzilla-ed56b6e67b27900e2ff413a7781c9095aa8251a0.tar.bz2
volse-hubzilla-ed56b6e67b27900e2ff413a7781c9095aa8251a0.zip
first cut at zot-finger request signatures
-rw-r--r--Zotlabs/Module/Probe.php16
-rw-r--r--include/zot.php6
2 files changed, 14 insertions, 8 deletions
diff --git a/Zotlabs/Module/Probe.php b/Zotlabs/Module/Probe.php
index 79abe9819..dda792131 100644
--- a/Zotlabs/Module/Probe.php
+++ b/Zotlabs/Module/Probe.php
@@ -20,17 +20,17 @@ class Probe extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
$addr = trim($_GET['addr']);
$do_import = ((intval($_GET['import']) && is_site_admin()) ? true : false);
- $res = zot_finger($addr,$channel,false);
+
+ $j = \Zotlabs\Zot\Finger::run($addr,$channel,false);
+
+ // $res = zot_finger($addr,$channel,false);
+
$o .= '<pre>';
- if($res['success'])
- $j = json_decode($res['body'],true);
- else {
+ if(! $j['success']) {
$o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
$o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n";
- $res = zot_finger($addr,$channel,true);
- if($res['success'])
- $j = json_decode($res['body'],true);
- else
+ $j = \Zotlabs\Zot\Finger::run($addr,$channel,true);
+ if(! $j['success'])
$o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
}
diff --git a/include/zot.php b/include/zot.php
index 54a3fe640..f5fb87e12 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -3672,6 +3672,8 @@ function zotinfo($arr) {
$zsig = ((x($arr,'target_sig')) ? $arr['target_sig'] : '');
$zkey = ((x($arr,'key')) ? $arr['key'] : '');
$mindate = ((x($arr,'mindate')) ? $arr['mindate'] : '');
+ $token = ((x($arr,'token')) ? $arr['token'] : '');
+
$feed = ((x($arr,'feed')) ? intval($arr['feed']) : 0);
if($ztarget) {
@@ -3816,6 +3818,10 @@ function zotinfo($arr) {
// Communication details
+ if($token)
+ $ret['signed_token'] = base64url_encode(rsa_sign($token,$e['channel_prvkey']));
+
+
$ret['guid'] = $e['xchan_guid'];
$ret['guid_sig'] = $e['xchan_guid_sig'];
$ret['key'] = $e['xchan_pubkey'];