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

strongswan: include curl plugin by default #39506

Merged
merged 1 commit into from Apr 30, 2018
Merged

Conversation

benley
Copy link
Member

@benley benley commented Apr 25, 2018

Motivation for this change

This is necessary for OCSP and/or remote CRL verification of server
certificates to work, which is a fairly common thing to need.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: strongswan

Partial log (click to expand)

post-installation fixup
gzipping man pages under /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/share/man/
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/lib  /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/libexec  /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/bin  /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/sbin
patching script interpreter paths in /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2
/nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/sbin/ipsec: interpreter directive changed from " /bin/sh" to "/nix/store/adw9jx59wnrh5659wz43nbjya3m4b3gl-bash-4.4-p19/bin/sh"
/nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/libexec/ipsec/_updown: interpreter directive changed from "/bin/sh" to "/nix/store/adw9jx59wnrh5659wz43nbjya3m4b3gl-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2...
moving /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/sbin/* to /nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2/bin
/nix/store/mrir202zdxbn8cydzjh8xbrpl50bcy6d-strongswan-5.6.2

@benley
Copy link
Member Author

benley commented Apr 26, 2018

cc @basvandijk @ryantm @erickg @dhess, does this look reasonable to you?

@ghost
Copy link

ghost commented Apr 26, 2018

IMHO it makes sense and it is a sensible common enough case 👍

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: strongswan

Partial log (click to expand)

post-installation fixup
gzipping man pages under /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/lib  /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/libexec  /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/bin  /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/sbin
patching script interpreter paths in /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2
/nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/libexec/ipsec/_updown: interpreter directive changed from "/bin/sh" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/sh"
/nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/sbin/ipsec: interpreter directive changed from " /bin/sh" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2...
moving /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/sbin/* to /nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2/bin
/nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2

@basvandijk
Copy link
Member

According to https://wiki.strongswan.org/projects/strongswan/wiki/Curl, you either need to pass --enable-openssl or --enable-gcrypt depending on which crypto backend curl is using.

How can we detect which crypto backend curl is using? I see the curl derivation is putting sslSupport in its passthru:

https://github.com/NixOS/nixpkgs/blob/136403655c15b830fff4f58fd90b3e1478c7ba30/pkgs/tools/networking/curl/default.nix

Maybe we could put gnutlsSupport there as well and check for it in the strongswan derivation.

@benley
Copy link
Member Author

benley commented Apr 27, 2018

It looks like we're already setting --enable-openssl, and it's working on my system at least. Is the curl backend likely to change unexpectedly?

@basvandijk
Copy link
Member

Note that users can override curl's crypto backend using:

curl.override { gnutlsSupport = true; sslSupport = false; };

This happens in a few places in nixpkgs. I'm not sure how common this is in users configs. But it should be easy to detect using my proposed method.

@benley
Copy link
Member Author

benley commented Apr 28, 2018

OK, I've added the requested changes - curl includes gnutlsSupport in its passthru data, and strongswan matches its --enable-openssl/--enable-gcrypt flags to what curl does. Look good?

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: curl, strongswan

Partial log (click to expand)

gzipping man pages under /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/lib  /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/libexec  /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/bin  /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/sbin
patching script interpreter paths in /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2
/nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/libexec/ipsec/_updown: interpreter directive changed from "/bin/sh" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/sh"
/nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/sbin/ipsec: interpreter directive changed from " /bin/sh" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2...
moving /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/sbin/* to /nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2/bin
/nix/store/0bh7i8xlw19vdz5yw66farn0ab92v189-curl-7.59.0-bin
/nix/store/61jwr0w73pzqf4lhb4125nw6ldkiw1ps-strongswan-5.6.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: curl, strongswan

Partial log (click to expand)

gzipping man pages under /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/share/man/
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/lib  /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/libexec  /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/bin  /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/sbin
patching script interpreter paths in /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2
/nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/sbin/ipsec: interpreter directive changed from " /bin/sh" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/sh"
/nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/libexec/ipsec/_updown: interpreter directive changed from "/bin/sh" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2...
moving /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/sbin/* to /nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2/bin
/nix/store/32y95ccbc4whx77r50sha8kj51j00qv5-curl-7.59.0-bin
/nix/store/2vl2dq8gn748gv3si8hpx9ri84xkrddn-strongswan-5.6.2

@basvandijk
Copy link
Member

Unfortunately the following fails:

$ nix-build --no-out-link -E 'let pkgs = import ./. {}; in pkgs.strongswan.override {curl = pkgs.curl.override {sslSupport = false; gnutlsSupport = true;};}'
...
checking for ldns/ldns.h... no
configure: error: UNBOUND header ldns/ldns.h not found!

I'm trying to get the strongswan gcrypt plugin to work on the strongswan-curl-gcrypt branch but I'm failing so far:

$ nix-build --no-out-link -E 'let pkgs = import ./. {}; in pkgs.strongswan.override {enableGCrypt = true;}'
...
checking for gcry_control in -lgcrypt... no
configure: error: gcrypt library not found

Maybe it's better for now to go with your first commit (93031e5) and fix the gcrypt situation later...

@benley
Copy link
Member Author

benley commented Apr 29, 2018

Maybe it's better for now to go with your first commit (93031e5) and fix the gcrypt situation later...

OK. I'll add a note in strongswan/default.nix about it too.

This is necessary for OCSP and/or remote CRL verification of server
certificates to work, which is a fairly common thing to need.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: strongswan

Partial log (click to expand)

/nix/store/rq9n923wf6r2jbm1j1hc27f7wfz36r66-strongswan-5.6.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: strongswan

Partial log (click to expand)

post-installation fixup
gzipping man pages under /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/share/man/
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/lib  /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/libexec  /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/bin  /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/sbin
patching script interpreter paths in /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2
/nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/sbin/ipsec: interpreter directive changed from " /bin/sh" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/sh"
/nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/libexec/ipsec/_updown: interpreter directive changed from "/bin/sh" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2...
moving /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/sbin/* to /nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2/bin
/nix/store/h5n2a3dby9alljia54w9k0m74wd568lj-strongswan-5.6.2

@benley benley merged commit 1022dc5 into NixOS:master Apr 30, 2018
@benley benley deleted the strongswan-curl branch April 30, 2018 17:28
Synthetica9 pushed a commit to Synthetica9/nixpkgs that referenced this pull request May 3, 2018
This is necessary for OCSP and/or remote CRL verification of server
certificates to work, which is a fairly common thing to need.
basvandijk pushed a commit to LumiGuide/nixpkgs that referenced this pull request Jun 24, 2018
This is necessary for OCSP and/or remote CRL verification of server
certificates to work, which is a fairly common thing to need.

(cherry picked from commit 1022dc5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants