diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 97b0a472..97b9b5e9 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -1364,8 +1364,8 @@ auth_check_options() #endif /* EAP_SUPPORT */ ) { #if CHAP_SUPPORT - wo->neg_chap = pcb->chap_mdtype_all != MDTYPE_NONE; - wo->chap_mdtype = pcb->chap_mdtype_all; + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT wo->neg_upap = 1; diff --git a/src/netif/ppp/chap-new.c b/src/netif/ppp/chap-new.c index 825658d7..c97844bb 100644 --- a/src/netif/ppp/chap-new.c +++ b/src/netif/ppp/chap-new.c @@ -44,12 +44,8 @@ #include "chap-new.h" #include "chap-md5.h" - #if MSCHAP_SUPPORT #include "chap_ms.h" -#define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) -#else -#define MDTYPE_ALL (MDTYPE_MD5) #endif /* Hook for a plugin to validate CHAP challenge */ @@ -128,8 +124,6 @@ static void chap_init(ppp_pcb *pcb) { memset(&pcb->chap_server, 0, sizeof(chap_server_state)); #endif /* PPP_SERVER */ - pcb->chap_mdtype_all = MDTYPE_ALL; - chap_md5_init(); #if MSCHAP_SUPPORT chapms_init(); diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 67cba968..78bc645d 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -384,7 +384,7 @@ static void lcp_init(ppp_pcb *pcb) { ao->neg_asyncmap = 1; #if CHAP_SUPPORT ao->neg_chap = 1; - ao->chap_mdtype = pcb->chap_mdtype_all; + ao->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT ao->neg_upap = 1; diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index fd67fd97..feaba30c 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -324,8 +324,6 @@ struct ppp_pcb_s { #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - /* FIXME: we can probably remove this entry */ - int chap_mdtype_all; /* hashes supported by this instance of pppd */ chap_client_state chap_client; #if PPP_SERVER chap_server_state chap_server; diff --git a/src/netif/ppp/ppp_impl.h b/src/netif/ppp/ppp_impl.h index a55cdfb0..2c0c7194 100644 --- a/src/netif/ppp/ppp_impl.h +++ b/src/netif/ppp/ppp_impl.h @@ -357,6 +357,17 @@ extern struct protent *protocols[]; #define PHASE_HOLDOFF 11 #define PHASE_MASTER 12 +/* Supported CHAP protocols */ +#if CHAP_SUPPORT +#include "chap-new.h" +#if MSCHAP_SUPPORT +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) +#else +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MD5) +#endif +#else +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_NONE) +#endif #if PPP_STATS_SUPPORT /*