Encryption

- Removed unneeded encryption code.
- Configured Encryption settings for CI4
This commit is contained in:
objecttothis
2023-02-24 13:46:23 +04:00
committed by Steve Ireland
parent 7d78eec7de
commit 7738242386
2 changed files with 5 additions and 13 deletions

View File

@@ -71,7 +71,7 @@ class Encryption extends BaseConfig
*
* Set to false for CI3 Encryption compatibility.
*/
public bool $rawData = false;
public bool $rawData = true;
/**
* Encryption key info.
@@ -79,7 +79,7 @@ class Encryption extends BaseConfig
*
* Set to 'encryption' for CI3 Encryption compatibility.
*/
public string $encryptKeyInfo = 'encryption';
public string $encryptKeyInfo = '';
/**
* Authentication key info.
@@ -87,5 +87,5 @@ class Encryption extends BaseConfig
*
* Set to 'authentication' for CI3 Encryption compatibility.
*/
public string $authKeyInfo = 'authentication';
public string $authKeyInfo = '';
}

View File

@@ -54,7 +54,7 @@ class Config extends Secure_Controller
$this->sale_lib = new Sale_lib();
$this->receiving_lib = new receiving_lib();
$this->tax_lib = new Tax_lib();
$this->attribute = model('Attribute');
$this->customer_rewards = model('Customer_rewards');
$this->dinner_table = model('Dinner_table');
@@ -279,15 +279,7 @@ class Config extends Secure_Controller
if($this->_check_encryption()) //TODO: Hungarian notation
{
$config = new Encryption();
$config->driver = 'OpenSSL';
$config->key = config('Encryption')->key;
$config->cipher = 'AES-128-CBC';
$config->rawData = false;
$config->encryptKeyInfo = 'encryption';
$config->authKeyInfo = 'authentication';
$encrypter = Services::encrypter($config, false);
$encrypter = Services::encrypter();
$data['mailchimp']['api_key'] = $encrypter->decrypt($this->config['mailchimp_api_key'] ?? '');
$data['mailchimp']['list_id'] = $encrypter->decrypt($this->config['mailchimp_list_id'] ?? '');