diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-07-30 13:08:51 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-07-30 12:08:51 -0500 |
commit | cdaf3ff72f6fd562c275c04836cfaa230aabcdf4 (patch) | |
tree | 8f1587293f9232d2d6ebbbfebd65f700ea93966b /src/cryptography/hazmat/backends/openssl/encode_asn1.py | |
parent | 2131b962c03c8787c8918f0672707cce3dca06f8 (diff) | |
download | cryptography-cdaf3ff72f6fd562c275c04836cfaa230aabcdf4.tar.gz cryptography-cdaf3ff72f6fd562c275c04836cfaa230aabcdf4.tar.bz2 cryptography-cdaf3ff72f6fd562c275c04836cfaa230aabcdf4.zip |
Begin the deprecation of auto-idna for x509.DNSName (#3830)
* Begin the deprecation of auto-idna for x509.DNSName
Refs #3357
* fix warning
* py3k fixes
* fix docs
* sigh
* flake8
* these are words
* words
* tests for coverage
* another test
* do idna things
* more idna things
Diffstat (limited to 'src/cryptography/hazmat/backends/openssl/encode_asn1.py')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/encode_asn1.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/encode_asn1.py b/src/cryptography/hazmat/backends/openssl/encode_asn1.py index 399000a4..77d22127 100644 --- a/src/cryptography/hazmat/backends/openssl/encode_asn1.py +++ b/src/cryptography/hazmat/backends/openssl/encode_asn1.py @@ -7,8 +7,6 @@ from __future__ import absolute_import, division, print_function import calendar import ipaddress -import idna - import six from cryptography import utils, x509 @@ -370,15 +368,6 @@ def _encode_subject_key_identifier(backend, ski): return _encode_asn1_str_gc(backend, ski.digest, len(ski.digest)) -def _idna_encode(value): - # Retain prefixes '*.' for common/alt names and '.' for name constraints - for prefix in ['*.', '.']: - if value.startswith(prefix): - value = value[len(prefix):] - return prefix.encode('ascii') + idna.encode(value) - return idna.encode(value) - - def _encode_general_name(backend, name): if isinstance(name, x509.DNSName): gn = backend._lib.GENERAL_NAME_new() @@ -387,7 +376,7 @@ def _encode_general_name(backend, name): ia5 = backend._lib.ASN1_IA5STRING_new() backend.openssl_assert(ia5 != backend._ffi.NULL) - value = _idna_encode(name.value) + value = name.bytes_value res = backend._lib.ASN1_STRING_set(ia5, value, len(value)) backend.openssl_assert(res == 1) |