mirror of
https://github.com/unraid/webgui.git
synced 2026-03-02 22:30:07 -06:00
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:
28
emhttp/plugins/dynamix/scripts/open_ssl
Normal file
28
emhttp/plugins/dynamix/scripts/open_ssl
Normal 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;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user