aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dev-requirements.txt2
-rw-r--r--setup.py2
-rw-r--r--tests/test_x509.py26
-rw-r--r--tox.ini2
4 files changed, 17 insertions, 15 deletions
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 2c0ca18c..f6eec132 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,4 +1,3 @@
-asn1crypto
coverage
flake8
flake8-import-order
@@ -6,6 +5,7 @@ invoke
iso8601
pep8-naming
pretend
+pyasn1_modules
pytest
requests
sphinx
diff --git a/setup.py b/setup.py
index d54afc02..19f1e663 100644
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,7 @@ test_requirements = [
"pretend",
"iso8601",
"hypothesis",
- "asn1crypto",
+ "pyasn1_modules",
]
# If there's no vectors locally that probably means we are in a tarball and
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 1fa4d82a..79424752 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -9,7 +9,9 @@ import datetime
import ipaddress
import os
-from asn1crypto import core, x509 as asn1cryptox509
+from pyasn1.codec.der import decoder
+
+from pyasn1_modules import rfc2459
import pytest
@@ -861,17 +863,17 @@ class TestRSACertificateRequest(object):
cert = builder.sign(issuer_private_key, hashes.SHA256(), backend)
- parsedasn1 = asn1cryptox509.Certificate.load(
- cert.public_bytes(serialization.Encoding.DER)
- )
- assert isinstance(
- parsedasn1.subject.chosen[0][0]['value'].chosen,
- core.PrintableString
- )
- assert isinstance(
- parsedasn1.subject.chosen[1][0]['value'].chosen,
- core.UTF8String
- )
+ parsed, _ = decoder.decode(
+ cert.public_bytes(serialization.Encoding.DER),
+ asn1Spec=rfc2459.Certificate()
+ )
+ tbs_cert = parsed.getComponentByName('tbsCertificate')
+ subject = tbs_cert.getComponentByName('subject')
+ issuer = tbs_cert.getComponentByName('issuer')
+ # \x13 is printable string. The first byte of the value of the
+ # node corresponds to the ASN.1 string type.
+ assert str(subject[0][0][0][1])[0] == "\x13"
+ assert str(issuer[0][0][0][1])[0] == "\x13"
class TestCertificateBuilder(object):
diff --git a/tox.ini b/tox.ini
index 820eccf3..35dc5671 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,7 @@ deps =
pretend
pytest
hypothesis>=1.11.4
- asn1crypto
+ pyasn1_modules
./vectors
passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
commands =