3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

tools/ios_convert: add ServerDomainMask

Parses mobileconfig TLSTrustedServerNames
This commit is contained in:
James Prestwood 2019-08-26 16:34:20 -07:00 committed by Denis Kenzior
parent 96ce39c1c2
commit de2c808970

View File

@ -18,6 +18,7 @@ class Network:
self.password = None self.password = None
self.ssid = None self.ssid = None
self.display_name = None self.display_name = None
self.tls_trusted_servers = []
def process_eap_config(eap_conf, network): def process_eap_config(eap_conf, network):
for m in range(len(eap_conf)): for m in range(len(eap_conf)):
@ -34,6 +35,10 @@ def process_eap_config(eap_conf, network):
network.username = eap_conf[m + 1].text network.username = eap_conf[m + 1].text
elif eap_conf[m].text == "UserPassword" and args.passwd: elif eap_conf[m].text == "UserPassword" and args.passwd:
network.password = eap_conf[m + 1].text network.password = eap_conf[m + 1].text
elif eap_conf[m].text == "TLSTrustedServerNames":
tarray = eap_conf[m + 1]
for i in range(len(tarray)):
network.tls_trusted_servers.append(tarray[i].text)
def process_payload_array(parray): def process_payload_array(parray):
network = Network() network = Network()
@ -122,6 +127,11 @@ def write_network(network, root_ca_path):
output += "EAP-%s-Phase2-Password=%s\n" % \ output += "EAP-%s-Phase2-Password=%s\n" % \
(eap, network.password) (eap, network.password)
if len(network.tls_trusted_servers) > 0:
output += "EAP-%s-ServerDomainMask=" % eap
output += ';'.join(network.tls_trusted_servers)
output += '\n'
if network.display_name: if network.display_name:
name = network.display_name name = network.display_name
elif network.ssid: elif network.ssid: