mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Merge pull request #1411 from RaspAP/fix/wpa-passphrase
Correctly handle 64 hex digit passkey
This commit is contained in:
commit
509af62586
@ -77,6 +77,15 @@ function DisplayWPAConfig()
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (strlen($network['passphrase']) == 0 && strlen($network['passkey']) == 64) {
|
||||
$line = "\tpsk=" . $network['passkey'];
|
||||
fwrite($wpa_file, "network={".PHP_EOL);
|
||||
fwrite($wpa_file, "\tssid=\"".$ssid."\"".PHP_EOL);
|
||||
fwrite($wpa_file, $line.PHP_EOL);
|
||||
if (array_key_exists('priority', $network)) {
|
||||
fwrite($wpa_file, "\tpriority=".$network['priority'].PHP_EOL);
|
||||
}
|
||||
fwrite($wpa_file, "}".PHP_EOL);
|
||||
} else {
|
||||
$status->addMessage('WPA passphrase must be between 8 and 63 characters', 'danger');
|
||||
$ok = false;
|
||||
|
@ -27,9 +27,9 @@ function knownWifiStations(&$networks)
|
||||
$network['ssid'] = $ssid;
|
||||
break;
|
||||
case 'psk':
|
||||
if (array_key_exists('passphrase', $network)) {
|
||||
break;
|
||||
}
|
||||
$network['passkey'] = trim($lineArr[1]);
|
||||
$network['protocol'] = 'WPA';
|
||||
break;
|
||||
case '#psk':
|
||||
$network['protocol'] = 'WPA';
|
||||
case 'wep_key0': // Untested
|
||||
|
Loading…
Reference in New Issue
Block a user