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

cmake: rework NSS and SSL #9831

Merged
merged 2 commits into from Jun 29, 2016
Merged

cmake: rework NSS and SSL #9831

merged 2 commits into from Jun 29, 2016

Conversation

mattbenjamin
Copy link
Contributor

The cmake build should select NSS or CryptoPP consistently with
current automake logic, as used in our RHEL builds (-DWITH_NSS),
and the SSL linkage must match (for NSS, -lssl3).

With this change, there is no direct linkage with libssl when NSS
is selected (I still see indirect linkage, looking into that).

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

@mattbenjamin mattbenjamin changed the title [DNM] cmake: rework NSS and SSL cmake: rework NSS and SSL Jun 21, 2016
set(USE_NSS 0)
set(USE_CRYPTOPP 1)
else()
MESSAGE(STATUS "Cryptopp not found using NSS instead")
Copy link
Contributor

Choose a reason for hiding this comment

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

this message doesn't appear to be true any more. should the find_package(cryptopp) be REQUIRED so we fail in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This needs to fail if cryptopp is not found, now. (Will push an update.)

option(WITH_NSS "Use NSS crypto and SSL implementations" OFF)
if (${WITH_NSS})
find_package(NSS REQUIRED)
if(NSS_FOUND)
Copy link
Contributor

Choose a reason for hiding this comment

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

if nss is not found, cmake will bail out with the default error message, so no need to check NSS_FOUND here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now that it is required, that's true

@tchaikov tchaikov removed their assignment Jun 23, 2016
@tchaikov
Copy link
Contributor

needs rebase.

@mattbenjamin
Copy link
Contributor Author

I'll clean up and rebase tomorrow

@liewegas
Copy link
Member

liewegas commented Jun 27, 2016 via email

@mattbenjamin
Copy link
Contributor Author

I'd really rather not dispose of SSL and Crypto choice--I guess if I want that, I need to fix gitbuilders? In the interest of that, how does that check cryptopp, check nss fail?

@liewegas
Copy link
Member

liewegas commented Jun 27, 2016 via email

@mattbenjamin
Copy link
Contributor Author

mattbenjamin commented Jun 27, 2016

ok, makes sense--if you can wait till midday EST tomorrow, I can retest and push it then? (I guess I could sequence after the zap-cryptopp change, for that matter, if you prefer, I don't think it matters to history); I admit I never consciously used cryptopp, either--but I'm more inclined to think folks may wish to use openssl

@liewegas
Copy link
Member

liewegas commented Jun 27, 2016 via email

@mattbenjamin
Copy link
Contributor Author

Ok, still testing this, but, in addition to requested cleanups, NSS is now the default for cmake and automake builds.

@mattbenjamin
Copy link
Contributor Author

Re-pushed--previous set had unintended changes to some generated m4 files.

@tchaikov
Copy link
Contributor

@mattbenjamin i am very sorry that i merged unrelated changes into master by mistake, so your changeset conflicts with sage's commit i merged. i have a PR reverting them.

i just tested your changeset, both autotools and cmake builds work great.

lgtm

@mattbenjamin
Copy link
Contributor Author

@tchaikov no problem, would it be easier if I rebased?

The cmake build should select NSS or CryptoPP consistently with
current autoconf logic, as used in our RHEL builds (-DWITH_NSS),
and the SSL linkage must match (for NSS, -lssl3).

With this change, there is no direct linkage with libssl when NSS
is selected (I still see indirect linkage via libcurl, in turn
via libssh2, looking into that).

With guidance from upstream and downstream, NSS builds are now
selected by default.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This change mainly intends to prevent linking with libssl when the
crypto provider is NSS, which provides an SSL implementation (the
implementation we must use and prefer when NSS is selected).

Secondarily, actually detect openssl when it is selected, which
happens by default and co-selects with cryptopp.  To do this, we
import the ax_check_openssl.m4 from the automake archive.

Since upstream builds now prefer NSS crypto, make this the default.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants