Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seil3/6/8 7.21/5.42/3.21 対応 #45

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div>
<div class="config-area">
<div id="seilconfig" class="config-row">
<div class="model">From: SEIL/X1, X2, B1, x86 Fuji, BPV4 (7.20)</div>
<div class="model">From: SEIL/X1, X2, B1, x86 Fuji, BPV4 (7.21)</div>
<textarea class="config-text" v-model="text" rows="20" cols="64" spellcheck="false"
placeholder="Enter SEIL config here."></textarea>
</div>
Expand All @@ -35,10 +35,10 @@
<div class="config-row">
<div class="model">To:
<select id="model-dst" v-model="selected">
<option value="w2">SA-W2, W2L, W2S (5.41)</option>
<option value="x4" selected>SEIL/X4 (3.20)</option>
<option value="ayame">SEIL/x86 Ayame (3.20)</option>
<option value="ca10">SEIL CA10 (3.20)</option>
<option value="w2">SA-W2, W2L, W2S (5.42)</option>
<option value="x4" selected>SEIL/X4 (3.21)</option>
<option value="ayame">SEIL/x86 Ayame (3.21)</option>
<option value="ca10">SEIL CA10 (3.21)</option>
</select>
</div>
<textarea id="recipeconfig" class="config-text" v-model="text" rows="20" cols="64" spellcheck="false"
Expand Down
15 changes: 15 additions & 0 deletions seil2recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,14 @@ Converter.rules['authentication'] = {
}
}
},
// authentication radius-option request-message-authenticator {on|off}
// response-message-authenticator {optional|require}
'radius-option': (conv, tokens) => {
conv.read_params('authentication.radius-option', tokens, 1, {
'request-message-authenticator': true,
'response-message-authenticator': true,
});
},
'realm': {
'add': {
'*': {
Expand Down Expand Up @@ -2293,6 +2301,13 @@ Converter.rules['interface'] = {
if (retry) {
conv.add(`${kauth}.radius.request.retry: ${retry}`);
}

const ro = conv.get_params('authentication.radius-option')['radius-option'];
if (ro != null) {
conv.param2recipe(ro, 'request-message-authenticator', `${kauth}.radius.request.message-authenticator`, on2enable);
conv.param2recipe(ro, 'response-message-authenticator', `${kauth}.radius.response.message-authenticator`,
val => (val == 'require') ? 'required' : val);
};
});
},

Expand Down
31 changes: 31 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,37 @@ describe('authentication+pppac', () => {
interface.pppac2.max-session: none
`);
});

it('radius message-authenticator', () => {
assertconv(`
authentication realm add REALM4 type radius
authentication radius REALM4 authentication-server add 192.168.1.1 secret SECRET
authentication radius-option request-message-authenticator on response-message-authenticator require
pppac pool add POOL4 address 192.168.0.0/24
pppac ipcp-configuration add IPCP4 pool POOL4
pppac protocol l2tp add PROTO4 accept-interface any
interface pppac0 ipcp-configuration IPCP4
interface pppac0 bind-tunnel-protocol PROTO4
interface pppac0 bind-realm REALM4
interface pppac0 tunnel-end-address 192.168.0.1
ipsec anonymous-l2tp-transport enable
ipsec anonymous-l2tp-transport preshared-key "foobar"
----
interface.pppac0.authentication.100.radius.authentication-server.100.address: 192.168.1.1
interface.pppac0.authentication.100.radius.authentication-server.100.shared-secret: SECRET
interface.pppac0.authentication.100.radius.request.message-authenticator: enable
interface.pppac0.authentication.100.radius.response.message-authenticator: required
interface.pppac0.authentication.100.type: radius
interface.pppac0.ipcp.pool.100.address: 192.168.0.0
interface.pppac0.ipcp.pool.100.count: 256
interface.pppac0.ipv4.address: 192.168.0.1
interface.pppac0.l2tp.authentication.100.method: mschapv2
interface.pppac0.l2tp.authentication.200.method: chap
interface.pppac0.l2tp.ipsec.preshared-key: foobar
interface.pppac0.l2tp.service: enable
interface.pppac0.max-session: none
`);
});
});

describe('bridge', () => {
Expand Down
Loading