]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix EAP-FAST protocol testing with older OpenSSL library versions
authorJouni Malinen <jouni@codeaurora.org>
Mon, 3 Jun 2019 17:25:56 +0000 (20:25 +0300)
committerJouni Malinen <jouni@codeaurora.org>
Mon, 3 Jun 2019 17:27:43 +0000 (20:27 +0300)
Looks like the previous fix for a newer OpenSSL versions broke
functionality with older versions that did not seem to like @SECLEVEL=0
in the cipher list. Make that addition conditional on OpenSSL version to
work with both versions.

Fixes: e87e6f609bb1 ("tests: Fix EAP-FAST protocol testing with newer OpenSSL and pyOpenSSL")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_eap_proto.py

index db30594eb3903eaa6b4e839b2ce22e1f3071a036..7aeaf968c6763a7b0f36f3ea5425038d11debe20 100644 (file)
@@ -10110,7 +10110,10 @@ def run_eap_fast_phase2(dev, test_payload, test_failure=True):
         ctx['sslctx'] = OpenSSL.SSL.Context(OpenSSL.SSL.TLSv1_METHOD)
         ctx['sslctx'].set_info_callback(ssl_info_callback)
         ctx['sslctx'].load_tmp_dh("auth_serv/dh.conf")
-        ctx['sslctx'].set_cipher_list("ADH-AES128-SHA:@SECLEVEL=0")
+        if OpenSSL.SSL.OPENSSL_VERSION_NUMBER >= 0x10100000:
+            ctx['sslctx'].set_cipher_list("ADH-AES128-SHA:@SECLEVEL=0")
+        else:
+            ctx['sslctx'].set_cipher_list("ADH-AES128-SHA")
         ctx['conn'] = OpenSSL.SSL.Connection(ctx['sslctx'], None)
         ctx['conn'].set_accept_state()
         log_conn_state(ctx['conn'])