]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Store Enrollee config request information
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 2 Feb 2022 14:45:05 +0000 (16:45 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Feb 2022 14:59:59 +0000 (16:59 +0200)
This information can be helpful for upper layers in deciding how to
configure the Enrollee.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/common/dpp.c
src/common/dpp.h

index 138a3d3e07a26f6013ae6bba58ae21df8ee046c8..038b21467f019a931082eaac8fe98d1e3995aa92 100644 (file)
@@ -1289,6 +1289,9 @@ void dpp_auth_deinit(struct dpp_authentication *auth)
                dl_list_del(&auth->tmp_peer_bi->list);
                dpp_bootstrap_info_free(auth->tmp_peer_bi);
        }
+       os_free(auth->e_name);
+       os_free(auth->e_mud_url);
+       os_free(auth->e_band_support);
 #ifdef CONFIG_TESTING_OPTIONS
        os_free(auth->config_obj_override);
        os_free(auth->discovery_override);
@@ -1969,6 +1972,8 @@ dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start,
                goto fail;
        }
        wpa_printf(MSG_DEBUG, "DPP: Enrollee name = '%s'", token->string);
+       os_free(auth->e_name);
+       auth->e_name = os_strdup(token->string);
 
        token = json_get_member(root, "wi-fi_tech");
        if (!token || token->type != JSON_STRING) {
@@ -2008,6 +2013,8 @@ dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start,
                wpa_printf(MSG_DEBUG, "DPP: mudurl = '%s'", token->string);
                wpa_msg(auth->msg_ctx, MSG_INFO, DPP_EVENT_MUD_URL "%s",
                        token->string);
+               os_free(auth->e_mud_url);
+               auth->e_mud_url = os_strdup(token->string);
        }
 
        token = json_get_member(root, "bandSupport");
@@ -2043,7 +2050,8 @@ dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start,
                        }
                        pos += res;
                }
-               os_free(opclass);
+               os_free(auth->e_band_support);
+               auth->e_band_support = opclass;
                wpa_msg(auth->msg_ctx, MSG_INFO, DPP_EVENT_BAND_SUPPORT "%s",
                        txt);
        }
index 124d695f54d13b35a9d068e14d9fa8759555d904..40e9775e5749dd82be2983cec26d542d35a6cadc 100644 (file)
@@ -354,6 +354,9 @@ struct dpp_authentication {
        struct wpabuf *certbag;
        void *cert_resp_ctx;
        void *gas_server_ctx;
+       char *e_name;
+       char *e_mud_url;
+       int *e_band_support;
 #ifdef CONFIG_TESTING_OPTIONS
        char *config_obj_override;
        char *discovery_override;