]> git.ozlabs.org Git - ppp.git/commitdiff
fixes from Farrell
authorPaul Mackerras <paulus@samba.org>
Thu, 22 May 1997 06:46:19 +0000 (06:46 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 22 May 1997 06:46:19 +0000 (06:46 +0000)
pppd/chap_ms.c

index 68026299bff1a50031d08c870c567a32f7030b9d..89f95b516c84d0744f7744d8167f6669a0cf2185 100644 (file)
@@ -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 <des.h>
+#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;