From a872bfcf31038f643fee8bdabbb4cd3545e13969 Mon Sep 17 00:00:00 2001 From: leiwei Date: Fri, 24 May 2019 16:53:32 +0800 Subject: [PATCH] macsec: Export eapSessionId Signed-off-by: leiwei --- src/ap/ieee802_1x.c | 14 ++++++++++++++ src/ap/ieee802_1x.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 3bab8d0ca..94167b687 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -2581,6 +2581,20 @@ const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len) } +#ifdef CONFIG_MACSEC +const u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm, + size_t *len) +{ + *len = 0; + if (!sm || !sm->eap_if) + return NULL; + + *len = sm->eap_if->eapSessionIdLen; + return sm->eap_if->eapSessionId; +} +#endif /* CONFIG_MACSEC */ + + void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm, int enabled) { diff --git a/src/ap/ieee802_1x.h b/src/ap/ieee802_1x.h index 9594661be..d771ba526 100644 --- a/src/ap/ieee802_1x.h +++ b/src/ap/ieee802_1x.h @@ -39,6 +39,8 @@ u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len, int idx); struct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm); const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len); +const u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm, + size_t *len); void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm, int enabled); void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,