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

LibreSSL support #1679

Merged
merged 8 commits into from
Feb 19, 2015
Merged

LibreSSL support #1679

merged 8 commits into from
Feb 19, 2015

Conversation

reaperhulk
Copy link
Member

This PR replaces #1673, #1674, and #1636.

Huge thanks to @AnchorCat for the hard work. I've adapted the cryptodev and @Sp1l's EGD work to be a conditional binding. (Be aware that with EGD downstream consumers like pyOpenSSL may not work. I haven't tested.).

I've also added a libre builder to jenkins so if we choose to merge this we'll need to rebase all other PRs (and, conversely, if we choose to not merge this I need to remove that builder).

reaperhulk and others added 6 commits February 19, 2015 09:14
LibreSSL no longer uses compression in ssl.h, so the case that was
formerly activated by defining OPENSSL_NO_COMP is now the default, and
COMP_METHOD isn't defined (it's defined in comp.h, but that's no longer
included by ssl.h). In order to make all the type definitions here line
up with what's actually in LibreSSL's ssl.h, define COMP_METHOD as
void.

This definition is still compatible with the later type declaration in
ssl.py:

  typedef ... COMP_METHOD;
Some features added to newer OpenSSL versions are absent in LibreSSL,
so don't mark these as present if LIBRESSL_VERSION_NUMBER is defined.
LibreSSL aims to be source-compatible with OpenSSL, so there is no good
reason to fail this test simply because the name has changed.
This changelog entry represents the previous three commits, which all
fix compile- or test-time problems running against LibreSSL.
@alex
Copy link
Member

alex commented Feb 19, 2015

This PR looks on-ball to me. Will wait to see how the tests look.

@reaperhulk
Copy link
Member Author

I'll retest jenkins once it finishes failing. We can't run with -Werror due to deprecations around CRYPTO_dbg_* so I had to update the jenkins config.

@jenkins-cryptography
Copy link

Test FAILed.
Refer to this link for build results: https://jenkins.cryptography.io/job/cryptography-pr-experimental/2976/

@reaperhulk
Copy link
Member Author

retest this please

@jenkins-cryptography
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.cryptography.io/job/cryptography-pr-experimental/2977/

@alex
Copy link
Member

alex commented Feb 19, 2015

@reaperhulk besides the final reviewer, are there blockers infrastructure wise to merging this?

@reaperhulk
Copy link
Member Author

Once we're ready to merge we need to add the libre config to the cryptography-master job (it's only on pr-experimental at the moment). That's the only infra item left. Do we want anyone else to weigh in or is this ready?

*/
#ifdef LIBRESSL_VERSION_NUMBER
#define COMP_METHOD void
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should compression related be in CONDITIONAL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, although that starts to bleed into #1675 😀

I'll move this so we can merge today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, move what?

On Thu, Feb 19, 2015 at 2:53 PM, Paul Kehrer [email protected]
wrote:

In src/cryptography/hazmat/bindings/openssl/ssl.py
#1679 (comment):

@@ -7,6 +7,14 @@
INCLUDES = """
#include <openssl/ssl.h>

+/* LibreSSL has removed support for compression, and with it the

  • * COMP_METHOD use in ssl.h. This is a hack to make the function types
  • * in this code match those in ssl.h.
  • */
    +#ifdef LIBRESSL_VERSION_NUMBER
    +#define COMP_METHOD void
    +#endif

Yeah, although that starts to bleed into #1675
#1675 [image: 😀]

I'll move this so we can merge today.


Reply to this email directly or view it on GitHub
https://github.com/pyca/cryptography/pull/1679/files#r25019164.

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the COMP_METHOD definition.

@alex
Copy link
Member

alex commented Feb 19, 2015

Besides that one question, this LGTM.

@jenkins-cryptography
Copy link

Test FAILed.
Refer to this link for build results: https://jenkins.cryptography.io/job/cryptography-pr-experimental/2978/

@jenkins-cryptography
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.cryptography.io/job/cryptography-pr-experimental/2979/

alex added a commit that referenced this pull request Feb 19, 2015
@alex alex merged commit bae5a64 into pyca:master Feb 19, 2015
@AnchorCat
Copy link

Thanks! I've tested the latest master with tox on my OpenBSD -current system, and all tests pass with both python2.7 and python3.4 (just thought I'd confirm in case there were differences with LibreSSL portable).

Out of curiosity, I ran the pyOpenSSL test suite against this version, and got 3 failures and 6 errors (out of 397 tests). I've uploaded the failed test output in case anyone is interested in the details. I may look at fixing those if I have time, but pyOpenSSL is working well enough for my real-world use case (the python-glanceclient utility).

@reaperhulk reaperhulk deleted the libre-support branch February 20, 2015 00:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

4 participants