aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-25 10:06:19 (GMT)
committerJouni Malinen <j@w1.fi>2009-03-25 10:06:19 (GMT)
commit1e5839e06fbc20945044239984b652da9c3fc772 (patch)
tree4574b2edd584e691073f4d2e2d6e19df21282703 /src/eap_server
parent1581b38b6732e19a2f8fcfc049fdbdcc5183b10e (diff)
downloadhostap-1e5839e06fbc20945044239984b652da9c3fc772.zip
hostap-1e5839e06fbc20945044239984b652da9c3fc772.tar.gz
hostap-1e5839e06fbc20945044239984b652da9c3fc772.tar.bz2
Rename EAP server defines from EAP_* to EAP_SERVER_*
This allows separate set of EAP server and peer methods to be built into a single binary.
Diffstat (limited to 'src/eap_server')
-rw-r--r--src/eap_server/eap_aka.c28
-rw-r--r--src/eap_server/eap_fast.c8
-rw-r--r--src/eap_server/eap_gtc.c8
-rw-r--r--src/eap_server/eap_methods.c76
-rw-r--r--src/eap_server/eap_peap.c28
-rw-r--r--src/eap_server/eap_sim_db.c4
-rw-r--r--src/eap_server/eap_sim_db.h6
-rw-r--r--src/eap_server/eap_ttls.c8
8 files changed, 83 insertions, 83 deletions
diff --git a/src/eap_server/eap_aka.c b/src/eap_server/eap_aka.c
index aad52fd..033dfbb 100644
--- a/src/eap_server/eap_aka.c
+++ b/src/eap_server/eap_aka.c
@@ -116,7 +116,7 @@ static void * eap_aka_init(struct eap_sm *sm)
}
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
static void * eap_aka_prime_init(struct eap_sm *sm)
{
struct eap_aka_data *data;
@@ -148,7 +148,7 @@ static void * eap_aka_prime_init(struct eap_sm *sm)
return data;
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
static void eap_aka_reset(struct eap_sm *sm, void *priv)
@@ -399,7 +399,7 @@ static struct wpabuf * eap_aka_build_challenge(struct eap_sm *sm,
eap_sim_msg_add(msg, EAP_SIM_AT_RESULT_IND, 0, NULL, 0);
}
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
if (data->eap_method == EAP_TYPE_AKA) {
u16 flags = 0;
int i;
@@ -426,7 +426,7 @@ static struct wpabuf * eap_aka_build_challenge(struct eap_sm *sm,
flags |= EAP_AKA_BIDDING_FLAG_D;
eap_sim_msg_add(msg, EAP_SIM_AT_BIDDING, flags, NULL, 0);
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
wpa_printf(MSG_DEBUG, " AT_MAC");
eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC);
@@ -701,7 +701,7 @@ static void eap_aka_determine_identity(struct eap_sm *sm,
return;
}
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
if (data->eap_method == EAP_TYPE_AKA_PRIME) {
/* Note: AUTN = (SQN ^ AK) || AMF || MAC which gives us the
* needed 6-octet SQN ^AK for CK',IK' derivation */
@@ -710,7 +710,7 @@ static void eap_aka_determine_identity(struct eap_sm *sm,
data->network_name,
data->network_name_len);
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
data->reauth = NULL;
data->counter = 0; /* reset re-auth counter since this is full auth */
@@ -807,7 +807,7 @@ static void eap_aka_process_challenge(struct eap_sm *sm,
wpa_printf(MSG_DEBUG, "EAP-AKA: Processing Challenge");
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
#if 0
/* KDF negotiation; to be enabled only after more than one KDF is
* supported */
@@ -830,7 +830,7 @@ static void eap_aka_process_challenge(struct eap_sm *sm,
return;
}
#endif
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
if (attr->checkcode &&
eap_aka_verify_checkcode(data, attr->checkcode,
@@ -892,7 +892,7 @@ static void eap_aka_process_challenge(struct eap_sm *sm,
}
if (data->next_reauth_id) {
if (data->eap_method == EAP_TYPE_AKA_PRIME) {
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
eap_sim_db_add_reauth_prime(sm->eap_sim_db_priv,
identity,
identity_len,
@@ -900,7 +900,7 @@ static void eap_aka_process_challenge(struct eap_sm *sm,
data->counter + 1,
data->k_encr, data->k_aut,
data->k_re);
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
} else {
eap_sim_db_add_reauth(sm->eap_sim_db_priv, identity,
identity_len,
@@ -1031,7 +1031,7 @@ static void eap_aka_process_reauth(struct eap_sm *sm,
}
if (data->next_reauth_id) {
if (data->eap_method == EAP_TYPE_AKA_PRIME) {
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
eap_sim_db_add_reauth_prime(sm->eap_sim_db_priv,
identity,
identity_len,
@@ -1039,7 +1039,7 @@ static void eap_aka_process_reauth(struct eap_sm *sm,
data->counter + 1,
data->k_encr, data->k_aut,
data->k_re);
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
} else {
eap_sim_db_add_reauth(sm->eap_sim_db_priv, identity,
identity_len,
@@ -1247,7 +1247,7 @@ int eap_server_aka_register(void)
}
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
int eap_server_aka_prime_register(void)
{
struct eap_method *eap;
@@ -1275,4 +1275,4 @@ int eap_server_aka_prime_register(void)
return ret;
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
diff --git a/src/eap_server/eap_fast.c b/src/eap_server/eap_fast.c
index b474c99..3563908 100644
--- a/src/eap_server/eap_fast.c
+++ b/src/eap_server/eap_fast.c
@@ -942,7 +942,7 @@ static void eap_fast_process_phase2_response(struct eap_sm *sm,
left = in_len - sizeof(*hdr);
wpa_hexdump(MSG_DEBUG, "EAP-FAST: Phase2 type Nak'ed; "
"allowed types", pos + 1, left - 1);
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (m && m->vendor == EAP_VENDOR_IETF &&
m->method == EAP_TYPE_TNC) {
wpa_printf(MSG_DEBUG, "EAP-FAST: Peer Nak'ed required "
@@ -951,7 +951,7 @@ static void eap_fast_process_phase2_response(struct eap_sm *sm,
eap_fast_phase2_init(sm, data, next_type);
return;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
eap_sm_process_nak(sm, pos + 1, left - 1);
if (sm->user && sm->user_eap_method_index < EAP_MAX_METHODS &&
sm->user->methods[sm->user_eap_method_index].method !=
@@ -1019,13 +1019,13 @@ static void eap_fast_process_phase2_response(struct eap_sm *sm,
eap_fast_state(data, CRYPTO_BINDING);
data->eap_seq++;
next_type = EAP_TYPE_NONE;
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (sm->tnc && !data->tnc_started) {
wpa_printf(MSG_DEBUG, "EAP-FAST: Initialize TNC");
next_type = EAP_TYPE_TNC;
data->tnc_started = 1;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
break;
case FAILURE:
break;
diff --git a/src/eap_server/eap_gtc.c b/src/eap_server/eap_gtc.c
index 97e328b..79b9696 100644
--- a/src/eap_server/eap_gtc.c
+++ b/src/eap_server/eap_gtc.c
@@ -33,14 +33,14 @@ static void * eap_gtc_init(struct eap_sm *sm)
return NULL;
data->state = CONTINUE;
-#ifdef EAP_FAST
+#ifdef EAP_SERVER_FAST
if (sm->m && sm->m->vendor == EAP_VENDOR_IETF &&
sm->m->method == EAP_TYPE_FAST) {
wpa_printf(MSG_DEBUG, "EAP-GTC: EAP-FAST tunnel - use prefix "
"with challenge/response");
data->prefix = 1;
}
-#endif /* EAP_FAST */
+#endif /* EAP_SERVER_FAST */
return data;
}
@@ -109,7 +109,7 @@ static void eap_gtc_process(struct eap_sm *sm, void *priv,
wpa_hexdump_ascii_key(MSG_MSGDUMP, "EAP-GTC: Response", pos, rlen);
-#ifdef EAP_FAST
+#ifdef EAP_SERVER_FAST
if (data->prefix) {
const u8 *pos2, *end;
/* "RESPONSE=<user>\0<password>" */
@@ -170,7 +170,7 @@ static void eap_gtc_process(struct eap_sm *sm, void *priv,
"EAP-GTC: Response password",
pos, rlen);
}
-#endif /* EAP_FAST */
+#endif /* EAP_SERVER_FAST */
if (sm->user == NULL || sm->user->password == NULL ||
sm->user->password_hash) {
diff --git a/src/eap_server/eap_methods.c b/src/eap_server/eap_methods.c
index 4092d67..dc9a278 100644
--- a/src/eap_server/eap_methods.c
+++ b/src/eap_server/eap_methods.c
@@ -149,138 +149,138 @@ int eap_server_register_methods(void)
ret = eap_server_identity_register();
}
-#ifdef EAP_MD5
+#ifdef EAP_SERVER_MD5
if (ret == 0) {
int eap_server_md5_register(void);
ret = eap_server_md5_register();
}
-#endif /* EAP_MD5 */
+#endif /* EAP_SERVER_MD5 */
-#ifdef EAP_TLS
+#ifdef EAP_SERVER_TLS
if (ret == 0) {
int eap_server_tls_register(void);
ret = eap_server_tls_register();
}
-#endif /* EAP_TLS */
+#endif /* EAP_SERVER_TLS */
-#ifdef EAP_MSCHAPv2
+#ifdef EAP_SERVER_MSCHAPV2
if (ret == 0) {
int eap_server_mschapv2_register(void);
ret = eap_server_mschapv2_register();
}
-#endif /* EAP_MSCHAPv2 */
+#endif /* EAP_SERVER_MSCHAPV2 */
-#ifdef EAP_PEAP
+#ifdef EAP_SERVER_PEAP
if (ret == 0) {
int eap_server_peap_register(void);
ret = eap_server_peap_register();
}
-#endif /* EAP_PEAP */
+#endif /* EAP_SERVER_PEAP */
-#ifdef EAP_TLV
+#ifdef EAP_SERVER_TLV
if (ret == 0) {
int eap_server_tlv_register(void);
ret = eap_server_tlv_register();
}
-#endif /* EAP_TLV */
+#endif /* EAP_SERVER_TLV */
-#ifdef EAP_GTC
+#ifdef EAP_SERVER_GTC
if (ret == 0) {
int eap_server_gtc_register(void);
ret = eap_server_gtc_register();
}
-#endif /* EAP_GTC */
+#endif /* EAP_SERVER_GTC */
-#ifdef EAP_TTLS
+#ifdef EAP_SERVER_TTLS
if (ret == 0) {
int eap_server_ttls_register(void);
ret = eap_server_ttls_register();
}
-#endif /* EAP_TTLS */
+#endif /* EAP_SERVER_TTLS */
-#ifdef EAP_SIM
+#ifdef EAP_SERVER_SIM
if (ret == 0) {
int eap_server_sim_register(void);
ret = eap_server_sim_register();
}
-#endif /* EAP_SIM */
+#endif /* EAP_SERVER_SIM */
-#ifdef EAP_AKA
+#ifdef EAP_SERVER_AKA
if (ret == 0) {
int eap_server_aka_register(void);
ret = eap_server_aka_register();
}
-#endif /* EAP_AKA */
+#endif /* EAP_SERVER_AKA */
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
if (ret == 0) {
int eap_server_aka_prime_register(void);
ret = eap_server_aka_prime_register();
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
-#ifdef EAP_PAX
+#ifdef EAP_SERVER_PAX
if (ret == 0) {
int eap_server_pax_register(void);
ret = eap_server_pax_register();
}
-#endif /* EAP_PAX */
+#endif /* EAP_SERVER_PAX */
-#ifdef EAP_PSK
+#ifdef EAP_SERVER_PSK
if (ret == 0) {
int eap_server_psk_register(void);
ret = eap_server_psk_register();
}
-#endif /* EAP_PSK */
+#endif /* EAP_SERVER_PSK */
-#ifdef EAP_SAKE
+#ifdef EAP_SERVER_SAKE
if (ret == 0) {
int eap_server_sake_register(void);
ret = eap_server_sake_register();
}
-#endif /* EAP_SAKE */
+#endif /* EAP_SERVER_SAKE */
-#ifdef EAP_GPSK
+#ifdef EAP_SERVER_GPSK
if (ret == 0) {
int eap_server_gpsk_register(void);
ret = eap_server_gpsk_register();
}
-#endif /* EAP_GPSK */
+#endif /* EAP_SERVER_GPSK */
-#ifdef EAP_VENDOR_TEST
+#ifdef EAP_SERVER_VENDOR_TEST
if (ret == 0) {
int eap_server_vendor_test_register(void);
ret = eap_server_vendor_test_register();
}
-#endif /* EAP_VENDOR_TEST */
+#endif /* EAP_SERVER_VENDOR_TEST */
-#ifdef EAP_FAST
+#ifdef EAP_SERVER_FAST
if (ret == 0) {
int eap_server_fast_register(void);
ret = eap_server_fast_register();
}
-#endif /* EAP_FAST */
+#endif /* EAP_SERVER_FAST */
-#ifdef EAP_WSC
+#ifdef EAP_SERVER_WSC
if (ret == 0) {
int eap_server_wsc_register(void);
ret = eap_server_wsc_register();
}
-#endif /* EAP_WSC */
+#endif /* EAP_SERVER_WSC */
-#ifdef EAP_IKEV2
+#ifdef EAP_SERVER_IKEV2
if (ret == 0) {
int eap_server_ikev2_register(void);
ret = eap_server_ikev2_register();
}
-#endif /* EAP_IKEV2 */
+#endif /* EAP_SERVER_IKEV2 */
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (ret == 0) {
int eap_server_tnc_register(void);
ret = eap_server_tnc_register();
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
return ret;
}
diff --git a/src/eap_server/eap_peap.c b/src/eap_server/eap_peap.c
index 9c265f9..4789e57 100644
--- a/src/eap_server/eap_peap.c
+++ b/src/eap_server/eap_peap.c
@@ -267,7 +267,7 @@ static struct wpabuf * eap_peap_build_phase2_req(struct eap_sm *sm,
}
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
static struct wpabuf * eap_peap_build_phase2_soh(struct eap_sm *sm,
struct eap_peap_data *data,
u8 id)
@@ -303,7 +303,7 @@ static struct wpabuf * eap_peap_build_phase2_soh(struct eap_sm *sm,
return encr_req;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
static void eap_peap_get_isk(struct eap_peap_data *data,
@@ -375,10 +375,10 @@ static struct wpabuf * eap_peap_build_phase2_tlv(struct eap_sm *sm,
mlen = 6; /* Result TLV */
if (data->crypto_binding != NO_BINDING)
mlen += 60; /* Cryptobinding TLV */
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (data->soh_response)
mlen += wpabuf_len(data->soh_response);
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
buf = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TLV, mlen,
EAP_CODE_REQUEST, id);
@@ -401,7 +401,7 @@ static struct wpabuf * eap_peap_build_phase2_tlv(struct eap_sm *sm,
size_t len[2];
u16 tlv_type;
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (data->soh_response) {
wpa_printf(MSG_DEBUG, "EAP-PEAP: Adding MS-SOH "
"Response TLV");
@@ -409,7 +409,7 @@ static struct wpabuf * eap_peap_build_phase2_tlv(struct eap_sm *sm,
wpabuf_free(data->soh_response);
data->soh_response = NULL;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
if (eap_peap_derive_cmk(sm, data) < 0 ||
os_get_random(data->binding_nonce, 32)) {
@@ -517,13 +517,13 @@ static struct wpabuf * eap_peap_buildReq(struct eap_sm *sm, void *priv, u8 id)
data->ssl.out_used = 0;
data->ssl.out_buf = eap_peap_build_phase2_req(sm, data, id);
break;
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
case PHASE2_SOH:
wpabuf_free(data->ssl.out_buf);
data->ssl.out_used = 0;
data->ssl.out_buf = eap_peap_build_phase2_soh(sm, data, id);
break;
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
case PHASE2_TLV:
wpabuf_free(data->ssl.out_buf);
data->ssl.out_used = 0;
@@ -757,7 +757,7 @@ static void eap_peap_process_phase2_tlv(struct eap_sm *sm,
}
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
static void eap_peap_process_phase2_soh(struct eap_sm *sm,
struct eap_peap_data *data,
struct wpabuf *in_data)
@@ -885,7 +885,7 @@ auth_method:
wpa_printf(MSG_DEBUG, "EAP-PEAP: try EAP type %d", next_type);
eap_peap_phase2_init(sm, data, next_type);
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
static void eap_peap_process_phase2_response(struct eap_sm *sm,
@@ -902,12 +902,12 @@ static void eap_peap_process_phase2_response(struct eap_sm *sm,
return;
}
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (data->state == PHASE2_SOH) {
eap_peap_process_phase2_soh(sm, data, in_data);
return;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
if (data->phase2_priv == NULL) {
wpa_printf(MSG_DEBUG, "EAP-PEAP: %s - Phase2 not "
@@ -991,7 +991,7 @@ static void eap_peap_process_phase2_response(struct eap_sm *sm,
break;
}
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (data->state != PHASE2_SOH && sm->tnc &&
data->peap_version == 0) {
eap_peap_state(data, PHASE2_SOH);
@@ -1000,7 +1000,7 @@ static void eap_peap_process_phase2_response(struct eap_sm *sm,
next_type = EAP_TYPE_NONE;
break;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
eap_peap_state(data, PHASE2_METHOD);
next_type = sm->user->methods[0].method;
diff --git a/src/eap_server/eap_sim_db.c b/src/eap_server/eap_sim_db.c
index ed0bd3c..aba919a 100644
--- a/src/eap_server/eap_sim_db.c
+++ b/src/eap_server/eap_sim_db.c
@@ -1023,7 +1023,7 @@ int eap_sim_db_add_reauth(void *priv, const u8 *identity,
}
-#ifdef EAP_AKA_PRIME
+#ifdef EAP_SERVER_AKA_PRIME
/**
* eap_sim_db_add_reauth_prime - EAP-AKA' DB: Add new re-authentication entry
* @priv: Private data pointer from eap_sim_db_init()
@@ -1062,7 +1062,7 @@ int eap_sim_db_add_reauth_prime(void *priv, const u8 *identity,
return 0;
}
-#endif /* EAP_AKA_PRIME */
+#endif /* EAP_SERVER_AKA_PRIME */
/**
diff --git a/src/eap_server/eap_sim_db.h b/src/eap_server/eap_sim_db.h
index 6622181..1807de7 100644
--- a/src/eap_server/eap_sim_db.h
+++ b/src/eap_server/eap_sim_db.h
@@ -15,7 +15,7 @@
#ifndef EAP_SIM_DB_H
#define EAP_SIM_DB_H
-#ifdef EAP_SIM
+#ifdef EAP_SERVER_SIM
#include "eap_common/eap_sim_common.h"
@@ -90,7 +90,7 @@ int eap_sim_db_resynchronize(void *priv, const u8 *identity,
size_t identity_len, const u8 *auts,
const u8 *_rand);
-#else /* EAP_SIM */
+#else /* EAP_SERVER_SIM */
static inline void *
eap_sim_db_init(const char *config,
void (*get_complete_cb)(void *ctx, void *session_ctx),
@@ -102,6 +102,6 @@ eap_sim_db_init(const char *config,
static inline void eap_sim_db_deinit(void *priv)
{
}
-#endif /* EAP_SIM */
+#endif /* EAP_SERVER_SIM */
#endif /* EAP_SIM_DB_H */
diff --git a/src/eap_server/eap_ttls.c b/src/eap_server/eap_ttls.c
index 21e4b21..6fe3bb1 100644
--- a/src/eap_server/eap_ttls.c
+++ b/src/eap_server/eap_ttls.c
@@ -1221,14 +1221,14 @@ static void eap_ttls_process_phase2(struct eap_sm *sm,
}
}
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (data->tnc_started && parse.eap == NULL) {
wpa_printf(MSG_DEBUG, "EAP-TTLS: TNC started but no EAP "
"response from peer");
eap_ttls_state(data, FAILURE);
goto done;
}
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
if (parse.eap) {
eap_ttls_process_phase2_eap(sm, data, parse.eap,
@@ -1264,7 +1264,7 @@ done:
static void eap_ttls_start_tnc(struct eap_sm *sm, struct eap_ttls_data *data)
{
-#ifdef EAP_TNC
+#ifdef EAP_SERVER_TNC
if (!sm->tnc || data->state != SUCCESS || data->tnc_started)
return;
@@ -1277,7 +1277,7 @@ static void eap_ttls_start_tnc(struct eap_sm *sm, struct eap_ttls_data *data)
data->tnc_started = 1;
eap_ttls_state(data, PHASE2_METHOD);
-#endif /* EAP_TNC */
+#endif /* EAP_SERVER_TNC */
}