aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2015-06-24 19:31:26 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2015-06-24 19:31:26 -0500
commit87d61f8a6efdf1f9b0a0d6e8c59e323e6004ec72 (patch)
treee46a2555d3f9f46526cf333f911315b5ed1a5a91
parent8ed8edce1764ea17800ef83f422c7a73bfdfa74b (diff)
downloadcryptography-87d61f8a6efdf1f9b0a0d6e8c59e323e6004ec72.tar.gz
cryptography-87d61f8a6efdf1f9b0a0d6e8c59e323e6004ec72.tar.bz2
cryptography-87d61f8a6efdf1f9b0a0d6e8c59e323e6004ec72.zip
Use utf8 to encode attribute values instead of ascii
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index 7963b5d3..78de79d1 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -90,12 +90,12 @@ def _encode_name(backend, attributes):
subject = backend._lib.X509_NAME_new()
subject = backend._ffi.gc(subject, backend._lib.X509_NAME_free)
for attribute in attributes:
- value = attribute.value.encode('ascii')
+ value = attribute.value.encode('utf8')
obj = _txt2obj(backend, attribute.oid.dotted_string)
res = backend._lib.X509_NAME_add_entry_by_OBJ(
subject,
obj,
- backend._lib.MBSTRING_ASC,
+ backend._lib.MBSTRING_UTF8,
value,
-1, -1, 0,
)