1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Don't include any domain suffix when hashing the username -

as per rfc2759.
This commit is contained in:
Brian Somers 2002-07-05 00:07:02 +00:00
parent 46d49ae502
commit 144b192080
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=62449
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- src/modules/rlm_mschap/rlm_mschap.c.orig Mon Jan 21 11:20:42 2002
+++ src/modules/rlm_mschap/rlm_mschap.c Fri Jul 5 00:44:19 2002
@@ -258,11 +258,15 @@
{
SHA1_CTX Context;
char hash[20];
-
+ const char *name;
+
+ name = strchr(user_name, '\\');
+ name = name == NULL ? user_name : name + 1;
+
SHA1Init(&Context);
SHA1Update(&Context, peer_challenge, 16);
SHA1Update(&Context, auth_challenge, 16);
- SHA1Update(&Context, user_name, strlen(user_name));
+ SHA1Update(&Context, name, strlen(name));
SHA1Final(hash, &Context);
memcpy(challenge, hash, 8);
}

View File

@ -0,0 +1,20 @@
--- src/modules/rlm_mschap/rlm_mschap.c.orig Mon Jan 21 11:20:42 2002
+++ src/modules/rlm_mschap/rlm_mschap.c Fri Jul 5 00:44:19 2002
@@ -258,11 +258,15 @@
{
SHA1_CTX Context;
char hash[20];
-
+ const char *name;
+
+ name = strchr(user_name, '\\');
+ name = name == NULL ? user_name : name + 1;
+
SHA1Init(&Context);
SHA1Update(&Context, peer_challenge, 16);
SHA1Update(&Context, auth_challenge, 16);
- SHA1Update(&Context, user_name, strlen(user_name));
+ SHA1Update(&Context, name, strlen(name));
SHA1Final(hash, &Context);
memcpy(challenge, hash, 8);
}