MCPcopy Index your code
hub / github.com/python/cpython / test_parse_cert_CVE_2013_4238

Method test_parse_cert_CVE_2013_4238

Lib/test/test_ssl.py:533–560  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

531 )
532
533 def test_parse_cert_CVE_2013_4238(self):
534 p = ssl._ssl._test_decode_cert(NULLBYTECERT)
535 if support.verbose:
536 sys.stdout.write("\n" + pprint.pformat(p) + "\n")
537 subject = ((('countryName', 'US'),),
538 (('stateOrProvinceName', 'Oregon'),),
539 (('localityName', 'Beaverton'),),
540 (('organizationName', 'Python Software Foundation'),),
541 (('organizationalUnitName', 'Python Core Development'),),
542 (('commonName', 'null.python.org\x00example.org'),),
543 (('emailAddress', 'python-dev@python.org'),))
544 self.assertEqual(p['subject'], subject)
545 self.assertEqual(p['issuer'], subject)
546 if ssl._OPENSSL_API_VERSION >= (0, 9, 8):
547 san = (('DNS', 'altnull.python.org\x00example.com'),
548 ('email', 'null@python.org\x00user@example.org'),
549 ('URI', 'http://null.python.org\x00http://example.org'),
550 ('IP Address', '192.0.2.1'),
551 ('IP Address', '2001:DB8:0:0:0:0:0:1'))
552 else:
553 # OpenSSL 0.9.7 doesn't support IPv6 addresses in subjectAltName
554 san = (('DNS', 'altnull.python.org\x00example.com'),
555 ('email', 'null@python.org\x00user@example.org'),
556 ('URI', 'http://null.python.org\x00http://example.org'),
557 ('IP Address', '192.0.2.1'),
558 ('IP Address', '<invalid>'))
559
560 self.assertEqual(p['subjectAltName'], san)
561
562 def test_parse_all_sans(self):
563 p = ssl._ssl._test_decode_cert(ALLSANFILE)

Callers

nothing calls this directly

Calls 3

pformatMethod · 0.80
writeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected