]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add function to fetch EAP Session-Id from EAPOL supplicant
authorHu Wang <huw@qti.qualcomm.com>
Tue, 25 Mar 2014 20:06:20 +0000 (22:06 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 9 May 2014 17:05:28 +0000 (20:05 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/eapol_supp/eapol_supp_sm.c
src/eapol_supp/eapol_supp_sm.h

index cbcde7ec955189a59adb16eaeb6253d526e580b5..103439558846a306d63ee002b42a038b07e62fe1 100644 (file)
@@ -1556,6 +1556,24 @@ key_fetched:
 }
 
 
+/**
+ * eapol_sm_get_session_id - Get EAP Session-Id
+ * @sm: Pointer to EAPOL state machine allocated with eapol_sm_init()
+ * @len: Pointer to variable that will be set to number of bytes in the session
+ * Returns: Pointer to the EAP Session-Id or %NULL on failure
+ *
+ * The Session-Id is available only after a successful authentication.
+ */
+const u8 * eapol_sm_get_session_id(struct eapol_sm *sm, size_t *len)
+{
+       if (sm == NULL || !eap_key_available(sm->eap)) {
+               wpa_printf(MSG_DEBUG, "EAPOL: EAP Session-Id not available");
+               return NULL;
+       }
+       return eap_get_eapSessionId(sm->eap, len);
+}
+
+
 /**
  * eapol_sm_notify_logoff - Notification of logon/logoff commands
  * @sm: Pointer to EAPOL state machine allocated with eapol_sm_init()
index 934eda01095c7f600e99d133601cbe27b7080f73..d76c8c21d4a2a5a6b5fc62fe2af78c8f42373590 100644 (file)
@@ -285,6 +285,7 @@ void eapol_sm_notify_config(struct eapol_sm *sm,
                            struct eap_peer_config *config,
                            const struct eapol_config *conf);
 int eapol_sm_get_key(struct eapol_sm *sm, u8 *key, size_t len);
+const u8 * eapol_sm_get_session_id(struct eapol_sm *sm, size_t *len);
 void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff);
 void eapol_sm_notify_cached(struct eapol_sm *sm);
 void eapol_sm_notify_pmkid_attempt(struct eapol_sm *sm, int attempt);