From 1b43b51599e4a3b39662b069af0140bf24ac3a43 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 11 Oct 2017 11:47:46 +0800 Subject: 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 --- tests/x509/test_x509.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/x509/test_x509.py') 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") ) ]) -- cgit v1.2.3