]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Support DPP key_mgmt saving to wpa_supplicant configuration
authorDamodaran, Rohit (Contractor) <Rohit_Damodaran@comcast.com>
Wed, 5 Dec 2018 11:20:43 +0000 (11:20 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 8 Dec 2018 14:17:48 +0000 (16:17 +0200)
In the existing code, there was no "DPP" string available to the DPP key
management type for configuration parser of wpa supplicant. When the
configuration is saved, the key management string was left out from the
config file. Fix this by adding support for writing key_mgmt=DPP option.

Signed-off-by: Rohit Damodaran <Rohit_Damodaran@comcast.com>
wpa_supplicant/config.c

index c43960697dc39240d56ab6ad2880e54dc876e6a1..0498cdb012ffb43e2cafcefef8e832fe98862b50 100644 (file)
@@ -1043,6 +1043,18 @@ static char * wpa_config_write_key_mgmt(const struct parse_data *data,
 #endif /* CONFIG_IEEE80211R */
 #endif /* CONFIG_FILS */
 
+#ifdef CONFIG_DPP
+       if (ssid->key_mgmt & WPA_KEY_MGMT_DPP) {
+               ret = os_snprintf(pos, end - pos, "%sDPP",
+                                 pos == buf ? "" : " ");
+               if (os_snprintf_error(end - pos, ret)) {
+                       end[-1] = '\0';
+                       return buf;
+               }
+               pos += ret;
+       }
+#endif /* CONFIG_DPP */
+
        if (pos == buf) {
                os_free(buf);
                buf = NULL;