EAP server: Add support for configuring fragment size

This commit is contained in:
Jouni Malinen 2010-07-18 19:28:53 -07:00 committed by Jouni Malinen
parent f3a3e6987e
commit 7f6ec672ea
13 changed files with 22 additions and 5 deletions

View file

@ -107,6 +107,7 @@ struct eap_config {
struct wps_context *wps;
const struct wpabuf *assoc_wps_ie;
const u8 *peer_addr;
int fragment_size;
};

View file

@ -187,6 +187,9 @@ struct eap_sm {
Boolean start_reauth;
u8 peer_addr[ETH_ALEN];
/* Fragmentation size for EAP method init() handler */
int fragment_size;
};
int eap_user_get(struct eap_sm *sm, const u8 *identity, size_t identity_len,

View file

@ -1257,6 +1257,7 @@ struct eap_sm * eap_server_sm_init(void *eapol_ctx,
sm->assoc_wps_ie = wpabuf_dup(conf->assoc_wps_ie);
if (conf->peer_addr)
os_memcpy(sm->peer_addr, conf->peer_addr, ETH_ALEN);
sm->fragment_size = conf->fragment_size;
wpa_printf(MSG_DEBUG, "EAP: Server state machine created");

View file

@ -93,7 +93,8 @@ static void * eap_ikev2_init(struct eap_sm *sm)
if (data == NULL)
return NULL;
data->state = MSG;
data->fragment_size = IKEV2_FRAGMENT_SIZE;
data->fragment_size = sm->fragment_size > 0 ? sm->fragment_size :
IKEV2_FRAGMENT_SIZE;
data->ikev2.state = SA_INIT;
data->ikev2.peer_auth = PEER_AUTH_SECRET;
data->ikev2.key_pad = (u8 *) os_strdup("Key Pad for EAP-IKEv2");

View file

@ -45,8 +45,7 @@ int eap_server_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
return -1;
}
/* TODO: make this configurable */
data->tls_out_limit = 1398;
data->tls_out_limit = sm->fragment_size > 0 ? sm->fragment_size : 1398;
if (data->phase2) {
/* Limit the fragment size in the inner TLS authentication
* since the outer authentication with EAP-PEAP does not yet

View file

@ -91,7 +91,8 @@ static void * eap_tnc_init(struct eap_sm *sm)
return NULL;
}
data->fragment_size = 1300;
data->fragment_size = sm->fragment_size > 100 ?
sm->fragment_size - 98 : 1300;
return data;
}

View file

@ -136,7 +136,8 @@ static void * eap_wsc_init(struct eap_sm *sm)
os_free(data);
return NULL;
}
data->fragment_size = WSC_FRAGMENT_SIZE;
data->fragment_size = sm->fragment_size > 0 ? sm->fragment_size :
WSC_FRAGMENT_SIZE;
return data;
}