From f31407dd46df013a79ed8509dcbb0bf0ef9d1935 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sun, 29 Mar 2015 20:30:14 -0500 Subject: [PATCH] eapol: Add deauthenticate callback --- src/eapol.c | 6 ++++++ src/eapol.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/eapol.c b/src/eapol.c index 2a88288d..10714627 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -45,6 +45,7 @@ eapol_tx_packet_func_t tx_packet = NULL; eapol_get_nonce_func_t get_nonce = NULL; eapol_install_tk_func_t install_tk = NULL; eapol_install_gtk_func_t install_gtk = NULL; +eapol_deauthenticate_func_t deauthenticate = NULL; enum eapol_protocol_version protocol_version = EAPOL_PROTOCOL_VERSION_2004; #define VERIFY_IS_ZERO(field) \ @@ -897,6 +898,11 @@ void __eapol_set_install_gtk_func(eapol_install_gtk_func_t func) install_gtk = func; } +void __eapol_set_deauthenticate_func(eapol_deauthenticate_func_t func) +{ + deauthenticate = func; +} + struct l_io *eapol_open_pae(uint32_t index) { struct l_io *io; diff --git a/src/eapol.h b/src/eapol.h index ba04a9bb..00400b0f 100644 --- a/src/eapol.h +++ b/src/eapol.h @@ -106,6 +106,10 @@ typedef void (*eapol_install_gtk_func_t)(uint32_t ifindex, uint8_t key_index, const uint8_t *gtk, uint8_t gtk_len, const uint8_t *rsc, uint8_t rsc_len, const uint8_t *rsn, void *user_data); +typedef void (*eapol_deauthenticate_func_t)(uint32_t ifindex, const uint8_t *aa, + const uint8_t *spa, + uint16_t reason_code, + void *user_data); bool eapol_calculate_mic(const uint8_t *kck, const struct eapol_key *frame, uint8_t *mic); @@ -144,6 +148,7 @@ void __eapol_set_get_nonce_func(eapol_get_nonce_func_t func); void __eapol_set_protocol_version(enum eapol_protocol_version version); void __eapol_set_install_tk_func(eapol_install_tk_func_t func); void __eapol_set_install_gtk_func(eapol_install_gtk_func_t func); +void __eapol_set_deauthenticate_func(eapol_deauthenticate_func_t func); struct eapol_sm *eapol_sm_new(); void eapol_sm_free(struct eapol_sm *sm);