pyopenssl icon indicating copy to clipboard operation
pyopenssl copied to clipboard

Change X509_NAME_oneline for X509_NAME_print_ex [Fixes #745]

Open jcrowgey opened this issue 7 years ago • 4 comments

Additionally, makes stringified part conformant to RFC2253

jcrowgey avatar Mar 28 '18 18:03 jcrowgey

I don't expect CI to succeed until https://github.com/pyca/cryptography/pull/4174 is merged into cryptography.

jcrowgey avatar Mar 28 '18 18:03 jcrowgey

Codecov Report

Merging #746 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #746   +/-   ##
=======================================
  Coverage   97.05%   97.05%           
=======================================
  Files          18       18           
  Lines        5703     5703           
  Branches      395      395           
=======================================
  Hits         5535     5535           
  Misses        112      112           
  Partials       56       56
Impacted Files Coverage Δ
src/OpenSSL/crypto.py 96.86% <100%> (ø) :arrow_up:
tests/test_crypto.py 98.92% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 57c2f03...057c1c4. Read the comment docs.

codecov[bot] avatar Mar 28 '18 19:03 codecov[bot]

I have a bit of a selfish reason for this PR: I need to get formatted names out of certificates as provided by XN_FLAG_RFC2253. Now that https://github.com/pyca/cryptography/pull/4174 was merged, I have access to X509_NAME_print_ex and I can do-it-myself, so no real issues. I don't know if you guys have a need for XN_FLAG_ONELINE for some backwards compatibility in these reprs. Also, if it turns out that backwards compatibility does require XN_FLAG_ONELINE, would you guys accept a PR that X509Name._to_rfc2253() (or something along those lines)?

jcrowgey avatar Apr 10 '18 21:04 jcrowgey

Looks like this is failing CI because it's not finding the bindings from pyca/cryptography.

@reaperhulk helped me realize this wasn't the case. I was asserting the wrong thing which was causing the failure. I've updated this in the most recent commit.

Okay, as of 057c1c4 I believe the only tests which are failing in CI are the ones which don't have the bindings from pyca/cryptography#4174. Sorry for the messy commit schedule, looking forward to discussion of this PR.

jcrowgey avatar Apr 10 '18 21:04 jcrowgey

pyca/cryptography now addresses this with rfc4514_string on x509.Name.

alex avatar Sep 25 '22 14:09 alex