Developing lightweight computation at the DSG edge

Commit c64ec5af authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system] Add WPA3/SAE options for 802.11s mesh networks



This commit allows setting a common network key for 802.11s mesh
networks, using the wpad-mesh-openssl packages, as it is being done
elsewhere (e.g., Freifunk). By default, the network is kept open.
Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parent a5b598a7
......@@ -51,8 +51,9 @@ define Package/qmp-system
SECTION:=net
CATEGORY:=qMp
URL:=https://qmp.cat
DEPENDS:=+libuci-lua +lua +libiwinfo-lua +kmod-ipt-nat +luci-base\
+bmx6 +bmx6-uci-config +bmx6-json +gwck-qmp +ip +iw +iwinfo +bmx6-sms
DEPENDS:=+libuci-lua +lua +libiwinfo-lua +kmod-ipt-nat +luci-base \
+bmx6 +bmx6-uci-config +bmx6-json +gwck-qmp +ip +iw +iwinfo +bmx6-sms \
+wpad-mesh-openssl
endef
define Package/qmp-system/description
......
......@@ -255,6 +255,7 @@ qmp_configure_wifi_device() {
local name="$(qmp_uci_get @wireless[$id].name)"
local essidap="$(qmp_uci_get @wireless[$id].essidap)"
local mesh80211s="$(qmp_uci_get @wireless[$id].mesh80211s)"
local meshkey="$(qmp_uci_get @wireless[$id].meshkey)"
local driver="$(qmp_uci_get wireless.driver)"
local country="$(qmp_uci_get wireless.country)"
local mrate="$(qmp_uci_get wireless.mrate)"
......@@ -263,6 +264,7 @@ qmp_configure_wifi_device() {
local network="$(qmp_get_virtual_iface $device)"
local key="$(qmp_uci_get @wireless[$id].key)"
[ $(echo "$key" | wc -c) -lt 8 ] && encrypt="none" || encrypt="psk2"
( [ $(echo "$meshkey" | wc -c) -lt 8 ] || [ $(echo "$meshkey" | wc -c) -gt 63 ] ) && meshcrypt="none" || meshcrypt="sae"
local dev_id="$(echo $device | tr -d [A-z])"
dev_id=${dev_id:-$(date +%S)}
......@@ -279,10 +281,11 @@ qmp_configure_wifi_device() {
echo "AdHoc ESSID $name"
echo "AP ESSID $essidap"
echo "Mesh network" $mesh80211s
echo "Mesh key" $meshkey
echo "HTmode $htmode"
echo "11mode $mode11"
echo "Mrate $mrate"
echo "Disabled $dev_disabled"
echo "Disabled $dev_disabled"
echo "------------------------"
[ -z $essidap ] && essidap=$(echo ${name:0:29})"-AP"
......@@ -336,13 +339,14 @@ qmp_configure_wifi_device() {
-e s/"#QMP_SSID"/"$(echo "${name:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_APSSID"/"$(echo "${essidap:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_MSSID"/"$(echo "${mesh80211s:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_MKEY"/"$(echo "${meshkey:0:63}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_MCRYPT"/"$meshcrypt"/ \
-e s/"#QMP_BSSID"/"$bssid"/ \
-e s/"#QMP_NETWORK"/"$network"/ \
-e s/"#QMP_ENC"/"$encrypt"/ \
-e s/"#QMP_KEY"/"$key"/ \
-e s/"#QMP_MODE"/"$mode"/ > $TMP/qmp_wifi_iface
}
}
# If virtual AP interface has to be configured
vap_template="$TEMPLATE_BASE/iface.ap"
......
......@@ -4,3 +4,5 @@ wireless.#QMP_DEVICE.mesh_id=#QMP_MSSID
wireless.#QMP_DEVICE.network=#QMP_NETWORK
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
wireless.#QMP_DEVICE.mesh_fwding=0
wireless.#QMP_DEVICE.encryption=#QMP_MCRYPT
wireless.#QMP_DEVICE.key=#QMP_MKEY
......@@ -129,13 +129,22 @@ for _,wdev in ipairs(wdevs) do
essid:depends("mode","adhoc_ap")
-- Network name for 80211s
local mesh80211s = s_wireless:option(Value,"mesh80211s","802.11s network",
translate("Name of the 802.11s mesh network. All the nodes must use the same network name."))
local mesh80211s = s_wireless:option(Value,"mesh80211s","802.11s mesh network name",
translate("802.11s mesh network identifier. All the nodes must use the same network name."))
mesh80211s.maxlength = 32
mesh80211s.default = "qMp"
mesh80211s:depends("mode","80211s")
mesh80211s:depends("mode","80211s_aplan")
-- Key for 80211s
local meshkey = s_wireless:option(Value,"meshkey","802.11s mesh network key",
translate("802.11s mesh network WPA3/SAE network key. All the nodes must use the same network key. Leave blank to not use any encryption."))
meshkey.minleght = 8
meshkey.maxlength = 63
meshkey.default = ""
meshkey:depends("mode","80211s")
meshkey:depends("mode","80211s_aplan")
-- Network ESSID for ap or client
local essidap = s_wireless:option(Value,"essidap","AP ESSID",
translate("Name of the WiFi network (ESSID) for access point or client mode."))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment