PPP, MPPE, replaced #ifdef MPPE to #if MPPE_SUPPORT

This commit is contained in:
Sylvain Rochet
2015-03-20 00:20:12 +01:00
parent 73f1511ac2
commit 9fbe900949
7 changed files with 84 additions and 71 deletions

View File

@@ -127,17 +127,17 @@ static void GenerateAuthenticatorResponsePlain
static void ChapMS_LANMan (u_char *, char *, int, u_char *);
#endif
#ifdef MPPE
#if MPPE_SUPPORT
static void Set_Start_Key (u_char *, char *, int);
static void SetMasterKeys (char *, int, u_char[24], int);
#endif
#endif /* MPPE_SUPPORT */
#ifdef MSLANMAN
bool ms_lanman = 0; /* Use LanMan password instead of NT */
/* Has meaning only with MS-CHAP challenges */
#endif
#ifdef MPPE
#if MPPE_SUPPORT
u_char mppe_send_key[MPPE_MAX_KEY_LEN];
u_char mppe_recv_key[MPPE_MAX_KEY_LEN];
int mppe_keys_set = 0; /* Have the MPPE keys been set? */
@@ -153,7 +153,7 @@ static char *mschap2_peer_challenge = NULL;
#include "netif/ppp/fsm.h" /* Need to poke MPPE options */
#include "netif/ppp/ccp.h"
#include <net/ppp-comp.h>
#endif
#endif /* MPPE_SUPPORT */
#if PPP_OPTIONS
/*
@@ -641,7 +641,7 @@ static void GenerateAuthenticatorResponsePlain
}
#ifdef MPPE
#if MPPE_SUPPORT
/*
* Set mppe_xxxx_key from the NTPasswordHashHash.
* RFC 2548 (RADIUS support) requires us to export this function (ugh).
@@ -788,7 +788,7 @@ static void SetMasterKeys(char *secret, int secret_len, u_char NTResponse[24], i
mppe_set_keys2(PasswordHashHash, NTResponse, IsServer);
}
#endif /* MPPE */
#endif /* MPPE_SUPPORT */
void ChapMS(u_char *rchallenge, char *secret, int secret_len,
@@ -807,9 +807,9 @@ void ChapMS(u_char *rchallenge, char *secret, int secret_len,
response[MS_CHAP_USENT] = 1;
#endif
#ifdef MPPE
#if MPPE_SUPPORT
Set_Start_Key(rchallenge, secret, secret_len);
#endif
#endif /* MPPE_SUPPORT */
}
@@ -851,14 +851,14 @@ void ChapMS2(u_char *rchallenge, u_char *PeerChallenge,
&response[MS_CHAP2_PEER_CHALLENGE],
rchallenge, user, authResponse);
#ifdef MPPE
#if MPPE_SUPPORT
SetMasterKeys(secret, secret_len,
&response[MS_CHAP2_NTRESP], authenticator);
#endif
#endif /* MPPE_SUPPORT */
}
#if 0 /* UNUSED */
#ifdef MPPE
#if MPPE_SUPPORT
/*
* Set MPPE options from plugins.
*/
@@ -887,7 +887,7 @@ void set_mppe_enc_types(int policy, int types) {
break;
}
}
#endif /* MPPE */
#endif /* MPPE_SUPPORT */
#endif /* UNUSED */
const struct chap_digest_type chapms_digest = {