From 2232838441d31d8afa49108fcf064a0acf19b390 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Tue, 14 Jun 2022 21:59:58 +0000 Subject: [PATCH] Bug 1774012 [wpt PR 34401] - wptserve: Allow OpenSSL 3.x.y+ in http2 compatibility check., a=testonly Automatic update from web-platform-tests wptserve: Allow OpenSSL 3.x.y+ in http2 compatibility check. We were being overly strict with the version checks and preventing OpenSSL 3.0.0+ (the release following 1.1.1) from working. Explain the changes in OpenSSL's versioning scheme across releases and try to make the version check easier to read. -- wpt-commits: ebd8e2e65c525307908a824c947f1a41ab770e28 wpt-pr: 34401 --- .../web-platform/tests/tools/wptserve/wptserve/utils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/utils.py b/testing/web-platform/tests/tools/wptserve/wptserve/utils.py index ef8786a77404..a592e416376e 100644 --- a/testing/web-platform/tests/tools/wptserve/wptserve/utils.py +++ b/testing/web-platform/tests/tools/wptserve/wptserve/utils.py @@ -179,5 +179,17 @@ def http2_compatible() -> bool: 'OpenSSL (found: %s)' % ssl.OPENSSL_VERSION) return True + # Note that OpenSSL's versioning scheme differs between 1.1.1 and + # earlier and 3.0.0. ssl.OPENSSL_VERSION_INFO returns a + # (major, minor, 0, patch, 0) + # tuple with OpenSSL 3.0.0 and later, and a + # (major, minor, fix, patch, status) + # tuple for older releases. + # Semantically, "patch" in 3.0.0+ is similar to "fix" in previous versions. + # + # What we do in the check below is allow OpenSSL 3.x.y+, 1.1.x+ and 1.0.2+. ssl_v = ssl.OPENSSL_VERSION_INFO - return ssl_v[0] == 1 and (ssl_v[1] == 1 or (ssl_v[1] == 0 and ssl_v[2] >= 2)) + return (ssl_v[0] > 1 or + (ssl_v[0] == 1 and + (ssl_v[1] == 1 or + (ssl_v[1] == 0 and ssl_v[2] >= 2)))) -- 2.11.4.GIT