uspot: handler: use Call-Check for MAC auth

Reading [1] and [2], it appears that the hard-coded value "2" is
incorrect and "10" should be used instead. [1] provides that:

  Checks for the presence of a Service-Type == 'Call-Check' AVP as an
  explicit indication that the NAS wants to do Mac-Auth.

"Call-Check" is defined in [2] as value 10.

[1]: https://wiki.freeradius.org/guide/mac-auth#web-auth-safe-mac-auth
[2]: https://freeradius.org/rfc/rfc2865.html#Service-Type

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
Thibaut VARÈNE
2023-05-30 10:28:06 +02:00
committed by John Crispin
parent eeec28eb4a
commit 5d0f75f68e

View File

@@ -24,7 +24,7 @@ function request_start(ctx) {
let payload = portal.radius_init(ctx);
payload.username = ctx.format_mac + (ctx.config.mac_suffix || '');
payload.password = ctx.config.mac_passwd || ctx.format_mac;
payload.service_type = 2;
payload.service_type = 10; // Call-Check, see https://wiki.freeradius.org/guide/mac-auth#web-auth-safe-mac-auth
let radius = portal.radius_call(ctx, payload);
if (radius['access-accept']) {
if (ctx.config.final_redirect_url == 'uam')