File tree Expand file tree Collapse file tree
backends/openwrt/converters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ def __intermediate_encryption(self, wireless):
103103 'wpa_enterprise_mixed' : 'wpa-mixed' ,
104104 'wpa2_enterprise_mixed' : 'wpa3-mixed' ,
105105 'wps' : 'psk' ,
106+ 'owe' : 'owe' ,
106107 }
107108 # if encryption disabled return empty dict
108109 if not encryption or disabled or encryption ['protocol' ] == 'none' :
@@ -310,6 +311,7 @@ def __netjson_encryption(self, wifi): # noqa: C901
310311 'wpa3' : 'wpa3_enterprise' ,
311312 'wpa-mixed' : 'wpa_enterprise_mixed' ,
312313 'wpa3-mixed' : 'wpa2_enterprise_mixed' ,
314+ 'owe' : 'owe' ,
313315 }
314316 settings ['protocol' ] = protocol_mapping [protocol ]
315317 settings ['cipher' ] = cipher
Original file line number Diff line number Diff line change 358358 "propertyOrder" : 20 ,
359359 "oneOf" : [
360360 {"$ref" : "#/definitions/encryption_none" },
361+ {"$ref" : "#/definitions/encryption_owe" },
361362 {"$ref" : "#/definitions/encryption_wpa3_personal" },
362363 {"$ref" : "#/definitions/encryption_wpa3_enterprise_ap" },
363364 {"$ref" : "#/definitions/encryption_wpa3_personal_mixed" },
379380 "propertyOrder" : 20 ,
380381 "oneOf" : [
381382 {"$ref" : "#/definitions/encryption_none" },
383+ {"$ref" : "#/definitions/encryption_owe" },
382384 {"$ref" : "#/definitions/encryption_wpa3_personal" },
383385 {"$ref" : "#/definitions/encryption_wpa3_enterprise_sta" },
384386 {"$ref" : "#/definitions/encryption_wpa3_personal_mixed" },
501503 }
502504 },
503505 },
506+ "encryption_owe" : {
507+ "title" : "Opportunistic Wireless Encryption" ,
508+ "allOf" : [
509+ {"$ref" : "#/definitions/encryption_mfp_property" },
510+ {
511+ "properties" : {
512+ "protocol" : {
513+ "type" : "string" ,
514+ "title" : "encryption protocol" ,
515+ "propertyOrder" : 1 ,
516+ "enum" : ["owe" ],
517+ "options" : {
518+ "enum_titles" : ["Opportunistic Wireless Encryption" ]
519+ },
520+ }
521+ }
522+ },
523+ ],
524+ },
504525 "encryption_wpa3_personal" : {
505526 "title" : "WPA3 Personal" ,
506527 "allOf" : [
Original file line number Diff line number Diff line change @@ -1292,3 +1292,52 @@ def test_render_ieee80211w(self):
12921292 }
12931293 with self .assertRaises (ValidationError ):
12941294 OpenWrt (_netjson_wpa2_enterprise_mixed_cipher_tkip ).render ()
1295+
1296+ _owe_netjson = {
1297+ "interfaces" : [
1298+ {
1299+ "name" : "wlan0" ,
1300+ "type" : "wireless" ,
1301+ "wireless" : {
1302+ "radio" : "radio0" ,
1303+ "mode" : "access_point" ,
1304+ "ssid" : "owe_ssid" ,
1305+ "encryption" : {
1306+ "protocol" : "owe" ,
1307+ "cipher" : "auto" ,
1308+ "ieee80211w" : "1" ,
1309+ },
1310+ },
1311+ }
1312+ ]
1313+ }
1314+
1315+ _owe_uci = """package network
1316+
1317+ config device 'device_wlan0'
1318+ option name 'wlan0'
1319+
1320+ config interface 'wlan0'
1321+ option device 'wlan0'
1322+ option proto 'none'
1323+
1324+ package wireless
1325+
1326+ config wifi-iface 'wifi_wlan0'
1327+ option device 'radio0'
1328+ option encryption 'owe'
1329+ option ieee80211w '1'
1330+ option ifname 'wlan0'
1331+ option mode 'ap'
1332+ option network 'wlan0'
1333+ option ssid 'owe_ssid'
1334+ """
1335+
1336+ def test_render_owe (self ):
1337+ o = OpenWrt (self ._owe_netjson )
1338+ expected = self ._tabs (self ._owe_uci )
1339+ self .assertEqual (o .render (), expected )
1340+
1341+ def test_parse_owe (self ):
1342+ o = OpenWrt (native = self ._owe_uci )
1343+ self .assertEqual (o .config , self ._owe_netjson )
You can’t perform that action at this time.
0 commit comments