aboutsummaryrefslogtreecommitdiffstats
path: root/include/message.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-20 15:20:12 -0800
committerfriendica <info@friendica.com>2013-11-20 15:20:12 -0800
commitd7ee552c570f4fca760c3d1573f32c005cf73bb8 (patch)
treea5020a1a27472fe889d773a5e4e2b410930ceda7 /include/message.php
parentf6c41e61ace7260dde49125487f9ec7142f48e4f (diff)
downloadvolse-hubzilla-d7ee552c570f4fca760c3d1573f32c005cf73bb8.tar.gz
volse-hubzilla-d7ee552c570f4fca760c3d1573f32c005cf73bb8.tar.bz2
volse-hubzilla-d7ee552c570f4fca760c3d1573f32c005cf73bb8.zip
Protocol: now set data['alg'] on all encapsulated encrypted packets, so that we can more easily retire 'aes256cbc' once it is no longer viable.
Diffstat (limited to 'include/message.php')
-rw-r--r--include/message.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/message.php b/include/message.php
index 2fca9bef0..a95021583 100644
--- a/include/message.php
+++ b/include/message.php
@@ -109,9 +109,9 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto='
$key = get_config('system','pubkey');
if($subject)
- $subject = json_encode(aes_encapsulate($subject,$key));
+ $subject = json_encode(crypto_encapsulate($subject,$key));
if($body)
- $body = json_encode(aes_encapsulate($body,$key));
+ $body = json_encode(crypto_encapsulate($body,$key));
@@ -231,9 +231,9 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
$key = get_config('system','prvkey');
if($r[$k]['title'])
- $r[$k]['title'] = aes_unencapsulate(json_decode_plus($r[$k]['title']),$key);
+ $r[$k]['title'] = crypto_unencapsulate(json_decode_plus($r[$k]['title']),$key);
if($r[$k]['body'])
- $r[$k]['body'] = aes_unencapsulate(json_decode_plus($r[$k]['body']),$key);
+ $r[$k]['body'] = crypto_unencapsulate(json_decode_plus($r[$k]['body']),$key);
}
}
@@ -270,9 +270,9 @@ function private_messages_fetch_message($channel_id, $messageitem_id, $updatesee
if($messages[$k]['mail_flags'] & MAIL_OBSCURED) {
$key = get_config('system','prvkey');
if($messages[$k]['title'])
- $messages[$k]['title'] = aes_unencapsulate(json_decode_plus($messages[$k]['title']),$key);
+ $messages[$k]['title'] = crypto_unencapsulate(json_decode_plus($messages[$k]['title']),$key);
if($messages[$k]['body'])
- $messages[$k]['body'] = aes_unencapsulate(json_decode_plus($messages[$k]['body']),$key);
+ $messages[$k]['body'] = crypto_unencapsulate(json_decode_plus($messages[$k]['body']),$key);
}
}
@@ -358,9 +358,9 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda
if($messages[$k]['mail_flags'] & MAIL_OBSCURED) {
$key = get_config('system','prvkey');
if($messages[$k]['title'])
- $messages[$k]['title'] = aes_unencapsulate(json_decode_plus($messages[$k]['title']),$key);
+ $messages[$k]['title'] = crypto_unencapsulate(json_decode_plus($messages[$k]['title']),$key);
if($messages[$k]['body'])
- $messages[$k]['body'] = aes_unencapsulate(json_decode_plus($messages[$k]['body']),$key);
+ $messages[$k]['body'] = crypto_unencapsulate(json_decode_plus($messages[$k]['body']),$key);
}
}