]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP3: Add build option for version 3 functionality
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 3 Dec 2021 10:09:18 +0000 (12:09 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 3 Dec 2021 19:24:59 +0000 (21:24 +0200)
CONFIG_DPP3=y can now be used to configure hostapd and wpa_supplicant
builds to include DPP version 3 functionality. This functionality is
still under design and the implementation is experimental and not
suitable to be enabled in production uses before the specification has
been finalized.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
hostapd/Android.mk
hostapd/Makefile
hostapd/ctrl_iface.c
hostapd/defconfig
src/common/dpp.c
src/common/dpp.h
tests/hwsim/test_dpp.py
wpa_supplicant/Android.mk
wpa_supplicant/Makefile
wpa_supplicant/ctrl_iface.c
wpa_supplicant/defconfig

index dd8aa2450d7e5c144874940d469da8b445d235a7..bf26e41c6b23c1f9f6ce4cb29cb9a0f0b359301e 100644 (file)
@@ -567,6 +567,9 @@ NEED_ASN1=y
 ifdef CONFIG_DPP2
 L_CFLAGS += -DCONFIG_DPP2
 endif
+ifdef CONFIG_DPP3
+L_CFLAGS += -DCONFIG_DPP3
+endif
 endif
 
 ifdef CONFIG_PASN
index ac085fd1052016bc58194cd3a51b8b5bdf9c508b..e37c13b27a6e18967e14fc3632fcf41885704ca4 100644 (file)
@@ -593,6 +593,9 @@ NEED_ASN1=y
 ifdef CONFIG_DPP2
 CFLAGS += -DCONFIG_DPP2
 endif
+ifdef CONFIG_DPP3
+CFLAGS += -DCONFIG_DPP3
+endif
 endif
 
 ifdef CONFIG_PASN
index 6c99a3105f491b8b9caba76c1d1f81a728cc01fe..9c7527d08d0a045e36abdf1ad4d026cd6393efc2 100644 (file)
@@ -4492,7 +4492,9 @@ static void hostapd_ctrl_iface_flush(struct hapd_interfaces *interfaces)
 #ifdef CONFIG_TESTING_OPTIONS
 #ifdef CONFIG_DPP
        dpp_test = DPP_TEST_DISABLED;
-#ifdef CONFIG_DPP2
+#ifdef CONFIG_DPP3
+       dpp_version_override = 3;
+#elif defined(CONFIG_DPP2)
        dpp_version_override = 2;
 #else /* CONFIG_DPP2 */
        dpp_version_override = 1;
index 666447e4ab4003bf76ab0c9671390903394d93bc..6b50b6c59b462734831339220c2326a72c877b68 100644 (file)
@@ -402,3 +402,11 @@ CONFIG_IPV6=y
 # production use.
 # This requires CONFIG_IEEE80211W=y to be enabled, too.
 #CONFIG_PASN=y
+
+# Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect)
+CONFIG_DPP=y
+# DPP version 2 support
+CONFIG_DPP2=y
+# DPP version 3 support (experimental and still changing; do not enable for
+# production use)
+#CONFIG_DPP3=y
index 1fd074f056270f9e65647efe2481d122bb0d0f5e..f54b86f97cb623f620df1060a6c328f11f2f4e24 100644 (file)
@@ -28,7 +28,9 @@
 static const char * dpp_netrole_str(enum dpp_netrole netrole);
 
 #ifdef CONFIG_TESTING_OPTIONS
-#ifdef CONFIG_DPP2
+#ifdef CONFIG_DPP3
+int dpp_version_override = 3;
+#elif defined(CONFIG_DPP2)
 int dpp_version_override = 2;
 #else
 int dpp_version_override = 1;
@@ -306,6 +308,8 @@ int dpp_parse_uri_version(struct dpp_bootstrap_info *bi, const char *version)
                bi->version = 1;
        else if (*version == '2')
                bi->version = 2;
+       else if (*version == '3')
+               bi->version = 3;
        else
                wpa_printf(MSG_DEBUG, "DPP: Unknown URI version");
 
@@ -628,7 +632,8 @@ int dpp_gen_uri(struct dpp_bootstrap_info *bi)
                    macstr,
                    bi->info ? "I:" : "", bi->info ? bi->info : "",
                    bi->info ? ";" : "",
-                   DPP_VERSION == 2 ? "V:2;" : "",
+                   DPP_VERSION == 3 ? "V:3;" :
+                   (DPP_VERSION == 2 ? "V:2;" : ""),
                    bi->pk);
        return 0;
 }
index a47c685f64b9d889f12b8b013a34a9814972b56a..8e959051a3a7fc72a98dd8345abc6f6ecd68611d 100644 (file)
@@ -25,7 +25,9 @@ struct dpp_reconfig_id;
 #define DPP_VERSION (dpp_version_override)
 extern int dpp_version_override;
 #else /* CONFIG_TESTING_OPTIONS */
-#ifdef CONFIG_DPP2
+#ifdef CONFIG_DPP3
+#define DPP_VERSION 3
+#elif defined(CONFIG_DPP2)
 #define DPP_VERSION 2
 #else
 #define DPP_VERSION 1
index 4ed2652ef5df72e466643f748a4f85ea2fbcb684..87946c01d99a8dd8d418dfb92604c61f01e86ddc 100644 (file)
@@ -126,8 +126,12 @@ def test_dpp_uri_version(dev, apdev):
     uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
     info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id1)
     logger.info("Parsed URI info:\n" + info)
-    if "version=2" not in info.splitlines():
-        raise Exception("Unexpected version information (v2)")
+    capa = dev[0].request("GET_CAPABILITY dpp")
+    ver = 1
+    if capa.startswith("DPP="):
+        ver = int(capa[4:])
+    if "version=%d" % ver not in info.splitlines():
+        raise Exception("Unexpected version information (with indication)")
 
     dev[0].set("dpp_version_override", "1")
     id0 = dev[0].dpp_bootstrap_gen()
index 0aacafd4ab9698e5bb120500d0c74dc22eb68134..7e597f396a079c221e461082010a73948ff2eaf2 100644 (file)
@@ -279,6 +279,9 @@ NEED_ASN1=y
 ifdef CONFIG_DPP2
 L_CFLAGS += -DCONFIG_DPP2
 endif
+ifdef CONFIG_DPP3
+L_CFLAGS += -DCONFIG_DPP3
+endif
 endif
 
 ifdef CONFIG_OWE
index ce1c8b2e3366ce2269afe48fff35e8125f5ce043..cb66defac7c8266e14e5a57584aba954b622f382 100644 (file)
@@ -294,6 +294,9 @@ NEED_ASN1=y
 ifdef CONFIG_DPP2
 CFLAGS += -DCONFIG_DPP2
 endif
+ifdef CONFIG_DPP3
+CFLAGS += -DCONFIG_DPP3
+endif
 endif
 
 ifdef CONFIG_OWE
index 9dc17f5eef85f777e3e7b1827ebda6b6ca510086..90f3e9fe9018dc2a9c6a53a1375692d638d99436 100644 (file)
@@ -4826,7 +4826,9 @@ static int wpa_supplicant_ctrl_iface_get_capability(
 
 #ifdef CONFIG_DPP
        if (os_strcmp(field, "dpp") == 0) {
-#ifdef CONFIG_DPP2
+#ifdef CONFIG_DPP3
+               res = os_snprintf(buf, buflen, "DPP=3");
+#elif defined(CONFIG_DPP2)
                res = os_snprintf(buf, buflen, "DPP=2");
 #else /* CONFIG_DPP2 */
                res = os_snprintf(buf, buflen, "DPP=1");
@@ -8477,7 +8479,9 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        dpp_pkex_ephemeral_key_override_len = 0;
        dpp_protocol_key_override_len = 0;
        dpp_nonce_override_len = 0;
-#ifdef CONFIG_DPP2
+#ifdef CONFIG_DPP3
+       dpp_version_override = 3;
+#elif defined(CONFIG_DPP2)
        dpp_version_override = 2;
 #else /* CONFIG_DPP2 */
        dpp_version_override = 1;
index 708a82385170e997f614a5236f25f7e4d1d36fb9..a4719dbb543da91ea046f8b821d26e05d5111605 100644 (file)
@@ -603,8 +603,13 @@ CONFIG_BGSCAN_SIMPLE=y
 # Experimental implementation of draft-harkins-owe-07.txt
 #CONFIG_OWE=y
 
-# Device Provisioning Protocol (DPP)
+# Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect)
 CONFIG_DPP=y
+# DPP version 2 support
+CONFIG_DPP2=y
+# DPP version 3 support (experimental and still changing; do not enable for
+# production use)
+#CONFIG_DPP3=y
 
 # Wired equivalent privacy (WEP)
 # WEP is an obsolete cryptographic data confidentiality algorithm that is not