From: Eivind Næss Date: Sat, 16 Oct 2021 19:28:01 +0000 (-0700) Subject: Changing defines for USE_PEAP to PPP_WITH_PEAP for consistency X-Git-Tag: ppp-2.5.0~36^2~18 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=3d40f39afda944dc862001800c0b3696d2f9f181;p=ppp.git Changing defines for USE_PEAP to PPP_WITH_PEAP for consistency Signed-off-by: Eivind Næss --- diff --git a/configure.ac b/configure.ac index 6996955..19e981c 100644 --- a/configure.ac +++ b/configure.ac @@ -186,8 +186,8 @@ AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno") AC_ARG_ENABLE([peap], AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support])) AS_IF([test "x${enable_peap}" != "xno"], - AC_DEFINE([USE_PEAP], 1, ["Have PEAP authentication support"])) -AM_CONDITIONAL([WITH_PEAP], test "x${enable_peap}" != "xno") + AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support])) +AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno") # # Disable OpenSSL engine support diff --git a/pppd/Makefile.am b/pppd/Makefile.am index 3607f57..a7d64cf 100644 --- a/pppd/Makefile.am +++ b/pppd/Makefile.am @@ -134,12 +134,12 @@ endif if PPP_WITH_EAPTLS pppd_SOURCES += eap-tls.c tls.c else -if WITH_PEAP +if PPP_WITH_PEAP pppd_SOURCES += tls.c endif endif -if WITH_PEAP +if PPP_WITH_PEAP pppd_SOURCES += peap.c check_PROGRAMS += utest_peap endif diff --git a/pppd/auth.c b/pppd/auth.c index 8615472..1e9cba0 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -259,7 +259,7 @@ bool explicit_user = 0; /* Set if "user" option supplied */ bool explicit_passwd = 0; /* Set if "password" option supplied */ char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -#if defined(PPP_WITH_EAPTLS) || defined(USE_PEAP) +#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP) char *cacert_file = NULL; /* CA certificate file (pem format) */ char *ca_path = NULL; /* Directory with CA certificates */ char *crl_dir = NULL; /* Directory containing CRL files */ @@ -449,7 +449,7 @@ option_t auth_options[] = { "Set telephone number(s) which are allowed to connect", OPT_PRIV | OPT_A2LIST }, -#if defined(PPP_WITH_EAPTLS) || defined(USE_PEAP) +#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP) { "ca", o_string, &cacert_file, "CA certificate in PEM format" }, { "capath", o_string, &ca_path, "TLS CA certificate directory" }, { "crl-dir", o_string, &crl_dir, "Use CRLs in directory" }, diff --git a/pppd/eap.c b/pppd/eap.c index c9b3f67..c73dcfb 100644 --- a/pppd/eap.c +++ b/pppd/eap.c @@ -67,9 +67,9 @@ #include "pathnames.h" #include "md5.h" #include "eap.h" -#ifdef USE_PEAP +#ifdef PPP_WITH_PEAP #include "peap.h" -#endif /* USE_PEAP */ +#endif /* PPP_WITH_PEAP */ #ifdef USE_SRP #ifdef HAVE_TIME_H @@ -2220,7 +2220,7 @@ eap_request(eap_state *esp, u_char *inp, int id, int len) break; #endif /* PPP_WITH_CHAPMS */ -#ifdef USE_PEAP +#ifdef PPP_WITH_PEAP case EAPT_PEAP: /* Initialize the PEAP context (if not already initialized) */ @@ -2241,7 +2241,7 @@ eap_request(eap_state *esp, u_char *inp, int id, int len) } break; -#endif // USE_PEAP +#endif // PPP_WITH_PEAP default: info("EAP: unknown authentication type %d; Naking", typenum); @@ -2795,7 +2795,7 @@ eap_success(eap_state *esp, u_char *inp, int id, int len) PRINTMSG(inp, len); } -#ifdef USE_PEAP +#ifdef PPP_WITH_PEAP peap_finish(&esp->ea_peap); #endif @@ -2834,7 +2834,7 @@ eap_failure(eap_state *esp, u_char *inp, int id, int len) error("EAP: peer reports authentication failure"); -#ifdef USE_PEAP +#ifdef PPP_WITH_PEAP peap_finish(&esp->ea_peap); #endif diff --git a/pppd/eap.h b/pppd/eap.h index d45f093..fbc7201 100644 --- a/pppd/eap.h +++ b/pppd/eap.h @@ -169,7 +169,7 @@ typedef struct eap_state { int es_unit; /* Interface unit number */ struct eap_auth es_client; /* Client (authenticatee) data */ struct eap_auth es_server; /* Server (authenticator) data */ -#ifdef USE_PEAP +#ifdef PPP_WITH_PEAP struct peap_state *ea_peap; /* Client PEAP (authenticator) data */ #endif int es_savedtime; /* Saved timeout */ diff --git a/pppd/peap.c b/pppd/peap.c index fb9af3e..414fa11 100644 --- a/pppd/peap.c +++ b/pppd/peap.c @@ -85,7 +85,7 @@ struct peap_state { u_char tk[PEAP_TLV_TK_LEN]; u_char nonce[PEAP_TLV_NONCE_LEN]; struct tls_info *info; -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS struct chap_digest_type *chap; #endif }; @@ -162,7 +162,7 @@ static void generate_cmk(u_char *ipmk, u_char *tempkey, u_char *nonce, u_char *t BCOPY(nonce, (data_tlv + PEAP_TLV_HEADERLEN), PEAP_TLV_NONCE_LEN); data_tlv[60] = EAPT_PEAP; -#ifdef MPPE +#ifdef PPP_WITH_MPPE mppe_get_send_key(isk, MPPE_MAX_KEY_LEN); mppe_get_recv_key(isk + MPPE_MAX_KEY_LEN, MPPE_MAX_KEY_LEN); #endif @@ -192,7 +192,7 @@ static void verify_compound_mac(struct peap_state *psm, u_char *in_buf) fatal("server's CMK does not match client's CMK, potential MiTM"); } -#ifdef MPPE +#ifdef PPP_WITH_MPPE #define PEAP_MPPE_KEY_LEN 32 static void generate_mppe_keys(u_char *ipmk, int client) @@ -310,7 +310,7 @@ void peap_do_inner_eap(u_char *in_buf, int in_len, eap_state *esp, int id, outp = outp + PEAP_TLV_RESULT_LEN; RAND_bytes(psm->nonce, PEAP_TLV_NONCE_LEN); generate_cmk(psm->ipmk, psm->tk, psm->nonce, outp, 1); -#ifdef MPPE +#ifdef PPP_WITH_MPPE /* set mppe keys */ generate_mppe_keys(psm->ipmk, 1); #endif @@ -337,7 +337,7 @@ void peap_do_inner_eap(u_char *in_buf, int in_len, eap_state *esp, int id, used += 2; break; -#if CHAPMS +#if PPP_WITH_CHAPMS case EAPT_MSCHAPV2: { // Must have at least 4 more bytes to process CHAP header diff --git a/pppd/pppd.h b/pppd/pppd.h index b173aea..8d896bd 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -340,7 +340,7 @@ extern char path_ipv6up[]; /* pathname of ipv6-up script */ extern char path_ipv6down[]; /* pathname of ipv6-down script */ #endif -#if defined(PPP_WITH_EAPTLS) || defined(USE_PEAP) +#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP) #define TLS_VERIFY_NONE "none" #define TLS_VERIFY_NAME "name" #define TLS_VERIFY_SUBJECT "subject" @@ -354,7 +354,7 @@ extern char *cacert_file; extern char *max_tls_version; extern bool tls_verify_key_usage; extern char *tls_verify_method; -#endif /* PPP_WITH_EAPTLS || USE_PEAP */ +#endif /* PPP_WITH_EAPTLS || PPP_WITH_PEAP */ #ifdef PPP_WITH_EAPTLS extern char *pkcs12_file; diff --git a/pppd/pppdconf.h.in b/pppd/pppdconf.h.in index d07e237..0b46a1e 100644 --- a/pppd/pppdconf.h.in +++ b/pppd/pppdconf.h.in @@ -42,8 +42,8 @@ /* Have EAP-TLS authentication support */ #undef PPP_WITH_EAPTLS -/* "Have PEAP authentication support" */ -#undef USE_PEAP +/* Have PEAP authentication support */ +#undef PPP_WITH_PEAP /* Use included des included with pppd */ #undef USE_CRYPT