* https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-peap
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/err.h>
-#include <net/ppp_defs.h>
-#include "pppd.h"
+#include "pppd-private.h"
#include "eap.h"
#include "tls.h"
-#include "chap-new.h"
+#include "chap.h"
#include "chap_ms.h"
#include "mppe.h"
#include "peap.h"
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
};
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
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)
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
used += 2;
break;
-#if CHAPMS
+#if PPP_WITH_CHAPMS
case EAPT_MSCHAPV2: {
// Must have at least 4 more bytes to process CHAP header
}
case CHAP_FAILURE: {
+ u_char status = CHAP_FAILURE;
psm->chap->handle_failure(in_buf, in_len);
PUTCHAR(EAPT_MSCHAPV2, outp);
PUTCHAR(status, outp);