summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2003-11-10 21:56:02 +0000
committerbrian <brian@FreeBSD.org>2003-11-10 21:56:02 +0000
commitba7b98841db381bf4be73509e8d33cab7f07111b (patch)
tree5899d6c42382d4f2a8f698441d4c3a4563a9da3b /usr.sbin/ppp
parentd7f52e5bd8723803f6c6c12029f25c409eb9ec2e (diff)
downloadFreeBSD-src-ba7b98841db381bf4be73509e8d33cab7f07111b.zip
FreeBSD-src-ba7b98841db381bf4be73509e8d33cab7f07111b.tar.gz
Ignore case when comparing CHAP/CHAP81 responses
PR: 31771
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/chap.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index 46dcd31..305e5c7 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -624,18 +624,23 @@ chap_Cmp(u_char type, char *myans, int mylen, char *hisans, int hislen
#endif
)
{
+ int off;
+
if (mylen != hislen)
return 0;
-#ifndef NODES
- else if (type == 0x80) {
- int off = lm ? 0 : 24;
- if (memcmp(myans + off, hisans + off, 24))
- return 0;
+ off = 0;
+
+#ifndef NODES
+ if (type == 0x80) {
+ off = lm ? 0 : 24;
+ mylen = 24;
}
#endif
- else if (memcmp(myans, hisans, mylen))
- return 0;
+
+ for (; mylen; off++, mylen--)
+ if (toupper(myans[off]) != toupper(hisans[off]))
+ return 0;
return 1;
}
OpenPOWER on IntegriCloud