Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set string mask utf8only #234

Merged
merged 3 commits into from
Apr 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
2011-09-02 Hynek Schlawack <[email protected]>
2015-04-15 Paul Kehrer <[email protected]>

* OpenSSL/crypto.py, OpenSSL/test/test_crypto.py: Switch to utf8string
mask by default. OpenSSL formerly defaulted to a T61String if there
were UTF-8 characters present. This was changed to default to
UTF8String in the config around 2005, but the actual code didn't
change it until late last year. This will default us to the setting
that actually works. To revert this you can call
crypto._lib.ASN1_STRING_set_default_mask_asc(b"default")

2015-04-14 Hynek Schlawack <[email protected]>

* Release 0.15.1

Expand Down
6 changes: 6 additions & 0 deletions OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2637,3 +2637,9 @@ def locking_function(mode, index, filename, line):
# This is similar but exercised mainly by exception_from_error_queue. It calls
# both ERR_load_crypto_strings() and ERR_load_SSL_strings().
_lib.SSL_load_error_strings()



# Set the default string mask to match OpenSSL upstream (since 2005) and
# RFC5280 recommendations.
_lib.ASN1_STRING_set_default_mask_asc(b'utf8only')
2 changes: 1 addition & 1 deletion OpenSSL/test/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def test_der(self):
self.assertEqual(
a.der(),
b('0\x1b1\x0b0\t\x06\x03U\x04\x06\x13\x02US'
'1\x0c0\n\x06\x03U\x04\x03\x13\x03foo'))
'1\x0c0\n\x06\x03U\x04\x03\x0c\x03foo'))


def test_get_components(self):
Expand Down