]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make channel_info available to the supplicant state machine
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
Mon, 6 Aug 2018 19:46:20 +0000 (15:46 -0400)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2018 16:35:30 +0000 (18:35 +0200)
This adds the necessary functions and callbacks to make the channel_info
driver API available to the supplicant state machine that implements the
4-way and group key handshake. This is needed for OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
src/rsn_supp/wpa.h
src/rsn_supp/wpa_i.h
wpa_supplicant/wpas_glue.c

index 21f4b17815e93fefeb92c2d0e92fe438d18b5426..d52b8e0334717f3a09cdcc406827b2949c28d134 100644 (file)
@@ -18,6 +18,7 @@ struct wpa_sm;
 struct eapol_sm;
 struct wpa_config_blob;
 struct hostapd_freq_params;
+struct wpa_channel_info;
 
 struct wpa_sm_ctx {
        void *ctx; /* pointer to arbitrary upper level context */
@@ -82,6 +83,7 @@ struct wpa_sm_ctx {
        int (*key_mgmt_set_pmk)(void *ctx, const u8 *pmk, size_t pmk_len);
        void (*fils_hlp_rx)(void *ctx, const u8 *dst, const u8 *src,
                            const u8 *pkt, size_t pkt_len);
+       int (*channel_info)(void *ctx, struct wpa_channel_info *ci);
 };
 
 
index b94b17a85a3a686b65fb78f048630ca8dd209dea..27619901d90438c24a779035452171f923cf4c81 100644 (file)
@@ -395,6 +395,14 @@ static inline void wpa_sm_fils_hlp_rx(struct wpa_sm *sm,
                sm->ctx->fils_hlp_rx(sm->ctx->ctx, dst, src, pkt, pkt_len);
 }
 
+static inline int wpa_sm_channel_info(struct wpa_sm *sm,
+                                     struct wpa_channel_info *ci)
+{
+       if (!sm->ctx->channel_info)
+               return -1;
+       return sm->ctx->channel_info(sm->ctx->ctx, ci);
+}
+
 
 int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
                       int ver, const u8 *dest, u16 proto,
index 4634ed7fc368cc384fd832d28ec1c08594863335..7cfad9122f6621488b94c6702c8a8afa5403d564 100644 (file)
@@ -1183,6 +1183,15 @@ static void wpa_supplicant_fils_hlp_rx(void *ctx, const u8 *dst, const u8 *src,
        os_free(hex);
 }
 
+
+static int wpa_supplicant_channel_info(void *_wpa_s,
+                                      struct wpa_channel_info *ci)
+{
+       struct wpa_supplicant *wpa_s = _wpa_s;
+
+       return wpa_drv_channel_info(wpa_s, ci);
+}
+
 #endif /* CONFIG_NO_WPA */
 
 
@@ -1233,6 +1242,7 @@ int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)
        ctx->set_rekey_offload = wpa_supplicant_set_rekey_offload;
        ctx->key_mgmt_set_pmk = wpa_supplicant_key_mgmt_set_pmk;
        ctx->fils_hlp_rx = wpa_supplicant_fils_hlp_rx;
+       ctx->channel_info = wpa_supplicant_channel_info;
 
        wpa_s->wpa = wpa_sm_init(ctx);
        if (wpa_s->wpa == NULL) {