aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-01 06:29:29 -0700
committerFriendika <info@friendika.com>2011-09-01 06:29:29 -0700
commit1621630b064474eb385bfa05d248fec712645814 (patch)
tree95a951e5e3c380abd50c7f78821bf1a32bc30e00 /include/crypto.php
parent0cfc8570d20ef4935e846f0f143aef181b9c951f (diff)
downloadvolse-hubzilla-1621630b064474eb385bfa05d248fec712645814.tar.gz
volse-hubzilla-1621630b064474eb385bfa05d248fec712645814.tar.bz2
volse-hubzilla-1621630b064474eb385bfa05d248fec712645814.zip
login_hook
Diffstat (limited to 'include/crypto.php')
-rw-r--r--include/crypto.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/crypto.php b/include/crypto.php
index 88e05b9eb..0feb45c24 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -262,24 +262,27 @@ function aes_unencapsulate($data,$prvkey) {
}
-function zot_encapsulate($data,$sender,$pubkey) {
+// This has been superceded.
+
+function zot_encapsulate($data,$envelope,$pubkey) {
$res = aes_encapsulate($data,$pubkey);
-openssl_public_encrypt($sender,$s,$pubkey);
-$s1 = base64url_encode($s,true);
return <<< EOT
<?xml version='1.0' encoding='UTF-8'?>
-<zot:env xmlns:zot='http://purl.org/zot/1.0'>
+<zot:msg xmlns:zot='http://purl.org/zot/1.0'>
<zot:key>{$res['key']}</zot:key>
<zot:iv>{$res['iv']}</zot:iv>
- <zot:sender>$s1</zot:sender>
+ <zot:env>$s1</zot:env>
+ <zot:sig key_id="$keyid">$sig</zot:sig>
<zot:alg>AES-256-CBC</zot:alg>
<zot:data type='application/magic-envelope+xml'>{$res['data']}</zot:data>
-</zot:env>
+</zot:msg>
EOT;
}
+// so has this
+
function zot_unencapsulate($data,$prvkey) {
$ret = array();
$c = array();