From f636bc3abcce6acc953b5296d8d6fe7fd0a9fae9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 16 May 2020 21:58:10 +0300 Subject: [PATCH] tests: Skip TOD-TOFU/STRICT tests if build does not support this This functionality is currently available only with OpenSSL and internal TLS implementation. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_eap.py | 2 ++ tests/hwsim/test_sigma_dut.py | 4 +++- tests/hwsim/utils.py | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index f41c6ffb3..0eed03500 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -7250,6 +7250,7 @@ def run_openssl_systemwide_policy(iface, apdev, test_params): def test_ap_wpa2_eap_tls_tod(dev, apdev): """EAP-TLS server certificate validation and TOD-STRICT""" + check_tls_tod(dev[0]) params = int_eap_server_params() params["server_cert"] = "auth_serv/server-certpol.pem" params["private_key"] = "auth_serv/server-certpol.key" @@ -7279,6 +7280,7 @@ def test_ap_wpa2_eap_tls_tod(dev, apdev): def test_ap_wpa2_eap_tls_tod_tofu(dev, apdev): """EAP-TLS server certificate validation and TOD-TOFU""" + check_tls_tod(dev[0]) params = int_eap_server_params() params["server_cert"] = "auth_serv/server-certpol2.pem" params["private_key"] = "auth_serv/server-certpol2.key" diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py index dc2986b51..f1e8dfc39 100644 --- a/tests/hwsim/test_sigma_dut.py +++ b/tests/hwsim/test_sigma_dut.py @@ -19,7 +19,7 @@ import threading import time import hostapd -from utils import HwsimSkip +from utils import * from hwsim import HWSimRadio import hwsim_utils from wlantest import Wlantest @@ -3817,6 +3817,7 @@ def test_sigma_dut_eap_ttls_uosc_tod_tofu(dev, apdev, params): run_sigma_dut_eap_ttls_uosc_tod(dev, apdev, params, True) def run_sigma_dut_eap_ttls_uosc_tod(dev, apdev, params, tofu): + check_tls_tod(dev[0]) logdir = params['logdir'] name = "sigma_dut_eap_ttls_uosc_tod" @@ -3895,6 +3896,7 @@ def test_sigma_dut_eap_ttls_uosc_initial_tod_tofu(dev, apdev, params): run_sigma_dut_eap_ttls_uosc_initial_tod(dev, apdev, params, True) def run_sigma_dut_eap_ttls_uosc_initial_tod(dev, apdev, params, tofu): + check_tls_tod(dev[0]) logdir = params['logdir'] name = "sigma_dut_eap_ttls_uosc_initial_tod" diff --git a/tests/hwsim/utils.py b/tests/hwsim/utils.py index c259a766c..a6f260b62 100644 --- a/tests/hwsim/utils.py +++ b/tests/hwsim/utils.py @@ -113,6 +113,11 @@ def check_sae_capab(dev): if "SAE" not in dev.get_capability("auth_alg"): raise HwsimSkip("SAE not supported") +def check_tls_tod(dev): + tls = dev.request("GET tls_library") + if not tls.startswith("OpenSSL") and not tls.startswith("internal"): + raise HwsimSkip("TLS TOD-TOFU/STRICT not supported with this TLS library: " + tls) + def vht_supported(): cmd = subprocess.Popen(["iw", "reg", "get"], stdout=subprocess.PIPE) reg = cmd.stdout.read()