aboutsummaryrefslogtreecommitdiff
path: root/asn1crypto/x509.py
diff options
context:
space:
mode:
authorwbond <will@wbond.net>2016-11-23 06:54:42 -0500
committerwbond <will@wbond.net>2016-11-23 06:54:42 -0500
commita01911d8880b744c5267aee7e7ed8b2ddbe3ac46 (patch)
treecb5102012fb67b67ff7c82ee06e48e41c08b3e3a /asn1crypto/x509.py
parentb12f07352074b334558d143ce4e4e896ee93640d (diff)
downloadasn1crypto-a01911d8880b744c5267aee7e7ed8b2ddbe3ac46.tar.gz
Ensure x509.Name.build() accepts dotted form of well-known OIDs also
Diffstat (limited to 'asn1crypto/x509.py')
-rw-r--r--asn1crypto/x509.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/asn1crypto/x509.py b/asn1crypto/x509.py
index 6eb4d46..8782fce 100644
--- a/asn1crypto/x509.py
+++ b/asn1crypto/x509.py
@@ -502,6 +502,8 @@ class NameType(ObjectIdentifier):
An orderable value.
"""
+
+ attr_name = cls.map(attr_name)
if attr_name in cls.preferred_order:
ordinal = cls.preferred_order.index(attr_name)
else:
@@ -894,7 +896,7 @@ class Name(Choice):
encoding_name = 'printable_string'
encoding_class = PrintableString
- # Sort the attributes according to NameType.preferred_order.
+ # Sort the attributes according to NameType.preferred_order
name_dict = OrderedDict(
sorted(
name_dict.items(),
@@ -903,6 +905,7 @@ class Name(Choice):
)
for attribute_name, attribute_value in name_dict.items():
+ attribute_name = NameType.map(attribute_name)
if attribute_name == 'email_address':
value = EmailAddress(attribute_value)
elif attribute_name == 'domain_component':