]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
macsec: Store EAP-Key-Name as eapSessionId
authorleiwei <leiwei@codeaurora.org>
Fri, 24 May 2019 08:53:32 +0000 (16:53 +0800)
committerJouni Malinen <jouni@codeaurora.org>
Mon, 3 Jun 2019 17:27:44 +0000 (20:27 +0300)
Signed-off-by: leiwei <leiwei@codeaurora.org>
src/ap/ieee802_1x.c

index 7854f6fc3758075d7a58c0cbd06633aca72037f7..3bab8d0ca6bbbea0a248c370707fa6d36a106fdb 100644 (file)
@@ -1407,6 +1407,8 @@ static void ieee802_1x_get_keys(struct hostapd_data *hapd,
                                size_t shared_secret_len)
 {
        struct radius_ms_mppe_keys *keys;
+       u8 *buf;
+       size_t len;
        struct eapol_state_machine *sm = sta->eapol_sm;
        if (sm == NULL)
                return;
@@ -1443,6 +1445,20 @@ static void ieee802_1x_get_keys(struct hostapd_data *hapd,
                os_free(keys->recv);
                os_free(keys);
        }
+
+       if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_EAP_KEY_NAME, &buf, &len,
+                                   NULL) == 0) {
+               os_free(sm->eap_if->eapSessionId);
+               sm->eap_if->eapSessionId = os_memdup(buf, len);
+               if (sm->eap_if->eapSessionId) {
+                       sm->eap_if->eapSessionIdLen = len;
+                       wpa_hexdump(MSG_DEBUG, "EAP-Key Name",
+                                   sm->eap_if->eapSessionId,
+                                   sm->eap_if->eapSessionIdLen);
+               }
+       } else {
+               sm->eap_if->eapSessionIdLen = 0;
+       }
 }