Skip to content

Commit

Permalink
Merge pull request #45 from iij/seil3-7.21
Browse files Browse the repository at this point in the history
seil3/6/8 7.21/5.42/3.21 対応
  • Loading branch information
tsahara authored Oct 2, 2024
2 parents 5f34e26 + 979750f commit 4013a1c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
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

0 comments on commit 4013a1c

Please sign in to comment.