Wireless support - allow initial plain username and password

When user name and password are stored in plain text, these will be encrypted at start up.
This commit is contained in:
bergware
2025-02-12 03:09:00 +01:00
parent 3d7aa0fb7b
commit b772e017b1
3 changed files with 46 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2025, Lime Technology
* Copyright 2012-2025, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<?
$ssl_input = '/etc/rc.d/rc.ssl.input';
if (is_readable($ssl_input)) extract(parse_ini_file($ssl_input));
switch ($argv[1]) {
case 'encrypt':
if (!empty($argv[2]) && isset($cipher,$key,$iv)) $encrypt = openssl_encrypt($argv[2],$cipher,$key,0,$iv);
if (!empty($encrypt)) echo "$encrypt";
break;
case 'decrypt':
if (!empty($argv[2]) && isset($cipher,$key,$iv)) $decrypt = openssl_decrypt($argv[2],$cipher,$key,0,$iv);
if (!empty($decrypt)) echo "$decrypt";
break;
}
?>