]> granicus.if.org Git - python/commitdiff
Issue #21976: Fix test_ssl to accept LibreSSL version strings.
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 21 Jul 2014 22:35:01 +0000 (18:35 -0400)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 21 Jul 2014 22:35:01 +0000 (18:35 -0400)
Thanks to William Orr.

Lib/test/test_ssl.py
Misc/ACKS
Misc/NEWS

index 37a0cdb7c28c06c5a26b08c5ceae82fd07e8c251..91b8029d049520a5f56a0a0dbfa34dcc93eafa44 100644 (file)
@@ -175,11 +175,11 @@ class BasicSocketTests(unittest.TestCase):
         # Some sanity checks follow
         # >= 0.9
         self.assertGreaterEqual(n, 0x900000)
-        # < 2.0
-        self.assertLess(n, 0x20000000)
+        # < 3.0
+        self.assertLess(n, 0x30000000)
         major, minor, fix, patch, status = t
         self.assertGreaterEqual(major, 0)
-        self.assertLess(major, 2)
+        self.assertLess(major, 3)
         self.assertGreaterEqual(minor, 0)
         self.assertLess(minor, 256)
         self.assertGreaterEqual(fix, 0)
@@ -188,9 +188,13 @@ class BasicSocketTests(unittest.TestCase):
         self.assertLessEqual(patch, 26)
         self.assertGreaterEqual(status, 0)
         self.assertLessEqual(status, 15)
-        # Version string as returned by OpenSSL, the format might change
-        self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
-                        (s, t))
+        # Version string as returned by {Open,Libre}SSL, the format might change
+        if "LibreSSL" in s:
+            self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major, minor)),
+                            (s, t))
+        else:
+            self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
+                            (s, t))
 
     @test_support.requires_resource('network')
     def test_ciphers(self):
index 2dc0e779ddbabf746336fad43f3d4449a7e95374..7fcfae03e12994f1f013c56103a53d37f95d22dc 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -981,6 +981,7 @@ Piet van Oostrum
 Tomas Oppelstrup
 Jason Orendorff
 Douglas Orr
+William Orr
 Michele OrrĂ¹
 Oleg Oshmyan
 Denis S. Otkidach
index 0181a4614ee325f60c6ea21f25ab4751d879e20c..433b273c177f247657218bc37a71d1385d970558 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,12 @@ Library
 - Issue #21323: Fix CGIHTTPServer to again handle scripts in CGI subdirectories,
   broken by the fix for security issue #19435.  Patch by Zach Byrne.
 
+Tests
+-----
+
+- Issue #21976: Fix test_ssl to accept LibreSSL version strings.  Thanks
+  to William Orr.
+
 
 What's New in Python 2.7.8?
 ===========================