|
Lines 1-19
Link Here
|
| 1 |
--- src/modules/rlm_mschap/rlm_mschap.c.orig Thu Aug 19 10:20:28 2004 |
|
|
| 2 |
+++ src/modules/rlm_mschap/rlm_mschap.c Thu Aug 19 10:21:16 2004 |
| 3 |
@@ -220,10 +220,15 @@ |
| 4 |
SHA1_CTX Context; |
| 5 |
char hash[20]; |
| 6 |
|
| 7 |
+ const char *name; |
| 8 |
+ |
| 9 |
+ name = strchr(user_name, '\\'); |
| 10 |
+ name = name == NULL ? user_name : name + 1; |
| 11 |
+ |
| 12 |
SHA1Init(&Context); |
| 13 |
SHA1Update(&Context, peer_challenge, 16); |
| 14 |
SHA1Update(&Context, auth_challenge, 16); |
| 15 |
- SHA1Update(&Context, user_name, strlen(user_name)); |
| 16 |
+ SHA1Update(&Context, name, strlen(name)); |
| 17 |
SHA1Final(hash, &Context); |
| 18 |
memcpy(challenge, hash, 8); |
| 19 |
} |