From 7d83a19fd49ed53f6c08816a7b7dc4b247a3e7ba Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Tue, 23 Jun 2015 11:05:03 +0200 Subject: [PATCH] Disable RINO Comment out functions for RINO crypt and disable RINO request and response. --- include/crypto.php | 4 ++-- include/items.php | 8 +++++++- mod/dfrn_notify.php | 10 +++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/crypto.php b/include/crypto.php index f987695b65..87744d2d6a 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -185,7 +185,7 @@ function salmon_key($pubkey) { } - +/** disable rino if(! function_exists('aes_decrypt')) { function aes_decrypt($val,$ky) { @@ -210,7 +210,7 @@ function aes_encrypt($val,$ky) $val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16))); return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM)); }} - +**/ function pkcs5_pad ($text, $blocksize) { diff --git a/include/items.php b/include/items.php index 7a30130bbc..b390a168b7 100644 --- a/include/items.php +++ b/include/items.php @@ -1982,13 +1982,17 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { if($contact['duplex'] && $contact['issued-id']) $idtosend = '1:' . $orig_id; + /** + * disable rino. $rino = ((function_exists('mcrypt_encrypt')) ? 1 : 0); $rino_enable = get_config('system','rino_encrypt'); if(! $rino_enable) $rino = 0; - + **/ + $rino = 0; $rino_enable = 0; + $ssl_val = intval(get_config('system','ssl_policy')); $ssl_policy = ''; @@ -2097,6 +2101,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { if($page) $postvars['page'] = $page; + /** disable rino if($rino && $rino_allowed && (! $dissolve)) { $key = substr(random_string(),0,16); $data = bin2hex(aes_encrypt($postvars['data'],$key)); @@ -2128,6 +2133,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $postvars['key'] = bin2hex($postvars['key']); } + **/ logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true), LOGGER_DATA); diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 43414dc87c..04b4b8ca66 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -130,7 +130,7 @@ function dfrn_notify_post(&$a) { if($importer['page-flags'] == PAGE_SOAPBOX) xml_status(0); - + /** disable rino if(strlen($key)) { $rawkey = hex2bin(trim($key)); logger('rino: md5 raw key: ' . md5($rawkey)); @@ -157,7 +157,7 @@ function dfrn_notify_post(&$a) { $data = aes_decrypt(hex2bin($data),$final_key); logger('rino: decrypted data: ' . $data, LOGGER_DATA); } - + **/ $ret = local_delivery($importer,$data); xml_status($ret); @@ -253,13 +253,17 @@ function dfrn_notify_content(&$a) { $challenge = bin2hex($challenge); $encrypted_id = bin2hex($encrypted_id); + /** + * disable rino. $rino = ((function_exists('mcrypt_encrypt')) ? 1 : 0); $rino_enable = get_config('system','rino_encrypt'); if(! $rino_enable) $rino = 0; - + **/ + $rino = 0; $rino_enable = 0; + if((($r[0]['rel']) && ($r[0]['rel'] != CONTACT_IS_SHARING)) || ($r[0]['page-flags'] == PAGE_COMMUNITY)) { $perm = 'rw'; }