handshake: Add handshake_state_set_protocol_version

This commit is contained in:
Denis Kenzior 2019-07-15 21:45:12 -05:00
parent f7e23b3512
commit d984c605f7
2 changed files with 19 additions and 0 deletions

View File

@ -268,6 +268,21 @@ void handshake_state_set_fils_ft(struct handshake_state *s,
s->fils_ft_len = fils_ft_len;
}
/*
* Override the protocol version used for EAPoL packets. The selection is as
* follows:
* 0 -> Automatic, use same proto as the request for the response and
* 2004 when in authenticator mode
* 1 -> Chooses 2001 Protocol Version
* 2 -> Chooses 2004 Protocol Version
* 3 -> Chooses 2010 Protocol Version
*/
void handshake_state_set_protocol_version(struct handshake_state *s,
uint8_t proto_version)
{
s->proto_version = proto_version;
}
void handshake_state_new_snonce(struct handshake_state *s)
{
get_nonce(s->snonce);

View File

@ -120,6 +120,7 @@ struct handshake_state {
uint8_t r1khid[6];
uint8_t gtk[32];
uint8_t gtk_rsc[6];
uint8_t proto_version : 2;
unsigned int gtk_index;
struct erp_cache_entry *erp_cache;
void *user_data;
@ -167,6 +168,9 @@ void handshake_state_set_fils_ft(struct handshake_state *s,
const uint8_t *fils_ft,
size_t fils_ft_len);
void handshake_state_set_protocol_version(struct handshake_state *s,
uint8_t proto_version);
void handshake_state_new_snonce(struct handshake_state *s);
void handshake_state_new_anonce(struct handshake_state *s);
void handshake_state_set_anonce(struct handshake_state *s,