diff --git a/hostapd/driver_i.h b/hostapd/driver_i.h index 77ad1242e..d684cf7b0 100644 --- a/hostapd/driver_i.h +++ b/hostapd/driver_i.h @@ -103,16 +103,6 @@ hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd, seq); } -static inline int -hostapd_get_seqnum_igtk(const char *ifname, struct hostapd_data *hapd, - const u8 *addr, int idx, u8 *seq) -{ - if (hapd->driver == NULL || hapd->driver->get_seqnum_igtk == NULL) - return -1; - return hapd->driver->get_seqnum_igtk(ifname, hapd->drv_priv, addr, idx, - seq); -} - static inline int hostapd_flush(struct hostapd_data *hapd) { diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c index 6b69a2b9d..53f3a3b30 100644 --- a/hostapd/hostapd.c +++ b/hostapd/hostapd.c @@ -614,15 +614,6 @@ static int hostapd_wpa_auth_get_seqnum(void *ctx, const u8 *addr, int idx, } -static int hostapd_wpa_auth_get_seqnum_igtk(void *ctx, const u8 *addr, int idx, - u8 *seq) -{ - struct hostapd_data *hapd = ctx; - return hostapd_get_seqnum_igtk(hapd->conf->iface, hapd, addr, idx, - seq); -} - - static int hostapd_wpa_auth_send_eapol(void *ctx, const u8 *addr, const u8 *data, size_t data_len, int encrypt) @@ -894,7 +885,6 @@ static int hostapd_setup_wpa(struct hostapd_data *hapd) cb.get_msk = hostapd_wpa_auth_get_msk; cb.set_key = hostapd_wpa_auth_set_key; cb.get_seqnum = hostapd_wpa_auth_get_seqnum; - cb.get_seqnum_igtk = hostapd_wpa_auth_get_seqnum_igtk; cb.send_eapol = hostapd_wpa_auth_send_eapol; cb.for_each_sta = hostapd_wpa_auth_for_each_sta; cb.for_each_auth = hostapd_wpa_auth_for_each_auth; diff --git a/hostapd/wpa.c b/hostapd/wpa.c index 73425e660..4af26e9cf 100644 --- a/hostapd/wpa.c +++ b/hostapd/wpa.c @@ -122,15 +122,6 @@ static inline int wpa_auth_get_seqnum(struct wpa_authenticator *wpa_auth, } -static inline int wpa_auth_get_seqnum_igtk(struct wpa_authenticator *wpa_auth, - const u8 *addr, int idx, u8 *seq) -{ - if (wpa_auth->cb.get_seqnum_igtk == NULL) - return -1; - return wpa_auth->cb.get_seqnum_igtk(wpa_auth->cb.ctx, addr, idx, seq); -} - - static inline int wpa_auth_send_eapol(struct wpa_authenticator *wpa_auth, const u8 *addr, const u8 *data, size_t data_len, int encrypt) @@ -1538,8 +1529,7 @@ static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos) igtk.keyid[0] = gsm->GN_igtk; igtk.keyid[1] = 0; - if (wpa_auth_get_seqnum_igtk(sm->wpa_auth, NULL, gsm->GN_igtk, igtk.pn) - < 0) + if (wpa_auth_get_seqnum(sm->wpa_auth, NULL, gsm->GN_igtk, igtk.pn) < 0) os_memset(igtk.pn, 0, sizeof(igtk.pn)); os_memcpy(igtk.igtk, gsm->IGTK[gsm->GN_igtk - 4], WPA_IGTK_LEN); pos = wpa_add_kde(pos, RSN_KEY_DATA_IGTK, diff --git a/hostapd/wpa.h b/hostapd/wpa.h index 760818a25..55d4ec2a1 100644 --- a/hostapd/wpa.h +++ b/hostapd/wpa.h @@ -187,7 +187,6 @@ struct wpa_auth_callbacks { int (*set_key)(void *ctx, int vlan_id, wpa_alg alg, const u8 *addr, int idx, u8 *key, size_t key_len); int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq); - int (*get_seqnum_igtk)(void *ctx, const u8 *addr, int idx, u8 *seq); int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data, size_t data_len, int encrypt); int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm, diff --git a/hostapd/wpa_ft.c b/hostapd/wpa_ft.c index 495f27f11..65d673ade 100644 --- a/hostapd/wpa_ft.c +++ b/hostapd/wpa_ft.c @@ -393,17 +393,6 @@ static inline int wpa_auth_get_seqnum(struct wpa_authenticator *wpa_auth, } -#ifdef CONFIG_IEEE80211W -static inline int wpa_auth_get_seqnum_igtk(struct wpa_authenticator *wpa_auth, - const u8 *addr, int idx, u8 *seq) -{ - if (wpa_auth->cb.get_seqnum_igtk == NULL) - return -1; - return wpa_auth->cb.get_seqnum_igtk(wpa_auth->cb.ctx, addr, idx, seq); -} -#endif /* CONFIG_IEEE80211W */ - - static u8 * wpa_ft_gtk_subelem(struct wpa_state_machine *sm, size_t *len) { u8 *subelem; @@ -478,7 +467,7 @@ static u8 * wpa_ft_igtk_subelem(struct wpa_state_machine *sm, size_t *len) *pos++ = subelem_len - 2; WPA_PUT_LE16(pos, gsm->GN_igtk); pos += 2; - wpa_auth_get_seqnum_igtk(sm->wpa_auth, NULL, gsm->GN_igtk, pos); + wpa_auth_get_seqnum(sm->wpa_auth, NULL, gsm->GN_igtk, pos); pos += 6; *pos++ = WPA_IGTK_LEN; if (aes_wrap(sm->PTK.kek, WPA_IGTK_LEN / 8, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 153a27b12..c4e7b73fa 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1117,26 +1117,13 @@ struct wpa_driver_ops { * Returns: 0 on success, -1 on failure * * This function is used to fetch the last used TSC/packet number for - * a TKIP or CCMP key. + * a TKIP, CCMP, or BIP/IGTK key. It is mainly used with group keys, so + * there is no strict requirement on implementing support for unicast + * keys (i.e., addr != %NULL). */ int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq); - /** - * get_seqnum_igtk - Fetch the IGTK packet number (AP only) - * @ifname: The interface name (main or virtual) - * @priv: Private driver interface data - * @addr: %NULL for group keys - * @idx: Key index - * @seq: Buffer for returning the last used packet number - * Returns: 0 on success, -1 on failure - * - * This function is used to fetch the last used packet number for an - * IGTK key. - */ - int (*get_seqnum_igtk)(const char *ifname, void *priv, const u8 *addr, - int idx, u8 *seq); - /** * flush - Flush all association stations (AP only) * @priv: Private driver interface data diff --git a/src/drivers/driver_ndis.c b/src/drivers/driver_ndis.c index 1c71d7830..bec1e8d8c 100644 --- a/src/drivers/driver_ndis.c +++ b/src/drivers/driver_ndis.c @@ -3211,7 +3211,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = { NULL /* set_ieee8021x */, NULL /* set_privacy */, NULL /* get_seqnum */, - NULL /* get_seqnum_igtk */, NULL /* flush */, NULL /* set_generic_elem */, NULL /* read_sta_data */,