ppp/ppp-2.4.8-ws-2019-workaroun...

28 lines
1.1 KiB
Diff

From 3cd95baf3f1de1d5a9bc89be0f4c3215ceb5aefe Mon Sep 17 00:00:00 2001
From: yannayl <yannayl@users.noreply.github.com>
Date: Sun, 12 Jul 2020 12:12:08 +0300
Subject: [PATCH] Accept Malformed Windows Success Message
Windows Server 2019 skip a space when sending a success message.
This commit accepts such a malformed message and continues normally.
Signed-off-by: Yannay Linveh <yannayl@gmail.com>
Signed-off-by: yannayl <yannayl@users.noreply.github.com>
---
pppd/chap_ms.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c
index 1de50428..ffb6bd13 100644
--- a/pppd/chap_ms.c
+++ b/pppd/chap_ms.c
@@ -423,6 +423,8 @@ chapms2_check_success(int id, unsigned char *msg, int len)
len -= MS_AUTH_RESPONSE_LENGTH;
if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
msg += 3; /* Eat the delimiter */
+ } else if ((len >= 2) && !strncmp((char *)msg, "M=", 2)) {
+ msg += 2; /* Eat the delimiter */
} else if (len) {
/* Packet has extra text which does not begin " M=" */
error("MS-CHAPv2 Success packet is badly formed.");