]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170)
authorChristian Heimes <christian@python.org>
Fri, 17 Dec 2021 15:17:32 +0000 (17:17 +0200)
committerGitHub <noreply@github.com>
Fri, 17 Dec 2021 15:17:32 +0000 (16:17 +0100)
.github/workflows/build.yml
Lib/test/test_ssl.py
Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst [new file with mode: 0644]
Tools/ssl/multissltests.py

index 48671aa7a67cd063562cd0d7b232e53c62caabf3..4504b29432cd2bf57345920acb12bc2412c219fa 100644 (file)
@@ -220,7 +220,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        openssl_ver: [1.1.1l, 3.0.0]
+        openssl_ver: [1.1.1l, 3.0.1]
     env:
       OPENSSL_VER: ${{ matrix.openssl_ver }}
       MULTISSL_DIR: ${{ github.workspace }}/multissl
index 981e2fe82ee4683d8b38efee71b870b84a11519d..f99a3e8da95f8828040f36427569c7abd50da764 100644 (file)
@@ -540,7 +540,11 @@ class BasicSocketTests(unittest.TestCase):
         self.assertLessEqual(status, 15)
 
         libressl_ver = f"LibreSSL {major:d}"
-        openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}"
+        if major >= 3:
+            # 3.x uses 0xMNN00PP0L
+            openssl_ver = f"OpenSSL {major:d}.{minor:d}.{patch:d}"
+        else:
+            openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}"
         self.assertTrue(
             s.startswith((openssl_ver, libressl_ver)),
             (s, t, hex(n))
diff --git a/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst b/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst
new file mode 100644 (file)
index 0000000..6878cea
--- /dev/null
@@ -0,0 +1 @@
+Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``.
index ba2663e9a399beaec98317b524354bc29a5814be..8fe5b5d0c262903dfc9a1d46416c0258d0318ece 100755 (executable)
@@ -48,7 +48,7 @@ OPENSSL_OLD_VERSIONS = [
 
 OPENSSL_RECENT_VERSIONS = [
     "1.1.1l",
-    "3.0.0"
+    "3.0.1"
 ]
 
 LIBRESSL_OLD_VERSIONS = [