aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/LDSignatures.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-03-08 09:31:23 +0000
committerMario <mario@mariovavti.com>2021-03-08 09:31:23 +0000
commit951e9c8c4f39dd8577834d5bc501c05d80722de9 (patch)
tree6a42c6a229c7b2b3e13bc5af77a733d054242695 /Zotlabs/Lib/LDSignatures.php
parentf94b046333c57acde493ee5dc2511acc6baca701 (diff)
parent89415e17313578eb115c441480b6e0ddfa90afef (diff)
downloadvolse-hubzilla-5.4.tar.gz
volse-hubzilla-5.4.tar.bz2
volse-hubzilla-5.4.zip
Merge branch '5.4RC'5.4
Diffstat (limited to 'Zotlabs/Lib/LDSignatures.php')
-rw-r--r--Zotlabs/Lib/LDSignatures.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php
index 2eba66ccf..1c2095f10 100644
--- a/Zotlabs/Lib/LDSignatures.php
+++ b/Zotlabs/Lib/LDSignatures.php
@@ -12,7 +12,7 @@ class LDSignatures {
$ohash = self::hash(self::signable_options($data['signature']));
$dhash = self::hash(self::signable_data($data));
- $x = rsa_verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey);
+ $x = Crypto::verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey);
logger('LD-verify: ' . intval($x));
return $x;
@@ -35,11 +35,11 @@ class LDSignatures {
$ohash = self::hash(self::signable_options($options));
$dhash = self::hash(self::signable_data($data));
- $options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey']));
+ $options['signatureValue'] = base64_encode(Crypto::sign($ohash . $dhash,$channel['channel_prvkey']));
$signed = array_merge([
- '@context' => [
- ACTIVITYSTREAMS_JSONLD_REV,
+ '@context' => [
+ ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1' ],
],$options);
@@ -88,7 +88,7 @@ class LDSignatures {
return '';
jsonld_set_document_loader('jsonld_document_loader');
-
+
try {
$d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
@@ -117,7 +117,7 @@ class LDSignatures {
$precomputed = '.' . base64url_encode($data_type,false) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng==';
- $signature = base64url_encode(rsa_sign($data . $precomputed,$channel['channel_prvkey']));
+ $signature = base64url_encode(Crypto::sign($data . $precomputed,$channel['channel_prvkey']));
return ([
'id' => $arr['id'],