From bb4b7cb95cee5970088b6a04fb7558a5cccd324c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Thu, 1 Jun 2023 23:09:56 +0200 Subject: [PATCH] uspot: handler-uam: fix CHAP challenge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARĂˆNE --- feeds/ucentral/uspot/files/usr/share/uspot/handler-uam.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds/ucentral/uspot/files/usr/share/uspot/handler-uam.uc b/feeds/ucentral/uspot/files/usr/share/uspot/handler-uam.uc index 2a83431e8..e875dd7c7 100644 --- a/feeds/ucentral/uspot/files/usr/share/uspot/handler-uam.uc +++ b/feeds/ucentral/uspot/files/usr/share/uspot/handler-uam.uc @@ -18,7 +18,7 @@ function auth_client(ctx) { if (ctx.query_string.response) { // try challenge first let challenge = uam.md5(ctx.config.challenge, ctx.format_mac); payload.chap_password = ctx.query_string.response; - payload.chap_challenge = ctx.config.secret ? uam.chap_challenge(challenge, ctx.config.uam_secret) : challenge; + payload.chap_challenge = ctx.config.uam_secret ? uam.chap_challenge(challenge, ctx.config.uam_secret) : challenge; } else if ("password" in ctx.query_string) { // allow empty password payload.password = !ctx.config_uam_secret ? ctx.query_string.password : uam.password(uam.md5(ctx.config.challenge, ctx.format_mac), ctx.query_string.password, ctx.config.uam_secret);