Skip to content

Commit

Permalink
Merge pull request #234 from reaperhulk/utf8-time
Browse files Browse the repository at this point in the history
set string mask utf8only
  • Loading branch information
hynek committed Apr 15, 2015
2 parents 0959cb6 + fdca95d commit fa0a04b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
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 <hs@ox.cx>
2015-04-15 Paul Kehrer <paul.l.kehrer@gmail.com>

* 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 <hs@ox.cx>

* 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

0 comments on commit fa0a04b

Please sign in to comment.