1 |
commit: 75954cf504602db95aafcb1e80fe1e01b1f3ec22 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 17 10:19:31 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 17 10:19:46 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75954cf5 |
7 |
|
8 |
net-vpn/strongswan: security cleanup (bug #628606) |
9 |
|
10 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
net-vpn/strongswan/Manifest | 1 - |
14 |
net-vpn/strongswan/strongswan-5.5.3.ebuild | 302 ----------------------------- |
15 |
net-vpn/strongswan/strongswan-5.6.0.ebuild | 302 ----------------------------- |
16 |
3 files changed, 605 deletions(-) |
17 |
|
18 |
diff --git a/net-vpn/strongswan/Manifest b/net-vpn/strongswan/Manifest |
19 |
index dbe0b5b6b3d..b35b74232d7 100644 |
20 |
--- a/net-vpn/strongswan/Manifest |
21 |
+++ b/net-vpn/strongswan/Manifest |
22 |
@@ -1,4 +1,3 @@ |
23 |
-DIST strongswan-5.5.3.tar.bz2 4768820 BLAKE2B 9f9da6c2ef27cec7f6a07f1cd5a7ecc8a92576fad2a5c6379b93d8a2e9d3b0804fe26dc0bc7b303754ef499ee938549c7cafbdf9a3f8f818d14cf88f613fe0fd SHA512 0b0b25d2102c98cda54300dc8c3c3a49a55e64f7c695dda65a24f2194f19bce0b7aab9e4f7486c243b552f9d1a94867d6a8782ee504aad1c9973809706d599ac |
24 |
DIST strongswan-5.6.0.tar.bz2 4850722 BLAKE2B edb9f2b277cd8bccf886a824e4b3fb3c06af7510d9e21283fcb8d8ba9cf234f38182fcd1ca0c350b4039945ab10888406986d9a0b8edac24fe09faf0b8967fb2 SHA512 9362069a01c3642e62864d88fdb409a3c7514bf7c92cbe36e552c6a80915119cf5bb91c39592aab2d15b562684a0628a764e4fa7636d3b5fd2ebaf165c0ce649 |
25 |
DIST strongswan-5.6.2.tar.bz2 4977859 BLAKE2B 83943ec95e6b95724e9fc130a09f7c7364147d0ce50528ac8b64452db53516b143e92c7dcb746c0c25aaac9182dda14d55e5c267fbdcd5bb9a63cbf48801274b SHA512 cf2d5cb6c45d991fe0ad8eed4ea8628f95a1871e9728ddf0985aa26e78d1e6da1c92c961772aafd3e55cfcfa84516204a15561389d373f78140f05607b248c52 |
26 |
DIST strongswan-5.6.3.tar.bz2 4961579 BLAKE2B 177d9ca9a730c8ccb3293c9f1c1397429879177aef60c90a3561fffed64cd4fe18cdf1c74bd52956c576e061ce33935b7dc34864576edeac7d4824841b0ee3e0 SHA512 080402640952b1a08e95bfe9c7f33c6a7dd01ac401b5e7e2e78257c0f2bf0a4d6078141232ac62abfacef892c493f6824948b3165d54d72b4e436ed564fd2609 |
27 |
|
28 |
diff --git a/net-vpn/strongswan/strongswan-5.5.3.ebuild b/net-vpn/strongswan/strongswan-5.5.3.ebuild |
29 |
deleted file mode 100644 |
30 |
index 7cf43b5ece0..00000000000 |
31 |
--- a/net-vpn/strongswan/strongswan-5.5.3.ebuild |
32 |
+++ /dev/null |
33 |
@@ -1,302 +0,0 @@ |
34 |
-# Copyright 1999-2018 Gentoo Foundation |
35 |
-# Distributed under the terms of the GNU General Public License v2 |
36 |
- |
37 |
-EAPI=5 |
38 |
-inherit eutils linux-info systemd user |
39 |
- |
40 |
-DESCRIPTION="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE" |
41 |
-HOMEPAGE="http://www.strongswan.org/" |
42 |
-SRC_URI="http://download.strongswan.org/${P}.tar.bz2" |
43 |
- |
44 |
-LICENSE="GPL-2 RSA DES" |
45 |
-SLOT="0" |
46 |
-KEYWORDS="amd64 arm ppc ~ppc64 x86" |
47 |
-IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite pam pkcs11" |
48 |
- |
49 |
-STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici" |
50 |
-STRONGSWAN_PLUGINS_OPT="blowfish ccm ctr gcm ha ipseckey ntru padlock rdrand unbound whitelist" |
51 |
-for mod in $STRONGSWAN_PLUGINS_STD; do |
52 |
- IUSE="${IUSE} +strongswan_plugins_${mod}" |
53 |
-done |
54 |
- |
55 |
-for mod in $STRONGSWAN_PLUGINS_OPT; do |
56 |
- IUSE="${IUSE} strongswan_plugins_${mod}" |
57 |
-done |
58 |
- |
59 |
-COMMON_DEPEND="!net-misc/openswan |
60 |
- gmp? ( >=dev-libs/gmp-4.1.5:= ) |
61 |
- gcrypt? ( dev-libs/libgcrypt:0 ) |
62 |
- caps? ( sys-libs/libcap ) |
63 |
- curl? ( net-misc/curl ) |
64 |
- ldap? ( net-nds/openldap ) |
65 |
- openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] ) |
66 |
- mysql? ( virtual/mysql ) |
67 |
- sqlite? ( >=dev-db/sqlite-3.3.1 ) |
68 |
- networkmanager? ( net-misc/networkmanager ) |
69 |
- pam? ( sys-libs/pam ) |
70 |
- strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )" |
71 |
-DEPEND="${COMMON_DEPEND} |
72 |
- virtual/linux-sources |
73 |
- sys-kernel/linux-headers" |
74 |
-RDEPEND="${COMMON_DEPEND} |
75 |
- virtual/logger |
76 |
- sys-apps/iproute2 |
77 |
- !net-vpn/libreswan |
78 |
- selinux? ( sec-policy/selinux-ipsec )" |
79 |
- |
80 |
-UGID="ipsec" |
81 |
- |
82 |
-pkg_setup() { |
83 |
- linux-info_pkg_setup |
84 |
- elog "Linux kernel version: ${KV_FULL}" |
85 |
- |
86 |
- if ! kernel_is -ge 2 6 16; then |
87 |
- eerror |
88 |
- eerror "This ebuild currently only supports ${PN} with the" |
89 |
- eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16." |
90 |
- eerror |
91 |
- fi |
92 |
- |
93 |
- if kernel_is -lt 2 6 34; then |
94 |
- ewarn |
95 |
- ewarn "IMPORTANT KERNEL NOTES: Please read carefully..." |
96 |
- ewarn |
97 |
- |
98 |
- if kernel_is -lt 2 6 29; then |
99 |
- ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to" |
100 |
- ewarn "include all required IPv6 modules even if you just intend" |
101 |
- ewarn "to run on IPv4 only." |
102 |
- ewarn |
103 |
- ewarn "This has been fixed with kernels >= 2.6.29." |
104 |
- ewarn |
105 |
- fi |
106 |
- |
107 |
- if kernel_is -lt 2 6 33; then |
108 |
- ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards" |
109 |
- ewarn "compliant implementation for SHA-2 HMAC support in ESP and" |
110 |
- ewarn "miss SHA384 and SHA512 HMAC support altogether." |
111 |
- ewarn |
112 |
- ewarn "If you need any of those features, please use kernel >= 2.6.33." |
113 |
- ewarn |
114 |
- fi |
115 |
- |
116 |
- if kernel_is -lt 2 6 34; then |
117 |
- ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only" |
118 |
- ewarn "ESP cipher is only included in kernels >= 2.6.34." |
119 |
- ewarn |
120 |
- ewarn "If you need it, please use kernel >= 2.6.34." |
121 |
- ewarn |
122 |
- fi |
123 |
- fi |
124 |
- |
125 |
- if use non-root; then |
126 |
- enewgroup ${UGID} |
127 |
- enewuser ${UGID} -1 -1 -1 ${UGID} |
128 |
- fi |
129 |
-} |
130 |
- |
131 |
-src_prepare() { |
132 |
- epatch_user |
133 |
-} |
134 |
- |
135 |
-src_configure() { |
136 |
- local myconf="" |
137 |
- |
138 |
- if use non-root; then |
139 |
- myconf="${myconf} --with-user=${UGID} --with-group=${UGID}" |
140 |
- fi |
141 |
- |
142 |
- # If a user has already enabled db support, those plugins will |
143 |
- # most likely be desired as well. Besides they don't impose new |
144 |
- # dependencies and come at no cost (except for space). |
145 |
- if use mysql || use sqlite; then |
146 |
- myconf="${myconf} --enable-attr-sql --enable-sql" |
147 |
- fi |
148 |
- |
149 |
- # strongSwan builds and installs static libs by default which are |
150 |
- # useless to the user (and to strongSwan for that matter) because no |
151 |
- # header files or alike get installed... so disabling them is safe. |
152 |
- if use pam && use eap; then |
153 |
- myconf="${myconf} --enable-eap-gtc" |
154 |
- else |
155 |
- myconf="${myconf} --disable-eap-gtc" |
156 |
- fi |
157 |
- |
158 |
- for mod in $STRONGSWAN_PLUGINS_STD; do |
159 |
- if use strongswan_plugins_${mod}; then |
160 |
- myconf+=" --enable-${mod}" |
161 |
- fi |
162 |
- done |
163 |
- |
164 |
- for mod in $STRONGSWAN_PLUGINS_OPT; do |
165 |
- if use strongswan_plugins_${mod}; then |
166 |
- myconf+=" --enable-${mod}" |
167 |
- fi |
168 |
- done |
169 |
- |
170 |
- econf \ |
171 |
- --disable-static \ |
172 |
- --enable-ikev1 \ |
173 |
- --enable-ikev2 \ |
174 |
- --enable-swanctl \ |
175 |
- --enable-socket-dynamic \ |
176 |
- $(use_with caps capabilities libcap) \ |
177 |
- $(use_enable curl) \ |
178 |
- $(use_enable constraints) \ |
179 |
- $(use_enable ldap) \ |
180 |
- $(use_enable debug leak-detective) \ |
181 |
- $(use_enable dhcp) \ |
182 |
- $(use_enable eap eap-sim) \ |
183 |
- $(use_enable eap eap-sim-file) \ |
184 |
- $(use_enable eap eap-simaka-sql) \ |
185 |
- $(use_enable eap eap-simaka-pseudonym) \ |
186 |
- $(use_enable eap eap-simaka-reauth) \ |
187 |
- $(use_enable eap eap-identity) \ |
188 |
- $(use_enable eap eap-md5) \ |
189 |
- $(use_enable eap eap-aka) \ |
190 |
- $(use_enable eap eap-aka-3gpp2) \ |
191 |
- $(use_enable eap md4) \ |
192 |
- $(use_enable eap eap-mschapv2) \ |
193 |
- $(use_enable eap eap-radius) \ |
194 |
- $(use_enable eap eap-tls) \ |
195 |
- $(use_enable eap xauth-eap) \ |
196 |
- $(use_enable farp) \ |
197 |
- $(use_enable gmp) \ |
198 |
- $(use_enable gcrypt) \ |
199 |
- $(use_enable mysql) \ |
200 |
- $(use_enable networkmanager nm) \ |
201 |
- $(use_enable openssl) \ |
202 |
- $(use_enable pam xauth-pam) \ |
203 |
- $(use_enable pkcs11) \ |
204 |
- $(use_enable sqlite) \ |
205 |
- "$(systemd_with_unitdir)" \ |
206 |
- ${myconf} |
207 |
-} |
208 |
- |
209 |
-src_install() { |
210 |
- emake DESTDIR="${D}" install |
211 |
- |
212 |
- doinitd "${FILESDIR}"/ipsec |
213 |
- |
214 |
- local dir_ugid |
215 |
- if use non-root; then |
216 |
- fowners ${UGID}:${UGID} \ |
217 |
- /etc/ipsec.conf \ |
218 |
- /etc/strongswan.conf |
219 |
- |
220 |
- dir_ugid="${UGID}" |
221 |
- else |
222 |
- dir_ugid="root" |
223 |
- fi |
224 |
- |
225 |
- diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid} |
226 |
- dodir /etc/ipsec.d \ |
227 |
- /etc/ipsec.d/aacerts \ |
228 |
- /etc/ipsec.d/acerts \ |
229 |
- /etc/ipsec.d/cacerts \ |
230 |
- /etc/ipsec.d/certs \ |
231 |
- /etc/ipsec.d/crls \ |
232 |
- /etc/ipsec.d/ocspcerts \ |
233 |
- /etc/ipsec.d/private \ |
234 |
- /etc/ipsec.d/reqs |
235 |
- |
236 |
- dodoc NEWS README TODO || die |
237 |
- |
238 |
- # shared libs are used only internally and there are no static libs, |
239 |
- # so it's safe to get rid of the .la files |
240 |
- find "${D}" -name '*.la' -delete || die "Failed to remove .la files." |
241 |
-} |
242 |
- |
243 |
-pkg_preinst() { |
244 |
- has_version "<net-vpn/strongswan-4.3.6-r1" |
245 |
- upgrade_from_leq_4_3_6=$(( !$? )) |
246 |
- |
247 |
- has_version "<net-vpn/strongswan-4.3.6-r1[-caps]" |
248 |
- previous_4_3_6_with_caps=$(( !$? )) |
249 |
-} |
250 |
- |
251 |
-pkg_postinst() { |
252 |
- if ! use openssl && ! use gcrypt; then |
253 |
- elog |
254 |
- elog "${PN} has been compiled without both OpenSSL and libgcrypt support." |
255 |
- elog "Please note that this might effect availability and speed of some" |
256 |
- elog "cryptographic features. You are advised to enable the OpenSSL plugin." |
257 |
- elif ! use openssl; then |
258 |
- elog |
259 |
- elog "${PN} has been compiled without the OpenSSL plugin. This might effect" |
260 |
- elog "availability and speed of some cryptographic features. There will be" |
261 |
- elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21," |
262 |
- elog "25, 26) and ECDSA." |
263 |
- fi |
264 |
- |
265 |
- if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then |
266 |
- chmod 0750 "${ROOT}"/etc/ipsec.d \ |
267 |
- "${ROOT}"/etc/ipsec.d/aacerts \ |
268 |
- "${ROOT}"/etc/ipsec.d/acerts \ |
269 |
- "${ROOT}"/etc/ipsec.d/cacerts \ |
270 |
- "${ROOT}"/etc/ipsec.d/certs \ |
271 |
- "${ROOT}"/etc/ipsec.d/crls \ |
272 |
- "${ROOT}"/etc/ipsec.d/ocspcerts \ |
273 |
- "${ROOT}"/etc/ipsec.d/private \ |
274 |
- "${ROOT}"/etc/ipsec.d/reqs |
275 |
- |
276 |
- ewarn |
277 |
- ewarn "The default permissions for /etc/ipsec.d/* have been tightened for" |
278 |
- ewarn "security reasons. Your system installed directories have been" |
279 |
- ewarn "updated accordingly. Please check if necessary." |
280 |
- ewarn |
281 |
- |
282 |
- if [[ $previous_4_3_6_with_caps == 1 ]]; then |
283 |
- if ! use non-root; then |
284 |
- ewarn |
285 |
- ewarn "IMPORTANT: You previously had ${PN} installed without root" |
286 |
- ewarn "privileges because it was implied by the 'caps' USE flag." |
287 |
- ewarn "This has been changed. If you want ${PN} with user privileges," |
288 |
- ewarn "you have to re-emerge it with the 'non-root' USE flag enabled." |
289 |
- ewarn |
290 |
- fi |
291 |
- fi |
292 |
- fi |
293 |
- if ! use caps && ! use non-root; then |
294 |
- ewarn |
295 |
- ewarn "You have decided to run ${PN} with root privileges and built it" |
296 |
- ewarn "without support for POSIX capability dropping. It is generally" |
297 |
- ewarn "strongly suggested that you reconsider- especially if you intend" |
298 |
- ewarn "to run ${PN} as server with a public ip address." |
299 |
- ewarn |
300 |
- ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled." |
301 |
- ewarn |
302 |
- fi |
303 |
- if use non-root; then |
304 |
- elog |
305 |
- elog "${PN} has been installed without superuser privileges (USE=non-root)." |
306 |
- elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'" |
307 |
- elog "but also a few to the IKEv2 daemon 'charon'." |
308 |
- elog |
309 |
- elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot" |
310 |
- elog |
311 |
- elog "pluto uses a helper script by default to insert/remove routing and" |
312 |
- elog "policy rules upon connection start/stop which requires superuser" |
313 |
- elog "privileges. charon in contrast does this internally and can do so" |
314 |
- elog "even with reduced (user) privileges." |
315 |
- elog |
316 |
- elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown" |
317 |
- elog "script to pluto or charon which requires superuser privileges, you" |
318 |
- elog "can work around this limitation by using sudo to grant the" |
319 |
- elog "user \"ipsec\" the appropriate rights." |
320 |
- elog "For example (the default case):" |
321 |
- elog "/etc/sudoers:" |
322 |
- elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec" |
323 |
- elog "Under the specific connection block in /etc/ipsec.conf:" |
324 |
- elog " leftupdown=\"sudo -E ipsec _updown iptables\"" |
325 |
- elog |
326 |
- fi |
327 |
- elog |
328 |
- elog "Make sure you have _all_ required kernel modules available including" |
329 |
- elog "the appropriate cryptographic algorithms. A list is available at:" |
330 |
- elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules" |
331 |
- elog |
332 |
- elog "The up-to-date manual is available online at:" |
333 |
- elog " http://wiki.strongswan.org/" |
334 |
- elog |
335 |
-} |
336 |
|
337 |
diff --git a/net-vpn/strongswan/strongswan-5.6.0.ebuild b/net-vpn/strongswan/strongswan-5.6.0.ebuild |
338 |
deleted file mode 100644 |
339 |
index c4736a96230..00000000000 |
340 |
--- a/net-vpn/strongswan/strongswan-5.6.0.ebuild |
341 |
+++ /dev/null |
342 |
@@ -1,302 +0,0 @@ |
343 |
-# Copyright 1999-2018 Gentoo Foundation |
344 |
-# Distributed under the terms of the GNU General Public License v2 |
345 |
- |
346 |
-EAPI=5 |
347 |
-inherit eutils linux-info systemd user |
348 |
- |
349 |
-DESCRIPTION="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE" |
350 |
-HOMEPAGE="http://www.strongswan.org/" |
351 |
-SRC_URI="http://download.strongswan.org/${P}.tar.bz2" |
352 |
- |
353 |
-LICENSE="GPL-2 RSA DES" |
354 |
-SLOT="0" |
355 |
-KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
356 |
-IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite pam pkcs11" |
357 |
- |
358 |
-STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici" |
359 |
-STRONGSWAN_PLUGINS_OPT="blowfish ccm ctr gcm ha ipseckey ntru padlock rdrand unbound whitelist" |
360 |
-for mod in $STRONGSWAN_PLUGINS_STD; do |
361 |
- IUSE="${IUSE} +strongswan_plugins_${mod}" |
362 |
-done |
363 |
- |
364 |
-for mod in $STRONGSWAN_PLUGINS_OPT; do |
365 |
- IUSE="${IUSE} strongswan_plugins_${mod}" |
366 |
-done |
367 |
- |
368 |
-COMMON_DEPEND="!net-misc/openswan |
369 |
- gmp? ( >=dev-libs/gmp-4.1.5:= ) |
370 |
- gcrypt? ( dev-libs/libgcrypt:0 ) |
371 |
- caps? ( sys-libs/libcap ) |
372 |
- curl? ( net-misc/curl ) |
373 |
- ldap? ( net-nds/openldap ) |
374 |
- openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] ) |
375 |
- mysql? ( virtual/mysql ) |
376 |
- sqlite? ( >=dev-db/sqlite-3.3.1 ) |
377 |
- networkmanager? ( net-misc/networkmanager ) |
378 |
- pam? ( sys-libs/pam ) |
379 |
- strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )" |
380 |
-DEPEND="${COMMON_DEPEND} |
381 |
- virtual/linux-sources |
382 |
- sys-kernel/linux-headers" |
383 |
-RDEPEND="${COMMON_DEPEND} |
384 |
- virtual/logger |
385 |
- sys-apps/iproute2 |
386 |
- !net-vpn/libreswan |
387 |
- selinux? ( sec-policy/selinux-ipsec )" |
388 |
- |
389 |
-UGID="ipsec" |
390 |
- |
391 |
-pkg_setup() { |
392 |
- linux-info_pkg_setup |
393 |
- elog "Linux kernel version: ${KV_FULL}" |
394 |
- |
395 |
- if ! kernel_is -ge 2 6 16; then |
396 |
- eerror |
397 |
- eerror "This ebuild currently only supports ${PN} with the" |
398 |
- eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16." |
399 |
- eerror |
400 |
- fi |
401 |
- |
402 |
- if kernel_is -lt 2 6 34; then |
403 |
- ewarn |
404 |
- ewarn "IMPORTANT KERNEL NOTES: Please read carefully..." |
405 |
- ewarn |
406 |
- |
407 |
- if kernel_is -lt 2 6 29; then |
408 |
- ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to" |
409 |
- ewarn "include all required IPv6 modules even if you just intend" |
410 |
- ewarn "to run on IPv4 only." |
411 |
- ewarn |
412 |
- ewarn "This has been fixed with kernels >= 2.6.29." |
413 |
- ewarn |
414 |
- fi |
415 |
- |
416 |
- if kernel_is -lt 2 6 33; then |
417 |
- ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards" |
418 |
- ewarn "compliant implementation for SHA-2 HMAC support in ESP and" |
419 |
- ewarn "miss SHA384 and SHA512 HMAC support altogether." |
420 |
- ewarn |
421 |
- ewarn "If you need any of those features, please use kernel >= 2.6.33." |
422 |
- ewarn |
423 |
- fi |
424 |
- |
425 |
- if kernel_is -lt 2 6 34; then |
426 |
- ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only" |
427 |
- ewarn "ESP cipher is only included in kernels >= 2.6.34." |
428 |
- ewarn |
429 |
- ewarn "If you need it, please use kernel >= 2.6.34." |
430 |
- ewarn |
431 |
- fi |
432 |
- fi |
433 |
- |
434 |
- if use non-root; then |
435 |
- enewgroup ${UGID} |
436 |
- enewuser ${UGID} -1 -1 -1 ${UGID} |
437 |
- fi |
438 |
-} |
439 |
- |
440 |
-src_prepare() { |
441 |
- epatch_user |
442 |
-} |
443 |
- |
444 |
-src_configure() { |
445 |
- local myconf="" |
446 |
- |
447 |
- if use non-root; then |
448 |
- myconf="${myconf} --with-user=${UGID} --with-group=${UGID}" |
449 |
- fi |
450 |
- |
451 |
- # If a user has already enabled db support, those plugins will |
452 |
- # most likely be desired as well. Besides they don't impose new |
453 |
- # dependencies and come at no cost (except for space). |
454 |
- if use mysql || use sqlite; then |
455 |
- myconf="${myconf} --enable-attr-sql --enable-sql" |
456 |
- fi |
457 |
- |
458 |
- # strongSwan builds and installs static libs by default which are |
459 |
- # useless to the user (and to strongSwan for that matter) because no |
460 |
- # header files or alike get installed... so disabling them is safe. |
461 |
- if use pam && use eap; then |
462 |
- myconf="${myconf} --enable-eap-gtc" |
463 |
- else |
464 |
- myconf="${myconf} --disable-eap-gtc" |
465 |
- fi |
466 |
- |
467 |
- for mod in $STRONGSWAN_PLUGINS_STD; do |
468 |
- if use strongswan_plugins_${mod}; then |
469 |
- myconf+=" --enable-${mod}" |
470 |
- fi |
471 |
- done |
472 |
- |
473 |
- for mod in $STRONGSWAN_PLUGINS_OPT; do |
474 |
- if use strongswan_plugins_${mod}; then |
475 |
- myconf+=" --enable-${mod}" |
476 |
- fi |
477 |
- done |
478 |
- |
479 |
- econf \ |
480 |
- --disable-static \ |
481 |
- --enable-ikev1 \ |
482 |
- --enable-ikev2 \ |
483 |
- --enable-swanctl \ |
484 |
- --enable-socket-dynamic \ |
485 |
- $(use_with caps capabilities libcap) \ |
486 |
- $(use_enable curl) \ |
487 |
- $(use_enable constraints) \ |
488 |
- $(use_enable ldap) \ |
489 |
- $(use_enable debug leak-detective) \ |
490 |
- $(use_enable dhcp) \ |
491 |
- $(use_enable eap eap-sim) \ |
492 |
- $(use_enable eap eap-sim-file) \ |
493 |
- $(use_enable eap eap-simaka-sql) \ |
494 |
- $(use_enable eap eap-simaka-pseudonym) \ |
495 |
- $(use_enable eap eap-simaka-reauth) \ |
496 |
- $(use_enable eap eap-identity) \ |
497 |
- $(use_enable eap eap-md5) \ |
498 |
- $(use_enable eap eap-aka) \ |
499 |
- $(use_enable eap eap-aka-3gpp2) \ |
500 |
- $(use_enable eap md4) \ |
501 |
- $(use_enable eap eap-mschapv2) \ |
502 |
- $(use_enable eap eap-radius) \ |
503 |
- $(use_enable eap eap-tls) \ |
504 |
- $(use_enable eap xauth-eap) \ |
505 |
- $(use_enable farp) \ |
506 |
- $(use_enable gmp) \ |
507 |
- $(use_enable gcrypt) \ |
508 |
- $(use_enable mysql) \ |
509 |
- $(use_enable networkmanager nm) \ |
510 |
- $(use_enable openssl) \ |
511 |
- $(use_enable pam xauth-pam) \ |
512 |
- $(use_enable pkcs11) \ |
513 |
- $(use_enable sqlite) \ |
514 |
- "$(systemd_with_unitdir)" \ |
515 |
- ${myconf} |
516 |
-} |
517 |
- |
518 |
-src_install() { |
519 |
- emake DESTDIR="${D}" install |
520 |
- |
521 |
- doinitd "${FILESDIR}"/ipsec |
522 |
- |
523 |
- local dir_ugid |
524 |
- if use non-root; then |
525 |
- fowners ${UGID}:${UGID} \ |
526 |
- /etc/ipsec.conf \ |
527 |
- /etc/strongswan.conf |
528 |
- |
529 |
- dir_ugid="${UGID}" |
530 |
- else |
531 |
- dir_ugid="root" |
532 |
- fi |
533 |
- |
534 |
- diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid} |
535 |
- dodir /etc/ipsec.d \ |
536 |
- /etc/ipsec.d/aacerts \ |
537 |
- /etc/ipsec.d/acerts \ |
538 |
- /etc/ipsec.d/cacerts \ |
539 |
- /etc/ipsec.d/certs \ |
540 |
- /etc/ipsec.d/crls \ |
541 |
- /etc/ipsec.d/ocspcerts \ |
542 |
- /etc/ipsec.d/private \ |
543 |
- /etc/ipsec.d/reqs |
544 |
- |
545 |
- dodoc NEWS README TODO || die |
546 |
- |
547 |
- # shared libs are used only internally and there are no static libs, |
548 |
- # so it's safe to get rid of the .la files |
549 |
- find "${D}" -name '*.la' -delete || die "Failed to remove .la files." |
550 |
-} |
551 |
- |
552 |
-pkg_preinst() { |
553 |
- has_version "<net-vpn/strongswan-4.3.6-r1" |
554 |
- upgrade_from_leq_4_3_6=$(( !$? )) |
555 |
- |
556 |
- has_version "<net-vpn/strongswan-4.3.6-r1[-caps]" |
557 |
- previous_4_3_6_with_caps=$(( !$? )) |
558 |
-} |
559 |
- |
560 |
-pkg_postinst() { |
561 |
- if ! use openssl && ! use gcrypt; then |
562 |
- elog |
563 |
- elog "${PN} has been compiled without both OpenSSL and libgcrypt support." |
564 |
- elog "Please note that this might effect availability and speed of some" |
565 |
- elog "cryptographic features. You are advised to enable the OpenSSL plugin." |
566 |
- elif ! use openssl; then |
567 |
- elog |
568 |
- elog "${PN} has been compiled without the OpenSSL plugin. This might effect" |
569 |
- elog "availability and speed of some cryptographic features. There will be" |
570 |
- elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21," |
571 |
- elog "25, 26) and ECDSA." |
572 |
- fi |
573 |
- |
574 |
- if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then |
575 |
- chmod 0750 "${ROOT}"/etc/ipsec.d \ |
576 |
- "${ROOT}"/etc/ipsec.d/aacerts \ |
577 |
- "${ROOT}"/etc/ipsec.d/acerts \ |
578 |
- "${ROOT}"/etc/ipsec.d/cacerts \ |
579 |
- "${ROOT}"/etc/ipsec.d/certs \ |
580 |
- "${ROOT}"/etc/ipsec.d/crls \ |
581 |
- "${ROOT}"/etc/ipsec.d/ocspcerts \ |
582 |
- "${ROOT}"/etc/ipsec.d/private \ |
583 |
- "${ROOT}"/etc/ipsec.d/reqs |
584 |
- |
585 |
- ewarn |
586 |
- ewarn "The default permissions for /etc/ipsec.d/* have been tightened for" |
587 |
- ewarn "security reasons. Your system installed directories have been" |
588 |
- ewarn "updated accordingly. Please check if necessary." |
589 |
- ewarn |
590 |
- |
591 |
- if [[ $previous_4_3_6_with_caps == 1 ]]; then |
592 |
- if ! use non-root; then |
593 |
- ewarn |
594 |
- ewarn "IMPORTANT: You previously had ${PN} installed without root" |
595 |
- ewarn "privileges because it was implied by the 'caps' USE flag." |
596 |
- ewarn "This has been changed. If you want ${PN} with user privileges," |
597 |
- ewarn "you have to re-emerge it with the 'non-root' USE flag enabled." |
598 |
- ewarn |
599 |
- fi |
600 |
- fi |
601 |
- fi |
602 |
- if ! use caps && ! use non-root; then |
603 |
- ewarn |
604 |
- ewarn "You have decided to run ${PN} with root privileges and built it" |
605 |
- ewarn "without support for POSIX capability dropping. It is generally" |
606 |
- ewarn "strongly suggested that you reconsider- especially if you intend" |
607 |
- ewarn "to run ${PN} as server with a public ip address." |
608 |
- ewarn |
609 |
- ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled." |
610 |
- ewarn |
611 |
- fi |
612 |
- if use non-root; then |
613 |
- elog |
614 |
- elog "${PN} has been installed without superuser privileges (USE=non-root)." |
615 |
- elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'" |
616 |
- elog "but also a few to the IKEv2 daemon 'charon'." |
617 |
- elog |
618 |
- elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot" |
619 |
- elog |
620 |
- elog "pluto uses a helper script by default to insert/remove routing and" |
621 |
- elog "policy rules upon connection start/stop which requires superuser" |
622 |
- elog "privileges. charon in contrast does this internally and can do so" |
623 |
- elog "even with reduced (user) privileges." |
624 |
- elog |
625 |
- elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown" |
626 |
- elog "script to pluto or charon which requires superuser privileges, you" |
627 |
- elog "can work around this limitation by using sudo to grant the" |
628 |
- elog "user \"ipsec\" the appropriate rights." |
629 |
- elog "For example (the default case):" |
630 |
- elog "/etc/sudoers:" |
631 |
- elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec" |
632 |
- elog "Under the specific connection block in /etc/ipsec.conf:" |
633 |
- elog " leftupdown=\"sudo -E ipsec _updown iptables\"" |
634 |
- elog |
635 |
- fi |
636 |
- elog |
637 |
- elog "Make sure you have _all_ required kernel modules available including" |
638 |
- elog "the appropriate cryptographic algorithms. A list is available at:" |
639 |
- elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules" |
640 |
- elog |
641 |
- elog "The up-to-date manual is available online at:" |
642 |
- elog " http://wiki.strongswan.org/" |
643 |
- elog |
644 |
-} |