Merge branch 'MDL-73517_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE

This commit is contained in:
Víctor Déniz
2022-02-03 22:03:51 +00:00
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ function mnet_encrypt_message($message, $remote_certificate) {
$symmetric_keys = array();
// passed by ref -> &$encryptedstring &$symmetric_keys
$bool = openssl_seal($message, $encryptedstring, $symmetric_keys, array($publickey));
$bool = openssl_seal($message, $encryptedstring, $symmetric_keys, array($publickey), 'RC4');
$message = $encryptedstring;
$symmetrickey = array_pop($symmetric_keys);
+3 -2
View File
@@ -201,7 +201,8 @@ class mnet_xmlrpc_client {
$decryptedenvelope = '';
// &$decryptedenvelope
$isOpen = openssl_open(base64_decode($data), $decryptedenvelope, base64_decode($key), $this->mnet->get_private_key());
$isOpen = openssl_open(base64_decode($data), $decryptedenvelope, base64_decode($key),
$this->mnet->get_private_key(), 'RC4');
if (!$isOpen) {
// Decryption failed... let's try our archived keys
@@ -214,7 +215,7 @@ class mnet_xmlrpc_client {
}
foreach($openssl_history as $keyset) {
$keyresource = openssl_pkey_get_private($keyset['keypair_PEM']);
$isOpen = openssl_open(base64_decode($data), $decryptedenvelope, base64_decode($key), $keyresource);
$isOpen = openssl_open(base64_decode($data), $decryptedenvelope, base64_decode($key), $keyresource, 'RC4');
if ($isOpen) {
// It's an older code, sir, but it checks out
break;
+2 -2
View File
@@ -59,7 +59,7 @@ function mnet_server_strip_encryption($rawpostdata) {
$payload = ''; // Initialize payload var
// &$payload
$isOpen = openssl_open(base64_decode($data), $payload, base64_decode($key), $mnet->get_private_key());
$isOpen = openssl_open(base64_decode($data), $payload, base64_decode($key), $mnet->get_private_key(), 'RC4');
if ($isOpen) {
$remoteclient->was_encrypted();
return $payload;
@@ -75,7 +75,7 @@ function mnet_server_strip_encryption($rawpostdata) {
}
foreach($openssl_history as $keyset) {
$keyresource = openssl_pkey_get_private($keyset['keypair_PEM']);
$isOpen = openssl_open(base64_decode($data), $payload, base64_decode($key), $keyresource);
$isOpen = openssl_open(base64_decode($data), $payload, base64_decode($key), $keyresource, 'RC4');
if ($isOpen) {
// It's an older code, sir, but it checks out
$remoteclient->was_encrypted();