diff --git a/src/handshake.c b/src/handshake.c index 5121142f..514f47db 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -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); diff --git a/src/handshake.h b/src/handshake.h index b9c88bc5..4b9d438b 100644 --- a/src/handshake.h +++ b/src/handshake.h @@ -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,