diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-24 16:59:56 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-24 16:59:56 -0700 |
commit | 8b7ab90836ef313e7eaf0a3fd1f29ad8ab1a716c (patch) | |
tree | 04add36aa35ce8cda58c5594a783737b25346175 /Zotlabs/Lib/LDSignatures.php | |
parent | 4d3b0577c9538644ca0eeb2751b285521d2cc86d (diff) | |
parent | 866dc9a9b3ca1cd98fc032afe0aec14ccdb86ba0 (diff) | |
download | volse-hubzilla-8b7ab90836ef313e7eaf0a3fd1f29ad8ab1a716c.tar.gz volse-hubzilla-8b7ab90836ef313e7eaf0a3fd1f29ad8ab1a716c.tar.bz2 volse-hubzilla-8b7ab90836ef313e7eaf0a3fd1f29ad8ab1a716c.zip |
Merge branch 'master' into tagging
Diffstat (limited to 'Zotlabs/Lib/LDSignatures.php')
-rw-r--r-- | Zotlabs/Lib/LDSignatures.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php index fa2758044..d500799c0 100644 --- a/Zotlabs/Lib/LDSignatures.php +++ b/Zotlabs/Lib/LDSignatures.php @@ -12,7 +12,10 @@ class LDSignatures { $ohash = self::hash(self::signable_options($data['signature'])); $dhash = self::hash(self::signable_data($data)); - return rsa_verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey); + $x = rsa_verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey); + logger('LD-verify: ' . intval($x)); + + return $x; } static function dopplesign(&$data,$channel) { @@ -35,7 +38,9 @@ class LDSignatures { $options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey'])); $signed = array_merge([ - '@context' => [ 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1' ], + '@context' => [ + ACTIVITYSTREAMS_JSONLD_REV, + 'https://w3id.org/security/v1' ], ],$options); return $signed; @@ -82,6 +87,8 @@ class LDSignatures { if(! is_object($data)) return ''; + jsonld_set_document_loader('jsonld_document_loader'); + return jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]); } |