Skip to content

Commit

Permalink
Change X509_NAME_oneline for X509_NAME_print_ex [Fixes pyca#745]
Browse files Browse the repository at this point in the history
Additionally, makes stringified part conformant to RFC2253
  • Loading branch information
Joshua Crowgey committed Mar 28, 2018
1 parent 57c2f03 commit e7d62e2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,10 @@ def __repr__(self):
"""
String representation of an X509Name
"""
result_buffer = _ffi.new("char[]", 512)
format_result = _lib.X509_NAME_oneline(
self._name, result_buffer, len(result_buffer))
_openssl_assert(format_result != _ffi.NULL)

bio = _new_mem_buf()
res = _lib.X509_NAME_print_ex(bio, self._name, 0, _lib.XN_FLAG_RFC2253)
return "<X509Name object '%s'>" % (
_native(_ffi.string(result_buffer)),)
_native(_bio_to_string(bio)),)

def hash(self):
"""
Expand Down

0 comments on commit e7d62e2

Please sign in to comment.