diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-27 22:03:37 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-27 22:03:37 (GMT) |
commit | 4c7bcf119431c1752b2f0c41e347b6cd18907fc3 (patch) | |
tree | 09956ebcfa3bbdb28a479905d4a2411ff8ee13ba /Lib/test/test_ssl.py | |
parent | 9751472001bbe25095ac6635353606c2fe443d1f (diff) | |
download | cpython-4c7bcf119431c1752b2f0c41e347b6cd18907fc3.zip cpython-4c7bcf119431c1752b2f0c41e347b6cd18907fc3.tar.gz cpython-4c7bcf119431c1752b2f0c41e347b6cd18907fc3.tar.bz2 |
Issue #8086: In :func:`ssl.DER_cert_to_PEM_cert()`, fix missing newline
before the certificate footer. Patch by Kyle VanderBeek.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 7c32c1b..feb6f50 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -113,6 +113,10 @@ class BasicTests(unittest.TestCase): p2 = ssl.DER_cert_to_PEM_cert(d1) d2 = ssl.PEM_cert_to_DER_cert(p2) self.assertEqual(d1, d2) + if not p2.startswith(ssl.PEM_HEADER + '\n'): + self.fail("DER-to-PEM didn't include correct header:\n%r\n" % p2) + if not p2.endswith('\n' + ssl.PEM_FOOTER + '\n'): + self.fail("DER-to-PEM didn't include correct footer:\n%r\n" % p2) def test_openssl_version(self): n = ssl.OPENSSL_VERSION_NUMBER |