Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] Removing MCrypt class #38527

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
190 changes: 0 additions & 190 deletions libraries/src/Encrypt/AES/Mcrypt.php

This file was deleted.

28 changes: 5 additions & 23 deletions libraries/src/Encrypt/Aes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
namespace Joomla\CMS\Encrypt;

use Joomla\CMS\Encrypt\AES\AesInterface;
use Joomla\CMS\Encrypt\AES\Mcrypt;
use Joomla\CMS\Encrypt\AES\OpenSSL;

/**
* A simple implementation of AES-128, AES-192 and AES-256 encryption using the
* high performance mcrypt library.
* A simple implementation of AES-128, AES-192 and AES-256 encryption using
* OpenSSL.
*
* @since 1.0
*/
Expand Down Expand Up @@ -47,24 +46,11 @@ class Aes
* @param string $mode Encryption mode. Can be ebc or cbc. We recommend using cbc.
* @param string $priority Priority which adapter we should try first
*
* @deprecated 5.0 $strength will be removed
* @deprecated 5.0 $strength will be removed, $priority will be removed
*/
public function __construct($key, $strength = 128, $mode = 'cbc', $priority = 'openssl')
{
if ($priority === 'openssl') {
$this->adapter = new OpenSSL();

if (!$this->adapter->isSupported()) {
$this->adapter = new Mcrypt();
}
} else {
$this->adapter = new Mcrypt();

if (!$this->adapter->isSupported()) {
$this->adapter = new OpenSSL();
}
}

$this->adapter = new OpenSSL();
$this->adapter->setEncryptionMode($mode, $strength);
$this->setPassword($key, true);
}
Expand Down Expand Up @@ -164,11 +150,7 @@ public static function isSupported()
$adapter = new OpenSSL();

if (!$adapter->isSupported()) {
$adapter = new Mcrypt();

if (!$adapter->isSupported()) {
return false;
}
return false;
}

if (!\function_exists('base64_encode')) {
Expand Down