git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #5440 from ip1981/strongswan

Patches to Strongswan

commit4bb1e611a2ac12ceb309566e44a172149aeb7539 authorPeter Simons <simons@cryp.to> dateTue 23 Dec 2014, 13:02 (12 years ago) parentcbe0a8117d8029
7 files changed+83−6
nixos/modules/services/networking/strongswan.nix+1−1 pkgs/build-support/setup-hooks/autoreconf.sh+2−2 pkgs/tools/networking/strongswan/default.nix+8−2 pkgs/tools/networking/strongswan/ext_auth-path.patch+13 pkgs/tools/networking/strongswan/firewall_defaults.patch+32 pkgs/tools/networking/strongswan/updown-path.patch+26 pkgs/top-level/all-packages.nix+1−1
nixos/modules/services/networking/strongswan.nix+1−1
@@ -118,7 +118,7 @@ in
118118 systemd.services.strongswan = {
119119 description = "strongSwan IPSec Service";
120120 wantedBy = [ "multi-user.target" ];
121− path = with pkgs; [ kmod ]; # XXX Linux
121+ path = with pkgs; [ kmod iproute iptables utillinux ]; # XXX Linux
122122 wants = [ "keys.target" ];
123123 after = [ "network.target" "keys.target" ];
124124 environment = {
pkgs/build-support/setup-hooks/autoreconf.sh+2−2
@@ -1,11 +1,11 @@
11preConfigurePhases+=" autoreconfPhase"
22
3−for i in @autoconf@ @automake@ @libtool@; do
3+for i in @autoconf@ @automake@ @libtool@ @gettext@; do
44 findInputs $i nativePkgs propagated-native-build-inputs
55done
66
77autoreconfPhase() {
88 runHook preAutoreconf
9− autoreconf ${autoreconfFlags:---install --force}
9+ autoreconf ${autoreconfFlags:---install --force --verbose}
1010 runHook postAutoreconf
1111}
pkgs/tools/networking/strongswan/default.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, gmp, pkgconfig, python }:
1+{ stdenv, fetchurl, gmp, pkgconfig, python, autoreconfHook }:
22
33stdenv.mkDerivation rec {
44 name = "strongswan-5.2.1";
@@ -10,7 +10,13 @@ stdenv.mkDerivation rec {
1010
1111 dontPatchELF = true;
1212
13− buildInputs = [ gmp pkgconfig python ];
13+ buildInputs = [ gmp pkgconfig python autoreconfHook ];
14+
15+ patches = [
16+ ./ext_auth-path.patch
17+ ./firewall_defaults.patch
18+ ./updown-path.patch
19+ ];
1420
1521 configureFlags = [ "--enable-swanctl" "--enable-cmd" ];
1622
pkgs/tools/networking/strongswan/ext_auth-path.patchnew file+13
@@ -0,0 +1,13 @@
1+Index: strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c
2+===================================================================
3+--- strongswan-5.2.1.orig/src/libcharon/plugins/ext_auth/ext_auth_listener.c
4++++ strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c
5+@@ -101,6 +101,8 @@ METHOD(listener_t, authorize, bool,
6+
7+ *success = FALSE;
8+
9++ push_env(envp, countof(envp), "PATH=%s", getenv("PATH"));
10++
11+ push_env(envp, countof(envp), "IKE_UNIQUE_ID=%u",
12+ ike_sa->get_unique_id(ike_sa));
13+ push_env(envp, countof(envp), "IKE_NAME=%s",
pkgs/tools/networking/strongswan/firewall_defaults.patchnew file+32
@@ -0,0 +1,32 @@
1+Index: strongswan-5.2.1/src/starter/confread.c
2+===================================================================
3+--- strongswan-5.2.1.orig/src/starter/confread.c
4++++ strongswan-5.2.1/src/starter/confread.c
5+@@ -43,7 +43,7 @@
6+ static const char ike_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536";
7+ static const char esp_defaults[] = "aes128-sha1,3des-sha1";
8+
9+-static const char firewall_defaults[] = IPSEC_SCRIPT " _updown iptables";
10++static const char firewall_defaults[] = IPSEC_SBINDIR "/" IPSEC_SCRIPT " _updown iptables";
11+
12+ /**
13+ * Provided by GPERF
14+Index: strongswan-5.2.1/src/starter/Makefile.am
15+===================================================================
16+--- strongswan-5.2.1.orig/src/starter/Makefile.am
17++++ strongswan-5.2.1/src/starter/Makefile.am
18+@@ -18,10 +18,12 @@ AM_CPPFLAGS = \
19+ -I$(top_srcdir)/src/libhydra \
20+ -I$(top_srcdir)/src/starter \
21+ -I$(top_srcdir)/src/stroke \
22+- -DIPSEC_DIR=\"${ipsecdir}\" \
23++ -DIPSEC_BINDIR=\"${bindir}\" \
24+ -DIPSEC_CONFDIR=\"${sysconfdir}\" \
25+- -DIPSEC_PIDDIR=\"${piddir}\" \
26++ -DIPSEC_DIR=\"${ipsecdir}\" \
27+ -DIPSEC_EAPDIR=\"${eapdir}\" \
28++ -DIPSEC_PIDDIR=\"${piddir}\" \
29++ -DIPSEC_SBINDIR=\"${sbindir}\" \
30+ -DIPSEC_SCRIPT=\"${ipsec_script}\" \
31+ -DDEV_RANDOM=\"${random_device}\" \
32+ -DDEV_URANDOM=\"${urandom_device}\" \
pkgs/tools/networking/strongswan/updown-path.patchnew file+26
@@ -0,0 +1,26 @@
1+Index: strongswan-5.2.1/src/_updown/_updown.in
2+===================================================================
3+--- strongswan-5.2.1.orig/src/_updown/_updown.in
4++++ strongswan-5.2.1/src/_updown/_updown.in
5+@@ -125,7 +125,7 @@
6+ #
7+
8+ # define a minimum PATH environment in case it is not set
9+-PATH="/sbin:/bin:/usr/sbin:/usr/bin:@sbindir@"
10++PATH="${PATH:-/sbin:/bin:/usr/sbin:/usr/bin}"
11+ export PATH
12+
13+ # uncomment to log VPN connections
14+Index: strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c
15+===================================================================
16+--- strongswan-5.2.1.orig/src/libcharon/plugins/updown/updown_listener.c
17++++ strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c
18+@@ -240,6 +240,8 @@ static void invoke_once(private_updown_l
19+ process_t *process;
20+ char *envp[128] = {};
21+
22++ push_env(envp, countof(envp), "PATH=%s", getenv("PATH"));
23++
24+ me = ike_sa->get_my_host(ike_sa);
25+ other = ike_sa->get_other_host(ike_sa);
26+
pkgs/top-level/all-packages.nix+1−1
@@ -252,7 +252,7 @@ let
252252 };
253253
254254 autoreconfHook = makeSetupHook
255− { substitutions = { inherit autoconf automake libtool; }; }
255+ { substitutions = { inherit autoconf automake libtool gettext; }; }
256256 ../build-support/setup-hooks/autoreconf.sh;
257257
258258 buildEnv = import ../build-support/buildenv {