$idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
- if($contact['duplex'] && $contact['dfrn-id'])
+ if ($contact['duplex'] && $contact['dfrn-id']) {
$idtosend = '0:' . $orig_id;
- if($contact['duplex'] && $contact['issued-id'])
+ }
+ if ($contact['duplex'] && $contact['issued-id']) {
$idtosend = '1:' . $orig_id;
+ }
-
- $rino = get_config('system','rino_encrypt');
+ $rino = get_config('system', 'rino_encrypt');
$rino = intval($rino);
- // use RINO1 if mcrypt isn't installed and RINO2 was selected
- if ($rino == 2 and !function_exists('mcrypt_create_iv')) {
- $rino = 1;
- }
-
logger("Local rino version: ". $rino, LOGGER_DEBUG);
$ssl_val = intval(get_config('system','ssl_policy'));
$postvars['ssl_policy'] = $ssl_policy;
- if($page)
+ if ($page) {
$postvars['page'] = $page;
+ }
- if($rino>0 && $rino_remote_version>0 && (! $dissolve)) {
+ if ($rino > 0 && $rino_remote_version > 0 && (! $dissolve)) {
logger('rino version: '. $rino_remote_version);
- switch($rino_remote_version) {
+ switch ($rino_remote_version) {
case 1:
// Deprecated rino version!
- $key = substr(random_string(), 0, 16);
- $data = aes_encrypt($postvars['data'],$key);
+ $key = openssl_random_pseudo_bytes(16);
+ $data = self::aes_encrypt($postvars['data'], $key);
break;
case 2:
// RINO 2 based on php-encryption
}
-
- // If we are setup as a soapbox we aren't accepting input from this person
- // This behaviour is deactivated since it really doesn't make sense to even disallow comments
- // The check if someone is a friend or simply a follower is done in a later place so it needn't to be done here
- //if($importer['page-flags'] == PAGE_SOAPBOX)
- // xml_status(0);
-
- $rino = get_config('system','rino_encrypt');
+ $rino = get_config('system', 'rino_encrypt');
$rino = intval($rino);
- // use RINO1 if mcrypt isn't installed and RINO2 was selected
- if ($rino == 2 && !function_exists('mcrypt_create_iv')) {
- $rino = 1;
- }
- logger("Local rino version: ". $rino, LOGGER_DEBUG);
+ logger("Local rino version: " . $rino, LOGGER_DEBUG);
- if(strlen($key)) {
+ if (strlen($key)) {
// if local rino is lower than remote rino, abort: should not happen!
// but only for $remote_rino > 1, because old code did't send rino version
switch($rino_remote) {
case 0:
case 1:
- // we got a key. old code send only the key, without RINO version.
- // we assume RINO 1 if key and no RINO version
- $data = dfrn::aes_decrypt(hex2bin($data),$final_key);
+ /*
- * we got a key. old code send only the key, without RINO version.
++ *we got a key. old code send only the key, without RINO version.
+ * we assume RINO 1 if key and no RINO version
+ */
- $data = aes_decrypt(hex2bin($data), $final_key);
++ $data = dfrn::aes_decrypt(hex2bin($data), $final_key);
break;
case 2:
try {
$encrypted_id = bin2hex($encrypted_id);
- $rino = get_config('system','rino_encrypt');
+ $rino = get_config('system', 'rino_encrypt');
$rino = intval($rino);
- // use RINO1 if mcrypt isn't installed and RINO2 was selected
- if ($rino == 2 && !function_exists('mcrypt_create_iv')) {
- $rino = 1;
- }
logger("Local rino version: ". $rino, LOGGER_DEBUG);