aboutsummaryrefslogtreecommitdiffstats
path: root/tests/x509/test_x509.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-10-11 11:47:46 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2017-10-10 23:47:46 -0400
commit1b43b51599e4a3b39662b069af0140bf24ac3a43 (patch)
tree538c53bf09577ba436587ccfa2b53db7a1d8ef24 /tests/x509/test_x509.py
parentd3f73e0de5bf407f375c18b94f3f9535439ece3d (diff)
downloadcryptography-1b43b51599e4a3b39662b069af0140bf24ac3a43.tar.gz
cryptography-1b43b51599e4a3b39662b069af0140bf24ac3a43.tar.bz2
cryptography-1b43b51599e4a3b39662b069af0140bf24ac3a43.zip
backwards incompatible change to UniformResourceIdentifier (#3954)
* backwards incompatible change to UniformResourceIdentifier During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies URI to accept two types: U-label strings (which raises a deprecation warning) and A-label strings (the new preferred type). There is also a constructor for URI that bypasses validation so we can parse garbage out of certificates (and round trip it if necessary) * nonsense empty commit 2.6 and codecov are the worst
Diffstat (limited to 'tests/x509/test_x509.py')
-rw-r--r--tests/x509/test_x509.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/x509/test_x509.py b/tests/x509/test_x509.py
index d6aafcda..a07ffb3a 100644
--- a/tests/x509/test_x509.py
+++ b/tests/x509/test_x509.py
@@ -230,7 +230,7 @@ class TestCertificateRevocationList(object):
)
])
assert ian.value == x509.IssuerAlternativeName([
- x509.UniformResourceIdentifier(b"https://cryptography.io"),
+ x509.UniformResourceIdentifier(u"https://cryptography.io"),
])
def test_delta_crl_indicator(self, backend):
@@ -1628,7 +1628,7 @@ class TestCertificateBuilder(object):
aia = x509.AuthorityInformationAccess([
x509.AccessDescription(
x509.ObjectIdentifier("2.999.7"),
- x509.UniformResourceIdentifier(b"http://example.com")
+ x509.UniformResourceIdentifier(u"http://example.com")
),
])
@@ -2250,6 +2250,9 @@ class TestCertificateBuilder(object):
x509.RFC822Name._init_without_validation(
u'test@a\xedt\xe1s.test'
),
+ x509.UniformResourceIdentifier._init_without_validation(
+ u'http://a\xedt\xe1s.test'
+ ),
]
),
x509.CertificatePolicies([
@@ -3120,11 +3123,11 @@ class TestCertificateSigningRequestBuilder(object):
aia = x509.AuthorityInformationAccess([
x509.AccessDescription(
AuthorityInformationAccessOID.OCSP,
- x509.UniformResourceIdentifier(b"http://ocsp.domain.com")
+ x509.UniformResourceIdentifier(u"http://ocsp.domain.com")
),
x509.AccessDescription(
AuthorityInformationAccessOID.CA_ISSUERS,
- x509.UniformResourceIdentifier(b"http://domain.com/ca.crt")
+ x509.UniformResourceIdentifier(u"http://domain.com/ca.crt")
)
])