From cf69edb57d236a06b3dd147c7df34dd8be2f7e6c Mon Sep 17 00:00:00 2001 From: dlandon Date: Fri, 5 Apr 2024 08:16:03 -0500 Subject: [PATCH] Key generation fails on first run. --- emhttp/plugins/dynamix/scripts/outgoingproxy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emhttp/plugins/dynamix/scripts/outgoingproxy.sh b/emhttp/plugins/dynamix/scripts/outgoingproxy.sh index f2012ca7b..466d379cf 100644 --- a/emhttp/plugins/dynamix/scripts/outgoingproxy.sh +++ b/emhttp/plugins/dynamix/scripts/outgoingproxy.sh @@ -20,6 +20,16 @@ function apply() { /* Process the new configuration. */ $cfg = parse_plugin_config(); + /* Generate encryption keys if they have not been generated. */ + if ((! isset($cfg['key'])) || (! isset($cfg['iv']))) { + /* Doing an encryption will generate keys. */ + encrypt_data("test"); + + /* Get new keys. */ + $cfg['key'] = get_config("key"); + $cfg['iv'] = get_config("iv"); + } + for ($i = 1; $i <= 3; $i++) { $proxy_name = "proxy_name_".$i; $name = trim($cfg[$proxy_name]);