mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
EAP-pwd peer: Allow fragmentation limit to be configured
The standard fragment_size network parameter can now be used to configure EAP-pwd fragmentation limit instead of always using the hardcoded value of 1020. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
60bf585cce
commit
16a19ddae8
@ -81,6 +81,7 @@ static void * eap_pwd_init(struct eap_sm *sm)
|
|||||||
struct eap_pwd_data *data;
|
struct eap_pwd_data *data;
|
||||||
const u8 *identity, *password;
|
const u8 *identity, *password;
|
||||||
size_t identity_len, password_len;
|
size_t identity_len, password_len;
|
||||||
|
int fragment_size;
|
||||||
|
|
||||||
password = eap_get_config_password(sm, &password_len);
|
password = eap_get_config_password(sm, &password_len);
|
||||||
if (password == NULL) {
|
if (password == NULL) {
|
||||||
@ -127,7 +128,11 @@ static void * eap_pwd_init(struct eap_sm *sm)
|
|||||||
|
|
||||||
data->out_frag_pos = data->in_frag_pos = 0;
|
data->out_frag_pos = data->in_frag_pos = 0;
|
||||||
data->inbuf = data->outbuf = NULL;
|
data->inbuf = data->outbuf = NULL;
|
||||||
data->mtu = 1020; /* default from RFC 5931, make it configurable! */
|
fragment_size = eap_get_config_fragment_size(sm);
|
||||||
|
if (fragment_size <= 0)
|
||||||
|
data->mtu = 1020; /* default from RFC 5931 */
|
||||||
|
else
|
||||||
|
data->mtu = fragment_size;
|
||||||
|
|
||||||
data->state = PWD_ID_Req;
|
data->state = PWD_ID_Req;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user