it is ... SPACE TIME! ;-)

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-03-30 20:30:23 +02:00
parent e0f4d22049
commit 9c056d0bf0
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
1 changed files with 9 additions and 9 deletions

View File

@ -160,15 +160,15 @@ function dfrn_notify_post(App $a) {
if ($dfrn_version >= 2.1) { if ($dfrn_version >= 2.1) {
if ((($importer['duplex']) && strlen($importer['cprvkey'])) || (! strlen($importer['cpubkey']))) { if ((($importer['duplex']) && strlen($importer['cprvkey'])) || (! strlen($importer['cpubkey']))) {
openssl_private_decrypt($rawkey,$final_key,$importer['cprvkey']); openssl_private_decrypt($rawkey, $final_key, $importer['cprvkey']);
} else { } else {
openssl_public_decrypt($rawkey,$final_key,$importer['cpubkey']); openssl_public_decrypt($rawkey, $final_key, $importer['cpubkey']);
} }
} else { } else {
if ((($importer['duplex']) && strlen($importer['cpubkey'])) || (! strlen($importer['cprvkey']))) { if ((($importer['duplex']) && strlen($importer['cpubkey'])) || (! strlen($importer['cprvkey']))) {
openssl_public_decrypt($rawkey,$final_key,$importer['cpubkey']); openssl_public_decrypt($rawkey, $final_key, $importer['cpubkey']);
} else { } else {
openssl_private_decrypt($rawkey,$final_key,$importer['cprvkey']); openssl_private_decrypt($rawkey, $final_key, $importer['cprvkey']);
} }
} }
@ -181,11 +181,11 @@ function dfrn_notify_post(App $a) {
* 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 * we assume RINO 1 if key and no RINO version
*/ */
$data = aes_decrypt(hex2bin($data),$final_key); $data = aes_decrypt(hex2bin($data), $final_key);
break; break;
case 2: case 2:
try { try {
$data = Crypto::decrypt(hex2bin($data),$final_key); $data = Crypto::decrypt(hex2bin($data), $final_key);
} catch (InvalidCiphertext $ex) { // VERY IMPORTANT } catch (InvalidCiphertext $ex) { // VERY IMPORTANT
/* /*
* Either: * Either:
@ -195,13 +195,13 @@ function dfrn_notify_post(App $a) {
* Assume the worst. * Assume the worst.
*/ */
logger('The ciphertext has been tampered with!'); logger('The ciphertext has been tampered with!');
xml_status(0,'The ciphertext has been tampered with!'); xml_status(0, 'The ciphertext has been tampered with!');
} catch (Ex\CryptoTestFailed $ex) { } catch (Ex\CryptoTestFailed $ex) {
logger('Cannot safely perform dencryption'); logger('Cannot safely perform dencryption');
xml_status(0,'CryptoTestFailed'); xml_status(0, 'CryptoTestFailed');
} catch (Ex\CannotPerformOperation $ex) { } catch (Ex\CannotPerformOperation $ex) {
logger('Cannot safely perform decryption'); logger('Cannot safely perform decryption');
xml_status(0,'Cannot safely perform decryption'); xml_status(0, 'Cannot safely perform decryption');
} }
break; break;
default: default: