From 1d4744000847cbd6421393db980d7905cbda7a41 Mon Sep 17 00:00:00 2001 From: dlandon Date: Fri, 5 Apr 2024 08:15:28 -0500 Subject: [PATCH] Code cleanup. --- .../dynamix/include/OutgoingProxyLib.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/emhttp/plugins/dynamix/include/OutgoingProxyLib.php b/emhttp/plugins/dynamix/include/OutgoingProxyLib.php index fd2a0f51a..c601fdd61 100644 --- a/emhttp/plugins/dynamix/include/OutgoingProxyLib.php +++ b/emhttp/plugins/dynamix/include/OutgoingProxyLib.php @@ -158,21 +158,21 @@ function set_config($variable, $value) { /* Encrypt data. */ function encrypt_data($data) { - $key = get_config("key"); - if ((! $key) || strlen($key) != 32) { - $key = substr(base64_encode(openssl_random_pseudo_bytes(32)), 0, 32); - set_config("key", $key); - } - $iv = get_config("iv"); - if ((! $iv) || strlen($iv) != 16) { - $iv = substr(base64_encode(openssl_random_pseudo_bytes(16)), 0, 16); - set_config("iv", $iv); - } + $key = get_config("key"); + if ((! $key) || strlen($key) != 32) { + $key = substr(base64_encode(openssl_random_pseudo_bytes(32)), 0, 32); + set_config("key", $key); + } + $iv = get_config("iv"); + if ((! $iv) || strlen($iv) != 16) { + $iv = substr(base64_encode(openssl_random_pseudo_bytes(16)), 0, 16); + set_config("iv", $iv); + } - /* Encrypt the data using aes256. */ - $value = trim(openssl_encrypt($data, 'aes256', $key, $options=0, $iv)); + /* Encrypt the data using aes256. */ + $value = trim(openssl_encrypt($data, 'aes256', $key, $options=0, $iv)); - return $value; + return $value; } /* Decrypt data. */