Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:mcepl:branches:devel:languages:python:Factory
python36
openssl-301-version-check.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openssl-301-version-check.patch of Package python36
From 60fdbf2561548e23a3d3b8ab3c01508486a65bc6 Mon Sep 17 00:00:00 2001 From: Victor Stinner <vstinner@python.org> Date: Mon, 6 Jun 2022 18:46:16 +0200 Subject: [PATCH] OpenSSL 3.0.1: Fix OpenSSL version check for 3.0.1 (cherry picked from commit gh#python/cpython@2985fea) Co-authored-by: Christian Heimes <christian@python.org> Fixes: bpo#46114 From-PR: gh#python/cpython!30170 Patch: openssl-301-version-check.patch Released-in: 3.8.14 --- Lib/test/test_ssl.py | 16 ++++++++++------ .../2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 443ef5df742..b7d98c24f2a 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -442,13 +442,17 @@ class BasicSocketTests(unittest.TestCase): self.assertLessEqual(patch, 63) self.assertGreaterEqual(status, 0) self.assertLessEqual(status, 15) - # Version string as returned by {Open,Libre}SSL, the format might change - if IS_LIBRESSL: - self.assertTrue(s.startswith("LibreSSL {:d}".format(major)), - (s, t, hex(n))) + + libressl_ver = f"LibreSSL {major:d}" + if major >= 3: + # 3.x uses 0xMNN00PP0L + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{patch:d}" else: - self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)), - (s, t, hex(n))) + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}" + self.assertTrue( + s.startswith((openssl_ver, libressl_ver)), + (s, t, hex(n)) + ) @support.cpython_only def test_refcycle(self): 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 index 00000000000..6878cea0323 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst @@ -0,0 +1 @@ +Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``. -- 2.46.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor