]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Initialize EAPOL auth identity/cui with STA entry data
authorMichael Braun <michael-dev@fami-braun.de>
Sun, 19 Aug 2012 11:23:20 +0000 (14:23 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Aug 2012 11:23:20 +0000 (14:23 +0300)
If RADIUS ACL was used for the STA, identity/cui may already be
known at this point.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

src/ap/ieee802_1x.c
src/eapol_auth/eapol_auth_sm.c
src/eapol_auth/eapol_auth_sm.h

index d4c3e485e790f6e5d30eb17ef5f2fd9c9d6e6011..745ce9317ae49d8708f274524dded7d33d238b55 100644 (file)
@@ -722,7 +722,8 @@ ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta)
                        flags |= EAPOL_SM_FROM_PMKSA_CACHE;
        }
        return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags,
-                               sta->wps_ie, sta->p2p_ie, sta);
+                               sta->wps_ie, sta->p2p_ie, sta,
+                               sta->identity, sta->radius_cui);
 }
 
 
index 8d6d18fc5232fd23713e8fb7d81ad7ffacc95e88..c3ccb46bf38324846d7176367a91627178ebb252 100644 (file)
@@ -757,7 +757,8 @@ SM_STEP(CTRL_DIR)
 struct eapol_state_machine *
 eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
                 int flags, const struct wpabuf *assoc_wps_ie,
-                const struct wpabuf *assoc_p2p_ie, void *sta_ctx)
+                const struct wpabuf *assoc_p2p_ie, void *sta_ctx,
+                const char *identity, const char *radius_cui)
 {
        struct eapol_state_machine *sm;
        struct eap_config eap_conf;
@@ -838,6 +839,15 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
 
        eapol_auth_initialize(sm);
 
+       if (identity) {
+               sm->identity = (u8 *) os_strdup(identity);
+               if (sm->identity)
+                       sm->identity_len = os_strlen(identity);
+       }
+       if (radius_cui)
+               sm->radius_cui = wpabuf_alloc_copy(radius_cui,
+                                                  os_strlen(radius_cui));
+
        return sm;
 }
 
index 5e8ff43dcda715aef0464792a28f7ccc54a13216..b50bbdd0f1ce65c8b58a1c9ae3f87c8a12d4dba7 100644 (file)
@@ -77,7 +77,8 @@ void eapol_auth_deinit(struct eapol_authenticator *eapol);
 struct eapol_state_machine *
 eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
                 int flags, const struct wpabuf *assoc_wps_ie,
-                const struct wpabuf *assoc_p2p_ie, void *sta_ctx);
+                const struct wpabuf *assoc_p2p_ie, void *sta_ctx,
+                const char *identity, const char *radius_cui);
 void eapol_auth_free(struct eapol_state_machine *sm);
 void eapol_auth_step(struct eapol_state_machine *sm);
 void eapol_auth_dump_state(FILE *f, const char *prefix,