Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
'webui-info' => "$docroot/state/plugins/dynamix.docker.manager/docker.json"
];

// get network drivers
$driver = DockerUtil::driver();

// Docker configuration file - guaranteed to exist
$docker_cfgfile = '/boot/config/docker.cfg';
if (file_exists($docker_cfgfile)) {
Expand Down Expand Up @@ -292,10 +295,9 @@ private function getTailscaleJson($name) {
}

public function getAllInfo($reload=false,$com=true,$communityApplications=false) {
global $dockerManPaths;
global $driver, $dockerManPaths;
$DockerClient = new DockerClient();
$DockerUpdate = new DockerUpdate();
$driver = DockerUtil::driver();
$host = DockerUtil::host();
//$DockerUpdate->verbose = $this->verbose;
$info = DockerUtil::loadJSON($dockerManPaths['webui-info']);
Expand Down Expand Up @@ -948,7 +950,7 @@ public function removeImage($id) {
}

public function getDockerContainers() {
$driver = DockerUtil::driver();
global $driver;
$host = DockerUtil::host();
// Return cached values
if (is_array($this::$containersCache)) return $this::$containersCache;
Expand Down
3 changes: 3 additions & 0 deletions emhttp/plugins/dynamix/nchan/wlan0
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ $_SERVER['REQUEST_URI'] = '';
$login_locale = _var($display,'locale');
require_once "$docroot/webGui/include/Translations.php";

// remember current language
$locale_init = $locale;

function update_translation($locale) {
global $docroot,$language;
$language = [];
Expand Down
4 changes: 2 additions & 2 deletions etc/rc.d/rc.wireless
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ unzero6(){
# function to initialize openSSL variables
ssl_init(){
KEY="$(dmidecode -qt1 | grep -Pom1 'Manufacturer: \K.+' | sed 's/ /_/g')ABCDEFGH"
IV="$(dmidecode -qt1 | grep -Pom1 'Product Name: \K.+' | sed 's/ /_/g')1234567890123456"
IV="12$(cat $SYSTEM/$PORT/address | sed 's/://g')34"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security concern: IV generation method may weaken encryption.

The current IV generation method using MAC address with fixed prefix/suffix ("12" and "34") has several security implications:

  1. MAC addresses are publicly visible and can be spoofed
  2. Fixed prefix/suffix reduces entropy
  3. Predictable IVs can weaken the encryption of sensitive data (USERNAME and PASSWORD)

Consider using a cryptographically secure random number generator instead:

-  IV="12$(cat $SYSTEM/$PORT/address | sed 's/://g')34"
+  IV="$(openssl rand -hex 16)"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
IV="12$(cat $SYSTEM/$PORT/address | sed 's/://g')34"
IV="$(openssl rand -hex 16)"

echo "cipher=aes-256-cbc" >$SSLINPUT
echo "key=${KEY:0:63}" >>$SSLINPUT
echo "iv=${IV:0:16}" >>$SSLINPUT
echo "iv=$IV" >>$SSLINPUT
}

# function to convert text to hex
Expand Down