aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-04-12 23:36:20 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-04-13 11:36:20 +0800
commit19db013fa66fb4eb38e105e7fd46599aad51bf30 (patch)
tree21a736a289ef16e66470f0eb9dc60cff72e00ada /tests
parent020caf99a704e84217a61a99f15245edc7406239 (diff)
downloadcryptography-19db013fa66fb4eb38e105e7fd46599aad51bf30.tar.gz
cryptography-19db013fa66fb4eb38e105e7fd46599aad51bf30.tar.bz2
cryptography-19db013fa66fb4eb38e105e7fd46599aad51bf30.zip
Fixes #4830 -- handle negative serial numbers (#4843)
Diffstat (limited to 'tests')
-rw-r--r--tests/x509/test_x509.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/x509/test_x509.py b/tests/x509/test_x509.py
index 72cd49e7..afca9c5b 100644
--- a/tests/x509/test_x509.py
+++ b/tests/x509/test_x509.py
@@ -597,6 +597,14 @@ class TestRSACertificate(object):
cert.signature_algorithm_oid == SignatureAlgorithmOID.RSA_WITH_SHA1
)
+ def test_negative_serial_number(self, backend):
+ cert = _load_cert(
+ os.path.join("x509", "custom", "negative_serial.pem"),
+ x509.load_pem_x509_certificate,
+ backend,
+ )
+ assert cert.serial_number == -18008675309
+
def test_alternate_rsa_with_sha1_oid(self, backend):
cert = _load_cert(
os.path.join("x509", "alternate-rsa-sha1-oid.pem"),