Skip to content

Add X509::Name#to_utf8 and #inspect#143

Merged
rhenium merged 4 commits into
ruby:masterfrom
rhenium:ky/x509name-to-utf-8
Sep 3, 2017
Merged

Add X509::Name#to_utf8 and #inspect#143
rhenium merged 4 commits into
ruby:masterfrom
rhenium:ky/x509name-to-utf-8

Conversation

@rhenium

@rhenium rhenium commented Sep 3, 2017

Copy link
Copy Markdown
Member

Closes #26.

Allow string literals containing UTF-8 characters.
Extract the body into a function in preparation for adding #to_utf8.

Also a potential memory leak is fixed: the GetX509Name() macro can
raise TypeError.
The existing #to_s does not interact well with distinguished names
containing multi-byte UTF-8 characters since the OpenSSL function
X509_NAME_print_ex() escapes bytes with MSB set by default.

Unfortunately we can't fix it without breaking backwards compatibility.
It takes options as a bit field that is directly passed to
X509_NAME_print_ex(). Let's add a new method instead.

Fixes: ruby#26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant