]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PeerKey: Remove dead code related to STSL negotiation state
authorJouni Malinen <j@w1.fi>
Sun, 12 Feb 2017 09:15:49 +0000 (11:15 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 12 Feb 2017 09:15:49 +0000 (11:15 +0200)
The struct wpa_stsl_negotiation seemed to have been for some kind of
tracking of state of PeerKey negotiations within hostapd. However,
nothing is actually adding any entries to wpa_auth->stsl_negotiations or
using this state. Since PeerKey does not look like something that would
be deployed in practice, there is no justification to spend time on
making this any more complete. Remove the dead code now instead of
trying to figure out what it might be used for.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/peerkey_auth.c
src/ap/wpa_auth.c
src/ap/wpa_auth_i.h

index efc1d7e4c78f0dcdfa75c90e268e9c3f24ccc6ec..93e775b29ff4fd60d6d11fac19faa550d5bf2352 100644 (file)
 
 #ifdef CONFIG_PEERKEY
 
-static void wpa_stsl_step(void *eloop_ctx, void *timeout_ctx)
-{
-#if 0
-       struct wpa_authenticator *wpa_auth = eloop_ctx;
-       struct wpa_stsl_negotiation *neg = timeout_ctx;
-#endif
-
-       /* TODO: ? */
-}
-
-
 struct wpa_stsl_search {
        const u8 *addr;
        struct wpa_state_machine *sm;
@@ -110,7 +99,6 @@ void wpa_smk_m1(struct wpa_authenticator *wpa_auth,
                           MAC2STR(kde.mac_addr));
                wpa_smk_send_error(wpa_auth, sm, kde.mac_addr, STK_MUI_SMK,
                                   STK_ERR_STA_NR);
-               /* FIX: wpa_stsl_remove(wpa_auth, neg); */
                return;
        }
 
@@ -285,7 +273,6 @@ void wpa_smk_m3(struct wpa_authenticator *wpa_auth,
                           MAC2STR(kde.mac_addr));
                wpa_smk_send_error(wpa_auth, sm, kde.mac_addr, STK_MUI_SMK,
                                   STK_ERR_STA_NR);
-               /* FIX: wpa_stsl_remove(wpa_auth, neg); */
                return;
        }
 
@@ -365,32 +352,4 @@ void wpa_smk_error(struct wpa_authenticator *wpa_auth,
        wpa_smk_send_error(wpa_auth, search.sm, sm->addr, mui, error_type);
 }
 
-
-int wpa_stsl_remove(struct wpa_authenticator *wpa_auth,
-                   struct wpa_stsl_negotiation *neg)
-{
-       struct wpa_stsl_negotiation *pos, *prev;
-
-       if (wpa_auth == NULL)
-               return -1;
-       pos = wpa_auth->stsl_negotiations;
-       prev = NULL;
-       while (pos) {
-               if (pos == neg) {
-                       if (prev)
-                               prev->next = pos->next;
-                       else
-                               wpa_auth->stsl_negotiations = pos->next;
-
-                       eloop_cancel_timeout(wpa_stsl_step, wpa_auth, pos);
-                       os_free(pos);
-                       return 0;
-               }
-               prev = pos;
-               pos = pos->next;
-       }
-
-       return -1;
-}
-
 #endif /* CONFIG_PEERKEY */
index a62ff7b3e540d73ebffa3684fc869cfb2cd96853..be734d1c39945ec0bb79d5b94d42dbff95c8bfb9 100644 (file)
@@ -513,11 +513,6 @@ void wpa_deinit(struct wpa_authenticator *wpa_auth)
        eloop_cancel_timeout(wpa_rekey_gmk, wpa_auth, NULL);
        eloop_cancel_timeout(wpa_rekey_gtk, wpa_auth, NULL);
 
-#ifdef CONFIG_PEERKEY
-       while (wpa_auth->stsl_negotiations)
-               wpa_stsl_remove(wpa_auth, wpa_auth->stsl_negotiations);
-#endif /* CONFIG_PEERKEY */
-
        pmksa_cache_auth_deinit(wpa_auth->pmksa);
 
 #ifdef CONFIG_IEEE80211R_AP
index cda2c5065e1eb0327e627d33d83302784c5284c8..90318d81e887c81cfb14753411d9ad18ecb0f9c4 100644 (file)
 
 struct wpa_group;
 
-struct wpa_stsl_negotiation {
-       struct wpa_stsl_negotiation *next;
-       u8 initiator[ETH_ALEN];
-       u8 peer[ETH_ALEN];
-};
-
-
 struct wpa_state_machine {
        struct wpa_authenticator *wpa_auth;
        struct wpa_group *group;
@@ -200,8 +193,6 @@ struct wpa_authenticator {
        unsigned int dot11RSNATKIPCounterMeasuresInvoked;
        unsigned int dot11RSNA4WayHandshakeFailures;
 
-       struct wpa_stsl_negotiation *stsl_negotiations;
-
        struct wpa_auth_config conf;
        const struct wpa_auth_callbacks *cb;
        void *cb_ctx;
@@ -239,8 +230,6 @@ int wpa_auth_for_each_auth(struct wpa_authenticator *wpa_auth,
                           void *cb_ctx);
 
 #ifdef CONFIG_PEERKEY
-int wpa_stsl_remove(struct wpa_authenticator *wpa_auth,
-                   struct wpa_stsl_negotiation *neg);
 void wpa_smk_error(struct wpa_authenticator *wpa_auth,
                   struct wpa_state_machine *sm,
                   const u8 *key_data, size_t key_data_len);