diff options
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 20 | ||||
-rw-r--r-- | Zotlabs/Lib/JSalmon.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/LDSignatures.php | 3 | ||||
-rw-r--r-- | Zotlabs/Lib/Share.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/Zotfinger.php | 7 |
5 files changed, 25 insertions, 9 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 08e5ffaca..5f222754b 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -104,6 +104,7 @@ class Activity { } else { logger('fetch failed: ' . $url); + logger($x['body']); } return null; } @@ -1018,6 +1019,7 @@ class Activity { if(! $extended) { return $p['xchan_url']; } + $ret = []; $c = ((array_key_exists('channel_id',$p)) ? $p : channelx_by_hash($p['xchan_hash'])); @@ -1063,10 +1065,16 @@ class Activity { ] ]; + $ret['publicKey'] = [ + 'id' => $p['xchan_url'], + 'owner' => $p['xchan_url'], + 'publicKeyPem' => $p['xchan_pubkey'] + ]; + $arr = [ 'xchan' => $p, 'encoded' => $ret ]; call_hooks('encode_person', $arr); - $ret = $arr['encoded']; + $ret = $arr['encoded']; return $ret; } @@ -1485,6 +1493,14 @@ class Activity { if(! is_array($person_obj)) return; + $inbox = $person_obj['inbox']; + + // invalid identity + + if (! $inbox || strpos($inbox,z_root()) !== false) { + return; + } + $name = $person_obj['name']; if(! $name) $name = $person_obj['preferredUsername']; @@ -1532,8 +1548,6 @@ class Activity { $profile = $url; } - $inbox = $person_obj['inbox']; - $collections = []; if($inbox) { diff --git a/Zotlabs/Lib/JSalmon.php b/Zotlabs/Lib/JSalmon.php index 67512046f..48a4e649b 100644 --- a/Zotlabs/Lib/JSalmon.php +++ b/Zotlabs/Lib/JSalmon.php @@ -51,7 +51,7 @@ class JSalmon { . base64url_encode($x['encoding'],true) . '.' . base64url_encode($x['alg'],true); - $key = HTTPSig::get_key(EMPTY_STR,base64url_decode($x['sigs']['key_id'])); + $key = HTTPSig::get_key(EMPTY_STR,'zot6',base64url_decode($x['sigs']['key_id'])); logger('key: ' . print_r($key,true)); if($key['portable_id'] && $key['public_key']) { if(rsa_verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) { diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php index 16c8cfc18..2eba66ccf 100644 --- a/Zotlabs/Lib/LDSignatures.php +++ b/Zotlabs/Lib/LDSignatures.php @@ -93,7 +93,8 @@ class LDSignatures { $d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]); } catch (\Exception $e) { - logger('normalise error:' . print_r($e,true)); + // Don't log the exception - this can exhaust memory + // logger('normalise error:' . print_r($e,true)); logger('normalise error: ' . print_r($data,true)); } diff --git a/Zotlabs/Lib/Share.php b/Zotlabs/Lib/Share.php index 419e6ed5f..d34c0eaba 100644 --- a/Zotlabs/Lib/Share.php +++ b/Zotlabs/Lib/Share.php @@ -133,7 +133,7 @@ class Share { "' message_id='" . $this->item['mid'] . "']"; if($this->item['title']) - $bb .= '[b]'.$this->item['title'].'[/b]'."\r\n"; + $bb .= '[h3][b]'.$this->item['title'].'[/b][/h3]'."\r\n"; $bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']); $bb .= "[/share]"; } diff --git a/Zotlabs/Lib/Zotfinger.php b/Zotlabs/Lib/Zotfinger.php index 722e34dfc..e853d6ebc 100644 --- a/Zotlabs/Lib/Zotfinger.php +++ b/Zotlabs/Lib/Zotfinger.php @@ -6,7 +6,7 @@ use Zotlabs\Web\HTTPSig; class Zotfinger { - static function exec($resource,$channel = null) { + static function exec($resource,$channel = null, $verify = true) { if(! $resource) { return false; @@ -41,8 +41,9 @@ class Zotfinger { logger('fetch: ' . print_r($x,true)); if($x['success']) { - - $result['signature'] = HTTPSig::verify($x); + if ($verify) { + $result['signature'] = HTTPSig::verify($x, EMPTY_STR, 'zot6'); + } $result['data'] = json_decode($x['body'],true); |