diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2016-03-07 19:37:49 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2016-03-20 22:11:33 +0100 |
commit | 55ba80b2271d21794607bbf5146b115e0b49550f (patch) | |
tree | a2cd1705da4e16c861881a5d87c5e6d98803551a /tests/test_x509.py | |
parent | 3452f70013c02c88cd1fd11e9ae7b8c39757b502 (diff) | |
download | m2crypto-55ba80b2271d21794607bbf5146b115e0b49550f.tar.gz |
Throw an exception when an unhandled date value is found in a certificate.
Fixes #103
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r-- | tests/test_x509.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py index 5b4869e..4e0f9b9 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -545,7 +545,13 @@ class X509TestCase(unittest.TestCase): cert = X509.load_cert('tests/thawte.pem') self.assertEqual(cert.get_serial_number(), - 127614157056681299805556476275995414779) + 127614157056681299805556476275995414779) + + def test_date_after_2050_not_working(self): + cert = X509.load_cert('tests/bad_date_cert.crt') + with self.assertRaises(X509.X509Error): + cert.get_not_after() + class X509StackTestCase(unittest.TestCase): def test_make_stack_from_der(self): |