Commit 7a38947d54fe9264b5f5439a6d63342d00ccaae5
Handle more properties
cel committed on 2/13/2017, 8:33:57 PMParent: a100842ae7168fc307d583acfbd778198201a430
Files changed
lib/decode.js | changed |
lib/encode.js | changed |
test/networks.json | changed |
test/networks.txt | changed |
lib/decode.js | ||
---|---|---|
@@ -4,9 +4,8 @@ | ||
4 | 4 … | key_mgmt: decodeSet, |
5 | 5 … | proto: decodeSet, |
6 | 6 … | eap: decodeSet, |
7 | 7 … | ctrl_interface: decodeObj, |
8 | - phase2: decodeObj, | |
9 | 8 … | driver_param: decodeObj, |
10 | 9 … | } |
11 | 10 … | |
12 | 11 … | function defaultDecodeValue(value) { |
lib/encode.js | ||
---|---|---|
@@ -10,10 +10,19 @@ | ||
10 | 10 … | |
11 | 11 … | var encodeValueFns = { |
12 | 12 … | anonymous_identity: encodeQuotedString, |
13 | 13 … | ca_cert: encodeQuotedString, |
14 … | + domain: encodeQuotedString, | |
14 | 15 … | client_cert: encodeQuotedString, |
15 | 16 … | 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, | |
16 | 25 … | engine_id: encodeQuotedString, |
17 | 26 … | identity: encodeQuotedString, |
18 | 27 … | key_id: encodeQuotedString, |
19 | 28 … | password: encodeQuotedString, |
@@ -21,8 +30,10 @@ | ||
21 | 30 … | pin: encodeQuotedString, |
22 | 31 … | private_key: encodeQuotedString, |
23 | 32 … | private_key_passwd: encodeQuotedString, |
24 | 33 … | ssid: encodeQuotedString, |
34 … | + phase1: encodeQuotedString, | |
35 … | + phase2: encodeQuotedString, | |
25 | 36 … | psk: function (value) { |
26 | 37 … | if (/[0-9a-f]{40}/i.test(value)) return value |
27 | 38 … | else return encodeQuotedString(value) |
28 | 39 … | }, |
@@ -70,9 +81,9 @@ | ||
70 | 81 … | function encodeNetwork(network) { |
71 | 82 … | if (!network) return |
72 | 83 … | var lines = [] |
73 | 84 … | if (network._comment) { |
74 | - lines.push('#' + network._comment) | |
85 … | + lines.push('#' + network._comment.replace(/\n/g, '\n#')) | |
75 | 86 … | } |
76 | 87 … | lines.push('network={') |
77 | 88 … | for (var k in network) { |
78 | 89 … | if (k !== '_comment') |
test/networks.json | ||
---|---|---|
@@ -21,7 +21,19 @@ | ||
21 | 21 … | "ca_cert": "/etc/cert/ca.pem", |
22 | 22 … | "client_cert": "/etc/cert/user.pem", |
23 | 23 … | "private_key": "/etc/cert/user.prv", |
24 | 24 … | "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" | |
25 | 37 … | } |
26 | 38 … | ] |
27 | 39 … | } |
test/networks.txt | ||
---|---|---|
@@ -22,4 +22,19 @@ | ||
22 | 22 … | client_cert="/etc/cert/user.pem" |
23 | 23 … | private_key="/etc/cert/user.prv" |
24 | 24 … | private_key_passwd="password" |
25 | 25 … | } |
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