]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Remove unnecessary dpp_global_config parameters
authorJouni Malinen <jouni@codeaurora.org>
Tue, 25 Aug 2020 13:00:56 +0000 (16:00 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 25 Aug 2020 13:02:29 +0000 (16:02 +0300)
These were not really used anymore since the AP/Relay case did not set
msg_ctx or process_conf_obj in the global DPP context. Get the
appropriate pointers more directly from the more specific data
structures instead and remove these global values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
hostapd/main.c
src/common/dpp.c
src/common/dpp.h
src/common/dpp_tcp.c
wpa_supplicant/dpp_supplicant.c

index 353b20a8028d3a4d12d7e0e2331ea7f011a51223..4f2d1f21659ef6fef98df99582fdc56f03ca422a 100644 (file)
@@ -675,7 +675,6 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_DPP
        os_memset(&dpp_conf, 0, sizeof(dpp_conf));
        dpp_conf.cb_ctx = &interfaces;
-       /* TODO: dpp_conf.msg_ctx? */
 #ifdef CONFIG_DPP2
        dpp_conf.remove_bi = hostapd_dpp_remove_bi;
 #endif /* CONFIG_DPP2 */
index bc349229b7b2384788355c81287b5a69f2b3c2a0..3922edb635d378a011948f8a199dbab3877cbded 100644 (file)
@@ -4278,10 +4278,8 @@ struct dpp_global * dpp_global_init(struct dpp_global_config *config)
        dpp = os_zalloc(sizeof(*dpp));
        if (!dpp)
                return NULL;
-       dpp->msg_ctx = config->msg_ctx;
 #ifdef CONFIG_DPP2
        dpp->cb_ctx = config->cb_ctx;
-       dpp->process_conf_obj = config->process_conf_obj;
        dpp->remove_bi = config->remove_bi;
 #endif /* CONFIG_DPP2 */
 
index ee88560c728e3d53c6dd934ab4c0f420a63b1cef..2213593a348582d4e143b36b179c0ce8fedd6ae3 100644 (file)
@@ -374,6 +374,7 @@ struct dpp_relay_config {
        const struct hostapd_ip_addr *ipaddr;
        const u8 *pkhash;
 
+       void *msg_ctx;
        void *cb_ctx;
        void (*tx)(void *ctx, const u8 *addr, unsigned int freq, const u8 *msg,
                   size_t len);
@@ -685,9 +686,7 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
 struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi);
 
 struct dpp_global_config {
-       void *msg_ctx;
        void *cb_ctx;
-       int (*process_conf_obj)(void *ctx, struct dpp_authentication *auth);
        void (*remove_bi)(void *ctx, struct dpp_bootstrap_info *bi);
 };
 
index 5bd17cdb010fd146ad9990a31d1ee87832d217c3..7e330d689b546ab58f006e7b8e9c0c93b59d1f6b 100644 (file)
@@ -53,6 +53,7 @@ struct dpp_relay_controller {
        struct dpp_global *global;
        u8 pkhash[SHA256_MAC_LEN];
        struct hostapd_ip_addr ipaddr;
+       void *msg_ctx;
        void *cb_ctx;
        void (*tx)(void *ctx, const u8 *addr, unsigned int freq, const u8 *msg,
                   size_t len);
@@ -126,6 +127,7 @@ int dpp_relay_add_controller(struct dpp_global *dpp,
        ctrl->global = dpp;
        os_memcpy(&ctrl->ipaddr, config->ipaddr, sizeof(*config->ipaddr));
        os_memcpy(ctrl->pkhash, config->pkhash, SHA256_MAC_LEN);
+       ctrl->msg_ctx = config->msg_ctx;
        ctrl->cb_ctx = config->cb_ctx;
        ctrl->tx = config->tx;
        ctrl->gas_resp_tx = config->gas_resp_tx;
@@ -375,9 +377,8 @@ dpp_relay_new_conn(struct dpp_relay_controller *ctrl, const u8 *src,
 
        conn->global = ctrl->global;
        conn->relay = ctrl;
-       conn->msg_ctx = ctrl->global->msg_ctx;
+       conn->msg_ctx = ctrl->msg_ctx;
        conn->cb_ctx = ctrl->global->cb_ctx;
-       conn->process_conf_obj = ctrl->global->process_conf_obj;
        os_memcpy(conn->mac_addr, src, ETH_ALEN);
        conn->freq = freq;
 
index df6ddfc5b194e63e8e704966e90e00cd2406481b..28404b8d769dd4d69c94de2b9d77225d1c073050 100644 (file)
@@ -3275,10 +3275,8 @@ int wpas_dpp_init(struct wpa_supplicant *wpa_s)
                return -1;
 
        os_memset(&config, 0, sizeof(config));
-       config.msg_ctx = wpa_s;
        config.cb_ctx = wpa_s;
 #ifdef CONFIG_DPP2
-       config.process_conf_obj = wpas_dpp_process_conf_obj;
        config.remove_bi = wpas_dpp_remove_bi;
 #endif /* CONFIG_DPP2 */
        wpa_s->dpp = dpp_global_init(&config);