diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 02:16:12 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 02:16:12 -0700 |
commit | 77e2ef45f05b8106ebe5400f8931c6e54ec6341b (patch) | |
tree | b6f0fa5b6a176162bab0a12041c614f4b7d10aa7 /include/diaspora.php | |
parent | c11b1f8b0dc1a1a9788be2d0a2efc16ef13bb849 (diff) | |
download | volse-hubzilla-77e2ef45f05b8106ebe5400f8931c6e54ec6341b.tar.gz volse-hubzilla-77e2ef45f05b8106ebe5400f8931c6e54ec6341b.tar.bz2 volse-hubzilla-77e2ef45f05b8106ebe5400f8931c6e54ec6341b.zip |
mail_obscure - AES-256 is way too slow, simplify. Ideally a substitution cipher would be adequate for our requirements.
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-x | include/diaspora.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index 618c27e1c..1e04b6b44 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1703,11 +1703,10 @@ function diaspora_conversation($importer,$xml,$msg) { continue; } - $key = get_config('system','pubkey'); if($subject) - $subject = json_encode(crypto_encapsulate($subject,$key)); + $subject = base64url_encode($subject); if($body) - $body = json_encode(crypto_encapsulate($body,$key)); + $body = base64url_encode($body); q("insert into mail ( `channel_id`, `convid`, `from_xchan`,`to_xchan`,`title`,`body`,`mail_flags`,`mid`,`parent_mid`,`created`) values ( %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s')", intval($importer['channel_id']), @@ -1837,9 +1836,9 @@ function diaspora_message($importer,$xml,$msg) { $key = get_config('system','pubkey'); if($subject) - $subject = json_encode(crypto_encapsulate($subject,$key)); + $subject = base64url_encode($subject); if($body) - $body = json_encode(crypto_encapsulate($body,$key)); + $body = base64url_encode($body); q("insert into mail ( `channel_id`, `convid`, `from_xchan`,`to_xchan`,`title`,`body`,`mail_flags`,`mid`,`parent_mid`,`created`) values ( %d, %d, '%s', '%s', '%s', '%s', '%d','%s','%s','%s')", intval($importer['channel_id']), @@ -2861,11 +2860,10 @@ function diaspora_send_mail($item,$owner,$contact) { ); if(array_key_exists('mail_flags',$item) && ($item['mail_flags'] & MAIL_OBSCURED)) { - $key = get_config('system','prvkey'); -// if($item['title']) -// $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key); + if($item['title']) + $item['title'] = base64url_decode($item['title']); if($item['body']) - $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key); + $item['body'] = base64url_decode($item['body']); } |