From af052e6e11249b3ed5fd5e1b7066d53b83c38902 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 26 Aug 2021 11:25:34 +0200 Subject: [PATCH] tests: Include additional tests for wolfSSL builds Signed-off-by: Juliusz Sosinowicz --- tests/hwsim/test_ap_eap.py | 8 ++++---- tests/hwsim/test_dpp.py | 2 +- tests/hwsim/test_eap.py | 2 +- tests/hwsim/test_fils.py | 13 +++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index a9c5df283..757cb5399 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -50,7 +50,7 @@ def check_subject_match_support(dev): def check_check_cert_subject_support(dev): tls = dev.request("GET tls_library") - if not tls.startswith("OpenSSL"): + if not tls.startswith("OpenSSL") and not tls.startswith("wolfSSL"): raise HwsimSkip("check_cert_subject not supported with this TLS library: " + tls) def check_altsubject_match_support(dev): @@ -3886,7 +3886,7 @@ def test_ap_wpa2_eap_fast_prf_oom(dev, apdev): """WPA2-Enterprise connection using EAP-FAST and OOM in PRF""" check_eap_capa(dev[0], "FAST") tls = dev[0].request("GET tls_library") - if tls.startswith("OpenSSL"): + if tls.startswith("OpenSSL") or tls.startswith("wolfSSL"): func = "tls_connection_get_eap_fast_key" count = 2 elif tls.startswith("internal"): @@ -6134,11 +6134,11 @@ def test_rsn_ie_proto_eap_sta(dev, apdev): def check_tls_session_resumption_capa(dev, hapd): tls = hapd.request("GET tls_library") - if not tls.startswith("OpenSSL"): + if not tls.startswith("OpenSSL") and not tls.startswith("wolfSSL"): raise HwsimSkip("hostapd TLS library is not OpenSSL or wolfSSL: " + tls) tls = dev.request("GET tls_library") - if not tls.startswith("OpenSSL"): + if not tls.startswith("OpenSSL") and not tls.startswith("wolfSSL"): raise HwsimSkip("Session resumption not supported with this TLS library: " + tls) def test_eap_ttls_pap_session_resumption(dev, apdev): diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 523ff3c71..bc5327b7e 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -39,7 +39,7 @@ def check_dpp_capab(dev, brainpool=False, min_ver=1): raise HwsimSkip("DPP not supported") if brainpool: tls = dev.request("GET tls_library") - if not tls.startswith("OpenSSL") or "run=BoringSSL" in tls: + if (not tls.startswith("OpenSSL") or "run=BoringSSL" in tls) and not tls.startswith("wolfSSL"): raise HwsimSkip("Crypto library does not support Brainpool curves: " + tls) capa = dev.request("GET_CAPABILITY dpp") ver = 1 diff --git a/tests/hwsim/test_eap.py b/tests/hwsim/test_eap.py index 144e4d314..d3bbec3d4 100644 --- a/tests/hwsim/test_eap.py +++ b/tests/hwsim/test_eap.py @@ -440,7 +440,7 @@ def test_eap_teap_tls_cs_sha384(dev, apdev): def run_eap_teap_tls_cs(dev, apdev, cipher): check_eap_capa(dev[0], "TEAP") tls = dev[0].request("GET tls_library") - if not tls.startswith("OpenSSL"): + if not tls.startswith("OpenSSL") and not tls.startswith("wolfSSL"): raise HwsimSkip("TLS library not supported for TLS CS configuration: " + tls) params = int_teap_server_params(eap_teap_auth="1") params['openssl_ciphers'] = cipher diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index ccb33839a..e03b81326 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -1422,12 +1422,13 @@ def run_fils_sk_pfs(dev, apdev, group, params): check_erp_capa(dev[0]) tls = dev[0].request("GET tls_library") - 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") - if int(group) in [27, 28, 29, 30]: - 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("Brainpool EC group not supported") + if 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") + if int(group) in [27, 28, 29, 30]: + 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("Brainpool EC group not supported") start_erp_as(msk_dump=os.path.join(params['logdir'], "msk.lst"))