aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-09 13:50:03 +0000
committerMario <mario@mariovavti.com>2021-02-09 13:50:03 +0000
commitb4693870ba647455e6bd0a3919a544130cee118b (patch)
tree97fe6de09c5ce3b5e6ed247c6a6105008631e79a /include/crypto.php
parent5aee2f172ecdf58e13dd328c787fd199c48d24c5 (diff)
downloadvolse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.tar.gz
volse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.tar.bz2
volse-hubzilla-b4693870ba647455e6bd0a3919a544130cee118b.zip
port Lib/Crypto from zap
Diffstat (limited to 'include/crypto.php')
-rw-r--r--include/crypto.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/crypto.php b/include/crypto.php
index 84d639f3f..d91d3749c 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -1,5 +1,7 @@
<?php /** @file */
+use Zotlabs\Lib\Crypto;
+
require_once('library/ASNValue.class.php');
require_once('library/asn1.php');
@@ -192,7 +194,6 @@ function crypto_methods() {
function signing_methods() {
-
$r = [ 'sha256' ];
call_hooks('signing_methods',$r);
return $r;
@@ -461,12 +462,12 @@ function convert_salmon_key($key) {
function z_obscure($s) {
- return json_encode(crypto_encapsulate($s,get_config('system','pubkey')));
+ return json_encode(Crypto::encapsulate($s,get_config('system','pubkey')));
}
function z_unobscure($s) {
if(strpos($s,"{\"") !== 0)
return $s;
- return crypto_unencapsulate(json_decode($s,true),get_config('system','prvkey'));
+ return Crypto::unencapsulate(json_decode($s,true),get_config('system','prvkey'));
}