From 3fc12c3580ef4a3f28847e86b8f1a5b2e9c00038 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 22 May 1997 06:46:19 +0000 Subject: [PATCH] fixes from Farrell --- pppd/chap_ms.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c index 6802629..89f95b5 100644 --- a/pppd/chap_ms.c +++ b/pppd/chap_ms.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap_ms.c,v 1.3 1997/04/30 05:51:40 paulus Exp $"; +static char rcsid[] = "$Id: chap_ms.c,v 1.4 1997/05/22 06:46:19 paulus Exp $"; #endif #ifdef CHAPMS @@ -47,7 +47,9 @@ static char rcsid[] = "$Id: chap_ms.c,v 1.3 1997/04/30 05:51:40 paulus Exp $"; #include "chap_ms.h" #include "md4.h" +#ifndef USE_CRYPT #include +#endif typedef struct { u_char LANManResp[24]; @@ -264,7 +266,8 @@ ChapMS_NT(rchallenge, rchallenge_len, secret, secret_len, response) ChallengeResponse(rchallenge, (char *)md4Context.buffer, response->NTResp); } -static u_char *StdText = "KGS!@#$%"; /* key from rasapi32.dll */ +#ifdef MSLANMAN +static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ static ChapMS_LANMan(rchallenge, rchallenge_len, secret, secret_len, response) char *rchallenge; @@ -285,6 +288,7 @@ static ChapMS_LANMan(rchallenge, rchallenge_len, secret, secret_len, response) DesEncrypt( StdText, UcasePassword + 7, PasswordHash + 8 ); ChallengeResponse(rchallenge, PasswordHash, response->LANManResp); } +#endif void ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len) @@ -295,6 +299,9 @@ ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len) int secret_len; { MS_ChapResponse response; +#ifdef MSLANMAN + extern int ms_lanman; +#endif #if 0 CHAPDEBUG((LOG_INFO, "ChapMS: secret is '%.*s'", secret_len, secret)); @@ -303,10 +310,15 @@ ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len) /* Calculate both always */ ChapMS_NT(rchallenge, rchallenge_len, secret, secret_len, &response); + +#ifdef MSLANMAN ChapMS_LANMan(rchallenge, rchallenge_len, secret, secret_len, &response); /* prefered method is set by option */ response.UseNT = !ms_lanman; +#else + response.UseNT = 1; +#endif BCOPY(&response, cstate->response, MS_CHAP_RESPONSE_LEN); cstate->resp_length = MS_CHAP_RESPONSE_LEN; -- 2.39.2