git ssb

1+

cel / wpa-conf-codec



Commit 7a38947d54fe9264b5f5439a6d63342d00ccaae5

Handle more properties

cel committed on 2/13/2017, 8:33:57 PM
Parent: a100842ae7168fc307d583acfbd778198201a430

Files changed

lib/decode.jschanged
lib/encode.jschanged
test/networks.jsonchanged
test/networks.txtchanged
lib/decode.jsView
@@ -4,9 +4,8 @@
44 key_mgmt: decodeSet,
55 proto: decodeSet,
66 eap: decodeSet,
77 ctrl_interface: decodeObj,
8- phase2: decodeObj,
98 driver_param: decodeObj,
109 }
1110
1211 function defaultDecodeValue(value) {
lib/encode.jsView
@@ -10,10 +10,19 @@
1010
1111 var encodeValueFns = {
1212 anonymous_identity: encodeQuotedString,
1313 ca_cert: encodeQuotedString,
14 + domain: encodeQuotedString,
1415 client_cert: encodeQuotedString,
1516 domain_suffix_match: encodeQuotedString,
17 + excluded_ssid: encodeQuotedString,
18 + imsi: encodeQuotedString,
19 + milenage: encodeQuotedString,
20 + provisioning_sp: encodeQuotedString,
21 + realm: encodeQuotedString,
22 + roaming_consortium: encodeQuotedString,
23 + roaming_partner: encodeQuotedString,
24 + username: encodeQuotedString,
1625 engine_id: encodeQuotedString,
1726 identity: encodeQuotedString,
1827 key_id: encodeQuotedString,
1928 password: encodeQuotedString,
@@ -21,8 +30,10 @@
2130 pin: encodeQuotedString,
2231 private_key: encodeQuotedString,
2332 private_key_passwd: encodeQuotedString,
2433 ssid: encodeQuotedString,
34 + phase1: encodeQuotedString,
35 + phase2: encodeQuotedString,
2536 psk: function (value) {
2637 if (/[0-9a-f]{40}/i.test(value)) return value
2738 else return encodeQuotedString(value)
2839 },
@@ -70,9 +81,9 @@
7081 function encodeNetwork(network) {
7182 if (!network) return
7283 var lines = []
7384 if (network._comment) {
74- lines.push('#' + network._comment)
85 + lines.push('#' + network._comment.replace(/\n/g, '\n#'))
7586 }
7687 lines.push('network={')
7788 for (var k in network) {
7889 if (k !== '_comment')
test/networks.jsonView
@@ -21,7 +21,19 @@
2121 "ca_cert": "/etc/cert/ca.pem",
2222 "client_cert": "/etc/cert/user.pem",
2323 "private_key": "/etc/cert/user.prv",
2424 "private_key_passwd": "password"
25 + },
26 + {
27 + "_comment": " 2. WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old\n peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink\n RAD-Series)",
28 + "ssid": "example",
29 + "scan_ssid": 1,
30 + "key_mgmt": ["WPA-EAP"],
31 + "eap": ["PEAP"],
32 + "identity": "user@example.com",
33 + "password": "foobar",
34 + "ca_cert": "/etc/cert/ca.pem",
35 + "phase1": "peaplabel=0",
36 + "phase2": "auth=MSCHAPV2"
2537 }
2638 ]
2739 }
test/networks.txtView
@@ -22,4 +22,19 @@
2222 client_cert="/etc/cert/user.pem"
2323 private_key="/etc/cert/user.prv"
2424 private_key_passwd="password"
2525 }
26 +
27 +# 2. WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old
28 +# peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink
29 +# RAD-Series)
30 +network={
31 + ssid="example"
32 + scan_ssid=1
33 + key_mgmt=WPA-EAP
34 + eap=PEAP
35 + identity="user@example.com"
36 + password="foobar"
37 + ca_cert="/etc/cert/ca.pem"
38 + phase1="peaplabel=0"
39 + phase2="auth=MSCHAPV2"
40 +}

Built with git-ssb-web