From b93ae37325a9f166a351dce4adb94e401c4ccae1 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 14 Jun 2016 19:42:48 -0500 Subject: [PATCH] eapol: Add eapol_sm_get_own_ie --- src/eapol.c | 9 +++++++++ src/eapol.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/eapol.c b/src/eapol.c index de87685c..00dbe145 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -749,6 +749,15 @@ uint32_t eapol_sm_get_group_cipher(struct eapol_sm *sm) return sm->group_cipher; } +const uint8_t *eapol_sm_get_own_ie(struct eapol_sm *sm, size_t *out_ie_len) +{ + if (!sm->own_ie) + return NULL; + + *out_ie_len = sm->own_ie[1] + 2; + return sm->own_ie; +} + static bool eapol_sm_ifindex_match(void *data, void *user_data) { struct eapol_sm *sm = data; diff --git a/src/eapol.h b/src/eapol.h index 9f2fb69a..5410af6e 100644 --- a/src/eapol.h +++ b/src/eapol.h @@ -190,6 +190,7 @@ void eapol_sm_set_tx_user_data(struct eapol_sm *sm, void *user_data); uint32_t eapol_sm_get_pairwise_cipher(struct eapol_sm *sm); uint32_t eapol_sm_get_group_cipher(struct eapol_sm *sm); +const uint8_t *eapol_sm_get_own_ie(struct eapol_sm *sm, size_t *out_ie_len); struct l_io *eapol_open_pae(uint32_t index);