|
|
@@ -38,15 +38,15 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
src/crypto/Makefile | 129 ++++++++++++++++++++-
|
|
|
src/crypto/crypto_module_tests.c | 134 ++++++++++++++++++++++
|
|
|
src/tls/Makefile | 11 ++
|
|
|
- tests/Makefile | 75 +++++++++---
|
|
|
- tests/hwsim/example-hostapd.config | 11 +-
|
|
|
- tests/hwsim/example-wpa_supplicant.config | 12 +-
|
|
|
+ tests/Makefile | 76 +++++++++---
|
|
|
+ tests/hwsim/example-hostapd.config | 10 +-
|
|
|
+ tests/hwsim/example-wpa_supplicant.config | 11 +-
|
|
|
tests/hwsim/test_ap_eap.py | 114 +++++++++++++-----
|
|
|
tests/hwsim/test_ap_ft.py | 4 +-
|
|
|
tests/hwsim/test_authsrv.py | 9 +-
|
|
|
tests/hwsim/test_dpp.py | 19 ++-
|
|
|
tests/hwsim/test_erp.py | 16 +--
|
|
|
- tests/hwsim/test_fils.py | 5 +-
|
|
|
+ tests/hwsim/test_fils.py | 4 +
|
|
|
tests/hwsim/test_pmksa_cache.py | 4 +-
|
|
|
tests/hwsim/test_sae.py | 7 ++
|
|
|
tests/hwsim/test_suite_b.py | 3 +
|
|
|
@@ -56,12 +56,12 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
tests/test-https.c | 12 +-
|
|
|
tests/test-https_server.c | 12 +-
|
|
|
wpa_supplicant/Makefile | 6 +
|
|
|
- 22 files changed, 524 insertions(+), 91 deletions(-)
|
|
|
+ 22 files changed, 522 insertions(+), 91 deletions(-)
|
|
|
create mode 100644 tests/test-crypto_module.c
|
|
|
|
|
|
--- a/hostapd/Makefile
|
|
|
+++ b/hostapd/Makefile
|
|
|
-@@ -696,6 +696,7 @@ CFLAGS += -DCONFIG_TLSV12
|
|
|
+@@ -709,6 +709,7 @@ CFLAGS += -DCONFIG_TLSV12
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), wolfssl)
|
|
|
@@ -69,7 +69,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
CONFIG_CRYPTO=wolfssl
|
|
|
ifdef TLS_FUNCS
|
|
|
OBJS += ../src/crypto/tls_wolfssl.o
|
|
|
-@@ -716,6 +717,7 @@ endif
|
|
|
+@@ -729,6 +730,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), openssl)
|
|
|
@@ -77,7 +77,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
|
|
|
CONFIG_CRYPTO=openssl
|
|
|
ifdef TLS_FUNCS
|
|
|
-@@ -746,6 +748,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
|
|
|
+@@ -759,6 +761,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), mbedtls)
|
|
|
@@ -85,7 +85,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
CONFIG_CRYPTO=mbedtls
|
|
|
endif
|
|
|
-@@ -776,6 +779,7 @@ endif
|
|
|
+@@ -789,6 +792,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), gnutls)
|
|
|
@@ -93,7 +93,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
# default to libgcrypt
|
|
|
CONFIG_CRYPTO=gnutls
|
|
|
-@@ -806,6 +810,7 @@ endif
|
|
|
+@@ -819,6 +823,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
@@ -101,7 +101,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
CONFIG_CRYPTO=internal
|
|
|
endif
|
|
|
-@@ -884,6 +889,7 @@ endif
|
|
|
+@@ -897,6 +902,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), linux)
|
|
|
@@ -271,7 +271,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
endif
|
|
|
--- a/src/crypto/crypto_module_tests.c
|
|
|
+++ b/src/crypto/crypto_module_tests.c
|
|
|
-@@ -2469,6 +2469,139 @@ static int test_hpke(void)
|
|
|
+@@ -2470,6 +2470,139 @@ static int test_hpke(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -411,7 +411,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
static int test_ms_funcs(void)
|
|
|
{
|
|
|
#ifndef CONFIG_FIPS
|
|
|
-@@ -2590,6 +2723,7 @@ int crypto_module_tests(void)
|
|
|
+@@ -2591,6 +2724,7 @@ int crypto_module_tests(void)
|
|
|
test_fips186_2_prf() ||
|
|
|
test_extract_expand_hkdf() ||
|
|
|
test_hpke() ||
|
|
|
@@ -444,23 +444,25 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
include ../lib.rules
|
|
|
--- a/tests/Makefile
|
|
|
+++ b/tests/Makefile
|
|
|
-@@ -1,8 +1,10 @@
|
|
|
+@@ -1,10 +1,12 @@
|
|
|
-ALL=test-base64 test-md4 test-milenage \
|
|
|
- test-rsa-sig-ver \
|
|
|
- test-sha1 \
|
|
|
- test-https test-https_server \
|
|
|
-- test-sha256 test-aes test-x509v3 test-list test-rc4
|
|
|
+- test-sha256 test-aes test-x509v3 test-list test-rc4 \
|
|
|
+RUN_TESTS= \
|
|
|
+ test-list \
|
|
|
+ test-md4 test-rc4 test-sha1 test-sha256 \
|
|
|
+ test-milenage test-aes \
|
|
|
-+ test-crypto_module
|
|
|
-+
|
|
|
-+ALL=$(RUN_TESTS) test-base64 test-https test-https_server
|
|
|
++ test-crypto_module \
|
|
|
+ test-bss
|
|
|
|
|
|
++ALL=$(RUN_TESTS) test-base64 test-https test-https_server
|
|
|
++
|
|
|
include ../src/build.rules
|
|
|
|
|
|
-@@ -24,13 +26,27 @@ CFLAGS += -DCONFIG_IEEE80211R_AP
|
|
|
+ ifdef LIBFUZZER
|
|
|
+@@ -25,13 +27,27 @@ CFLAGS += -DCONFIG_IEEE80211R_AP
|
|
|
CFLAGS += -DCONFIG_IEEE80211R
|
|
|
CFLAGS += -DCONFIG_TDLS
|
|
|
|
|
|
@@ -490,7 +492,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
|
|
|
_OBJS_VAR := LLIBS
|
|
|
include ../src/objs.mk
|
|
|
-@@ -42,12 +58,43 @@ include ../src/objs.mk
|
|
|
+@@ -43,12 +59,43 @@ include ../src/objs.mk
|
|
|
LIBS = $(SLIBS) $(DLIBS)
|
|
|
LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
|
|
|
|
|
|
@@ -534,8 +536,8 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
test-base64: $(call BUILDOBJ,test-base64.o) $(LIBS)
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
|
|
|
|
|
-@@ -83,17 +130,11 @@ test-x509v3: $(call BUILDOBJ,test-x509v3
|
|
|
-
|
|
|
+@@ -141,18 +188,11 @@ test-bss: $(call BUILDOBJ,test-bss.o) $(
|
|
|
+ $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) $(WPA_CFLAGS) $(WPA_OBJS) $(LIBS)
|
|
|
|
|
|
run-tests: $(ALL)
|
|
|
- ./test-aes
|
|
|
@@ -545,6 +547,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
- ./test-rsa-sig-ver
|
|
|
- ./test-sha1
|
|
|
- ./test-sha256
|
|
|
+- ./test-bss
|
|
|
+ @set -ex; for i in $(RUN_TESTS); do ./$$i; done
|
|
|
@echo
|
|
|
@echo All tests completed successfully.
|
|
|
@@ -575,14 +578,6 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
CONFIG_EAP_EKE=y
|
|
|
CONFIG_PKCS12=y
|
|
|
CONFIG_RADIUS_SERVER=y
|
|
|
-@@ -89,6 +81,7 @@ CFLAGS += -DCONFIG_RADIUS_TEST
|
|
|
- CONFIG_MODULE_TESTS=y
|
|
|
-
|
|
|
- CONFIG_SUITEB=y
|
|
|
-+CONFIG_SUITEB192=$(if $(filter openssl mbedtls,$(CONFIG_TLS)),y,)
|
|
|
-
|
|
|
- # AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
|
|
|
- # This can be used as a more efficient memory error detector than valgrind
|
|
|
--- a/tests/hwsim/example-wpa_supplicant.config
|
|
|
+++ b/tests/hwsim/example-wpa_supplicant.config
|
|
|
@@ -35,16 +35,7 @@ LIBS += -rdynamic
|
|
|
@@ -603,14 +598,6 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
|
|
|
CONFIG_USIM_SIMULATOR=y
|
|
|
CONFIG_SIM_SIMULATOR=y
|
|
|
-@@ -137,6 +128,7 @@ CONFIG_TESTING_OPTIONS=y
|
|
|
- CONFIG_MODULE_TESTS=y
|
|
|
-
|
|
|
- CONFIG_SUITEB=y
|
|
|
-+CONFIG_SUITEB192=$(if $(filter openssl mbedtls,$(CONFIG_TLS)),y,)
|
|
|
-
|
|
|
- # AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
|
|
|
- # This can be used as a more efficient memory error detector than valgrind
|
|
|
--- a/tests/hwsim/test_ap_eap.py
|
|
|
+++ b/tests/hwsim/test_ap_eap.py
|
|
|
@@ -42,20 +42,42 @@ def check_eap_capa(dev, method):
|
|
|
@@ -708,10 +695,10 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
tls = dev.request("GET tls_library")
|
|
|
+ if tls.startswith("mbed TLS"):
|
|
|
+ raise HwsimSkip("TLS v1.3 not supported")
|
|
|
- if "run=OpenSSL 1.1.1" not in tls and "run=OpenSSL 3.0" not in tls and "wolfSSL" not in tls:
|
|
|
- raise HwsimSkip("TLS v1.3 not supported")
|
|
|
-
|
|
|
-@@ -118,11 +157,15 @@ def check_pkcs12_support(dev):
|
|
|
+ ok = ['run=OpenSSL 1.1.1', 'run=OpenSSL 3.0', 'run=OpenSSL 3.1',
|
|
|
+ 'run=OpenSSL 3.2', 'wolfSSL']
|
|
|
+ for s in ok:
|
|
|
+@@ -122,11 +161,15 @@ def check_pkcs12_support(dev):
|
|
|
# raise HwsimSkip("PKCS#12 not supported with this TLS library: " + tls)
|
|
|
if tls.startswith("wolfSSL"):
|
|
|
raise HwsimSkip("PKCS#12 not supported with this TLS library: " + tls)
|
|
|
@@ -727,7 +714,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
|
|
|
def check_ec_support(dev):
|
|
|
tls = dev.request("GET tls_library")
|
|
|
-@@ -1595,7 +1638,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_ma
|
|
|
+@@ -1741,7 +1784,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_ma
|
|
|
eap_connect(dev[0], hapd, "TTLS", "pap user",
|
|
|
anonymous_identity="ttls", password="password",
|
|
|
ca_cert="auth_serv/ca.pem", phase2="auth=PAP",
|
|
|
@@ -736,7 +723,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
altsubject_match="EMAIL:[email protected];DNS:server.w1.fi;URI:http://example.com/")
|
|
|
eap_reauth(dev[0], "TTLS")
|
|
|
|
|
|
-@@ -2830,6 +2873,7 @@ def test_ap_wpa2_eap_tls_neg_domain_matc
|
|
|
+@@ -2976,6 +3019,7 @@ def test_ap_wpa2_eap_tls_neg_domain_matc
|
|
|
|
|
|
def test_ap_wpa2_eap_tls_neg_subject_match(dev, apdev):
|
|
|
"""WPA2-Enterprise negative test - subject mismatch"""
|
|
|
@@ -744,7 +731,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
-@@ -2890,6 +2934,7 @@ def test_ap_wpa2_eap_tls_neg_subject_mat
|
|
|
+@@ -3036,6 +3080,7 @@ def test_ap_wpa2_eap_tls_neg_subject_mat
|
|
|
|
|
|
def test_ap_wpa2_eap_tls_neg_altsubject_match(dev, apdev):
|
|
|
"""WPA2-Enterprise negative test - altsubject mismatch"""
|
|
|
@@ -752,7 +739,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
|
|
|
-@@ -3430,7 +3475,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apde
|
|
|
+@@ -3582,7 +3627,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apde
|
|
|
dev[0].request("REMOVE_NETWORK all")
|
|
|
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -761,7 +748,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
tests = [(1, "os_get_random;dh_init")]
|
|
|
else:
|
|
|
tests = [(1, "crypto_dh_init;dh_init")]
|
|
|
-@@ -4744,7 +4789,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
+@@ -4896,7 +4941,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
params["private_key"] = "auth_serv/iCA-server/server.key"
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -770,7 +757,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
|
|
|
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
|
|
|
else:
|
|
|
-@@ -4810,6 +4855,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
+@@ -4962,6 +5007,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, "-sha1")
|
|
|
|
|
|
def run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, md):
|
|
|
@@ -778,7 +765,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
params = int_eap_server_params()
|
|
|
params["ca_cert"] = "auth_serv/iCA-server/ca-and-root.pem"
|
|
|
params["server_cert"] = "auth_serv/iCA-server/server.pem"
|
|
|
-@@ -4819,7 +4865,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
|
|
|
+@@ -4971,7 +5017,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
|
|
|
try:
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -787,7 +774,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
|
|
|
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
|
|
|
else:
|
|
|
-@@ -4855,7 +4901,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
|
|
|
+@@ -5007,7 +5053,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
|
|
|
try:
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -796,7 +783,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
|
|
|
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
|
|
|
else:
|
|
|
-@@ -4905,7 +4951,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
+@@ -5057,7 +5103,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
try:
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -805,7 +792,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
|
|
|
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
|
|
|
else:
|
|
|
-@@ -4972,7 +5018,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
+@@ -5124,7 +5170,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
|
|
|
|
|
|
hostapd.add_ap(apdev[0], params)
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -814,7 +801,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
|
|
|
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
|
|
|
else:
|
|
|
-@@ -5230,6 +5276,7 @@ def test_ap_wpa2_eap_ttls_server_cert_ek
|
|
|
+@@ -5382,6 +5428,7 @@ def test_ap_wpa2_eap_ttls_server_cert_ek
|
|
|
|
|
|
def test_ap_wpa2_eap_ttls_server_pkcs12(dev, apdev):
|
|
|
"""WPA2-Enterprise using EAP-TTLS and server PKCS#12 file"""
|
|
|
@@ -822,7 +809,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
skip_with_fips(dev[0])
|
|
|
params = int_eap_server_params()
|
|
|
del params["server_cert"]
|
|
|
-@@ -5242,6 +5289,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(
|
|
|
+@@ -5394,6 +5441,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(
|
|
|
|
|
|
def test_ap_wpa2_eap_ttls_server_pkcs12_extra(dev, apdev):
|
|
|
"""EAP-TTLS and server PKCS#12 file with extra certs"""
|
|
|
@@ -830,7 +817,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
skip_with_fips(dev[0])
|
|
|
params = int_eap_server_params()
|
|
|
del params["server_cert"]
|
|
|
-@@ -5264,6 +5312,7 @@ def test_ap_wpa2_eap_ttls_dh_params_serv
|
|
|
+@@ -5416,6 +5464,7 @@ def test_ap_wpa2_eap_ttls_dh_params_serv
|
|
|
|
|
|
def test_ap_wpa2_eap_ttls_dh_params_dsa_server(dev, apdev):
|
|
|
"""WPA2-Enterprise using EAP-TTLS and alternative server dhparams (DSA)"""
|
|
|
@@ -838,7 +825,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
params = int_eap_server_params()
|
|
|
params["dh_file"] = "auth_serv/dsaparam.pem"
|
|
|
hapd = hostapd.add_ap(apdev[0], params)
|
|
|
-@@ -5575,8 +5624,8 @@ def test_ap_wpa2_eap_non_ascii_identity2
|
|
|
+@@ -5727,8 +5776,8 @@ def test_ap_wpa2_eap_non_ascii_identity2
|
|
|
def test_openssl_cipher_suite_config_wpas(dev, apdev):
|
|
|
"""OpenSSL cipher suite configuration on wpa_supplicant"""
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -849,7 +836,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
|
|
hapd = hostapd.add_ap(apdev[0], params)
|
|
|
eap_connect(dev[0], hapd, "TTLS", "pap user",
|
|
|
-@@ -5602,14 +5651,14 @@ def test_openssl_cipher_suite_config_wpa
|
|
|
+@@ -5754,14 +5803,14 @@ def test_openssl_cipher_suite_config_wpa
|
|
|
def test_openssl_cipher_suite_config_hapd(dev, apdev):
|
|
|
"""OpenSSL cipher suite configuration on hostapd"""
|
|
|
tls = dev[0].request("GET tls_library")
|
|
|
@@ -868,7 +855,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
eap_connect(dev[0], hapd, "TTLS", "pap user",
|
|
|
anonymous_identity="ttls", password="password",
|
|
|
ca_cert="auth_serv/ca.pem", phase2="auth=PAP")
|
|
|
-@@ -6051,13 +6100,17 @@ def test_ap_wpa2_eap_tls_versions(dev, a
|
|
|
+@@ -6207,13 +6256,17 @@ def test_ap_wpa2_eap_tls_versions(dev, a
|
|
|
check_tls_ver(dev[0], hapd,
|
|
|
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1",
|
|
|
"TLSv1.2")
|
|
|
@@ -888,10 +875,10 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
+ "tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=0 tls_disable_tlsv1_2=1", "TLSv1.1")
|
|
|
+ check_tls_ver(dev[2], hapd,
|
|
|
+ "tls_disable_tlsv1_0=0 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1", "TLSv1")
|
|
|
- if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3.0" in tls:
|
|
|
+ if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3." in tls:
|
|
|
check_tls_ver(dev[0], hapd,
|
|
|
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1 tls_disable_tlsv1_3=0", "TLSv1.3")
|
|
|
-@@ -6079,6 +6132,11 @@ def test_ap_wpa2_eap_tls_versions_server
|
|
|
+@@ -6235,6 +6288,11 @@ def test_ap_wpa2_eap_tls_versions_server
|
|
|
tests = [("TLSv1", "[ENABLE-TLSv1.0][DISABLE-TLSv1.1][DISABLE-TLSv1.2][DISABLE-TLSv1.3]"),
|
|
|
("TLSv1.1", "[ENABLE-TLSv1.0][ENABLE-TLSv1.1][DISABLE-TLSv1.2][DISABLE-TLSv1.3]"),
|
|
|
("TLSv1.2", "[ENABLE-TLSv1.0][ENABLE-TLSv1.1][ENABLE-TLSv1.2][DISABLE-TLSv1.3]")]
|
|
|
@@ -903,7 +890,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
for exp, flags in tests:
|
|
|
hapd.disable()
|
|
|
hapd.set("tls_flags", flags)
|
|
|
-@@ -7138,6 +7196,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde
|
|
|
+@@ -7305,6 +7363,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde
|
|
|
def test_eap_tls_ext_cert_check(dev, apdev):
|
|
|
"""EAP-TLS and external server certification validation"""
|
|
|
# With internal server certificate chain validation
|
|
|
@@ -911,7 +898,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TLS",
|
|
|
identity="tls user",
|
|
|
ca_cert="auth_serv/ca.pem",
|
|
|
-@@ -7150,6 +7209,7 @@ def test_eap_tls_ext_cert_check(dev, apd
|
|
|
+@@ -7317,6 +7376,7 @@ def test_eap_tls_ext_cert_check(dev, apd
|
|
|
def test_eap_ttls_ext_cert_check(dev, apdev):
|
|
|
"""EAP-TTLS and external server certification validation"""
|
|
|
# Without internal server certificate chain validation
|
|
|
@@ -919,7 +906,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
identity="pap user", anonymous_identity="ttls",
|
|
|
password="password", phase2="auth=PAP",
|
|
|
-@@ -7160,6 +7220,7 @@ def test_eap_ttls_ext_cert_check(dev, ap
|
|
|
+@@ -7327,6 +7387,7 @@ def test_eap_ttls_ext_cert_check(dev, ap
|
|
|
def test_eap_peap_ext_cert_check(dev, apdev):
|
|
|
"""EAP-PEAP and external server certification validation"""
|
|
|
# With internal server certificate chain validation
|
|
|
@@ -927,7 +914,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="PEAP",
|
|
|
identity="user", anonymous_identity="peap",
|
|
|
ca_cert="auth_serv/ca.pem",
|
|
|
-@@ -7170,6 +7231,7 @@ def test_eap_peap_ext_cert_check(dev, ap
|
|
|
+@@ -7337,6 +7398,7 @@ def test_eap_peap_ext_cert_check(dev, ap
|
|
|
|
|
|
def test_eap_fast_ext_cert_check(dev, apdev):
|
|
|
"""EAP-FAST and external server certification validation"""
|
|
|
@@ -935,7 +922,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
check_eap_capa(dev[0], "FAST")
|
|
|
# With internal server certificate chain validation
|
|
|
dev[0].request("SET blob fast_pac_auth_ext ")
|
|
|
-@@ -7184,10 +7246,6 @@ def test_eap_fast_ext_cert_check(dev, ap
|
|
|
+@@ -7351,10 +7413,6 @@ def test_eap_fast_ext_cert_check(dev, ap
|
|
|
run_ext_cert_check(dev, apdev, id)
|
|
|
|
|
|
def run_ext_cert_check(dev, apdev, net_id):
|
|
|
@@ -948,7 +935,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
|
|
|
--- a/tests/hwsim/test_ap_ft.py
|
|
|
+++ b/tests/hwsim/test_ap_ft.py
|
|
|
-@@ -2474,11 +2474,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
|
|
|
+@@ -2486,11 +2486,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
|
|
|
# This will fail to roam
|
|
|
dev[0].roam(bssid1, check_bssid=False)
|
|
|
|
|
|
@@ -992,7 +979,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
raise HwsimSkip("Crypto library does not support Brainpool curves: " + tls)
|
|
|
capa = dev.request("GET_CAPABILITY dpp")
|
|
|
ver = 1
|
|
|
-@@ -3892,6 +3893,9 @@ def test_dpp_proto_auth_req_no_i_proto_k
|
|
|
+@@ -3902,6 +3903,9 @@ def test_dpp_proto_auth_req_no_i_proto_k
|
|
|
|
|
|
def test_dpp_proto_auth_req_invalid_i_proto_key(dev, apdev):
|
|
|
"""DPP protocol testing - invalid I-proto key in Auth Req"""
|
|
|
@@ -1002,7 +989,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
run_dpp_proto_auth_req_missing(dev, 66, "Invalid Initiator Protocol Key")
|
|
|
|
|
|
def test_dpp_proto_auth_req_no_i_nonce(dev, apdev):
|
|
|
-@@ -3987,7 +3991,12 @@ def test_dpp_proto_auth_resp_no_r_proto_
|
|
|
+@@ -3997,7 +4001,12 @@ def test_dpp_proto_auth_resp_no_r_proto_
|
|
|
|
|
|
def test_dpp_proto_auth_resp_invalid_r_proto_key(dev, apdev):
|
|
|
"""DPP protocol testing - invalid R-Proto Key in Auth Resp"""
|
|
|
@@ -1016,7 +1003,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
|
|
|
def test_dpp_proto_auth_resp_no_r_nonce(dev, apdev):
|
|
|
"""DPP protocol testing - no R-nonce in Auth Resp"""
|
|
|
-@@ -4349,11 +4358,17 @@ def test_dpp_proto_pkex_exchange_resp_in
|
|
|
+@@ -4359,11 +4368,17 @@ def test_dpp_proto_pkex_exchange_resp_in
|
|
|
|
|
|
def test_dpp_proto_pkex_cr_req_invalid_bootstrap_key(dev, apdev):
|
|
|
"""DPP protocol testing - invalid Bootstrap Key in PKEX Commit-Reveal Request"""
|
|
|
@@ -1092,21 +1079,20 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
--- a/tests/hwsim/test_fils.py
|
|
|
+++ b/tests/hwsim/test_fils.py
|
|
|
-@@ -1422,7 +1422,10 @@ def run_fils_sk_pfs(dev, apdev, group, p
|
|
|
- check_erp_capa(dev[0])
|
|
|
-
|
|
|
- tls = dev[0].request("GET tls_library")
|
|
|
-- if not tls.startswith("wolfSSL"):
|
|
|
-+ if tls.startswith("mbed TLS"):
|
|
|
+@@ -1472,6 +1472,10 @@ def check_ec_group(dev, group):
|
|
|
+ tls = dev.request("GET tls_library")
|
|
|
+ if tls.startswith("wolfSSL"):
|
|
|
+ return
|
|
|
++ elif tls.startswith("mbed TLS"):
|
|
|
+ if int(group) == 27:
|
|
|
+ raise HwsimSkip("Brainpool EC group 27 not supported by mbed TLS")
|
|
|
-+ elif not tls.startswith("wolfSSL"):
|
|
|
- if int(group) in [25]:
|
|
|
- if not (tls.startswith("OpenSSL") and ("build=OpenSSL 1.0.2" in tls or "build=OpenSSL 1.1" in tls or "build=OpenSSL 3.0" in tls) and ("run=OpenSSL 1.0.2" in tls or "run=OpenSSL 1.1" in tls or "run=OpenSSL 3.0" in tls)):
|
|
|
- raise HwsimSkip("EC group not supported")
|
|
|
++ return
|
|
|
+ if int(group) in [25]:
|
|
|
+ if not (tls.startswith("OpenSSL") and ("build=OpenSSL 1.0.2" in tls or "build=OpenSSL 1.1" in tls or "build=OpenSSL 3." in tls) and ("run=OpenSSL 1.0.2" in tls or "run=OpenSSL 1.1" in tls or "run=OpenSSL 3." in tls)):
|
|
|
+ raise HwsimSkip("EC group not supported")
|
|
|
--- a/tests/hwsim/test_pmksa_cache.py
|
|
|
+++ b/tests/hwsim/test_pmksa_cache.py
|
|
|
-@@ -955,7 +955,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
|
|
|
+@@ -958,7 +958,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
|
|
|
eap_connect(dev[0], hapd, "PAX", "[email protected]",
|
|
|
password_hex="0123456789abcdef0123456789abcdef",
|
|
|
bssid=apdev[0]['bssid'])
|
|
|
@@ -1115,7 +1101,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
with alloc_fail(dev[0], i, "rsn_preauth_init"):
|
|
|
res = dev[0].request("PREAUTH f2:11:22:33:44:55").strip()
|
|
|
logger.info("Iteration %d - PREAUTH command results: %s" % (i, res))
|
|
|
-@@ -963,7 +963,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
|
|
|
+@@ -966,7 +966,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
|
|
|
state = dev[0].request('GET_ALLOC_FAIL')
|
|
|
if state.startswith('0:'):
|
|
|
break
|
|
|
@@ -1126,7 +1112,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
"""PMKSA cache control interface operations"""
|
|
|
--- a/tests/hwsim/test_sae.py
|
|
|
+++ b/tests/hwsim/test_sae.py
|
|
|
-@@ -177,6 +177,11 @@ def test_sae_groups(dev, apdev):
|
|
|
+@@ -178,6 +178,11 @@ def test_sae_groups(dev, apdev):
|
|
|
if tls.startswith("OpenSSL") and "run=OpenSSL 1." in tls:
|
|
|
logger.info("Add Brainpool EC groups since OpenSSL is new enough")
|
|
|
sae_groups += [27, 28, 29, 30]
|
|
|
@@ -1138,7 +1124,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
heavy_groups = [14, 15, 16]
|
|
|
suitable_groups = [15, 16, 17, 18, 19, 20, 21]
|
|
|
groups = [str(g) for g in sae_groups]
|
|
|
-@@ -2193,6 +2198,8 @@ def run_sae_pwe_group(dev, apdev, group)
|
|
|
+@@ -2194,6 +2199,8 @@ def run_sae_pwe_group(dev, apdev, group)
|
|
|
logger.info("Add Brainpool EC groups since OpenSSL is new enough")
|
|
|
elif tls.startswith("wolfSSL"):
|
|
|
logger.info("Make sure Brainpool EC groups were enabled when compiling wolfSSL")
|
|
|
@@ -1179,7 +1165,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
res = dev[0].request(cmd)
|
|
|
--- a/tests/hwsim/utils.py
|
|
|
+++ b/tests/hwsim/utils.py
|
|
|
-@@ -141,7 +141,13 @@ def check_imsi_privacy_support(dev):
|
|
|
+@@ -145,7 +145,13 @@ def check_imsi_privacy_support(dev):
|
|
|
|
|
|
def check_tls_tod(dev):
|
|
|
tls = dev.request("GET tls_library")
|
|
|
@@ -1308,7 +1294,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
if (need_more_data) {
|
|
|
--- a/wpa_supplicant/Makefile
|
|
|
+++ b/wpa_supplicant/Makefile
|
|
|
-@@ -1122,6 +1122,7 @@ CFLAGS += -DCONFIG_TLSV12
|
|
|
+@@ -1189,6 +1189,7 @@ TLS_FUNCS=y
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), wolfssl)
|
|
|
@@ -1316,7 +1302,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifdef TLS_FUNCS
|
|
|
CFLAGS += -DWOLFSSL_DER_LOAD
|
|
|
OBJS += ../src/crypto/tls_wolfssl.o
|
|
|
-@@ -1137,6 +1138,7 @@ LIBS_p += -lwolfssl -lm
|
|
|
+@@ -1204,6 +1205,7 @@ LIBS_p += -lwolfssl -lm
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), openssl)
|
|
|
@@ -1324,7 +1310,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
|
|
|
ifdef TLS_FUNCS
|
|
|
CFLAGS += -DEAP_TLS_OPENSSL
|
|
|
-@@ -1164,6 +1166,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
|
|
|
+@@ -1231,6 +1233,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), mbedtls)
|
|
|
@@ -1332,7 +1318,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
CONFIG_CRYPTO=mbedtls
|
|
|
endif
|
|
|
-@@ -1183,6 +1186,7 @@ endif
|
|
|
+@@ -1250,6 +1253,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), gnutls)
|
|
|
@@ -1340,7 +1326,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
# default to libgcrypt
|
|
|
CONFIG_CRYPTO=gnutls
|
|
|
-@@ -1213,6 +1217,7 @@ endif
|
|
|
+@@ -1280,6 +1284,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
@@ -1348,7 +1334,7 @@ Signed-off-by: Glenn Strauss <[email protected]>
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
CONFIG_CRYPTO=internal
|
|
|
endif
|
|
|
-@@ -1293,6 +1298,7 @@ endif
|
|
|
+@@ -1360,6 +1365,7 @@ endif
|
|
|
endif
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), linux)
|