diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-05 09:09:34 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-05 09:09:34 +0200 |
commit | 0283cbfcd35a29b5689ffbf16439d448de0c7254 (patch) | |
tree | 9fa9aa4b7fb3454ab60d63ad584aafaf20850999 /include/crypto.php | |
parent | 058e329dfbc2678fa7e3cb2ce130fb9ffd69b84d (diff) | |
parent | 7e8100d2cd27227435ba6ff421dd3c3d8689930f (diff) | |
download | volse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.tar.gz volse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.tar.bz2 volse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.zip |
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/crypto.php')
-rw-r--r-- | include/crypto.php | 15 |
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(); |