Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/strongswan/
Date: Thu, 15 Nov 2018 12:35:38
Message-Id: 1542285320.c0ff4971ff0d25924489c8c968ee96d7d7759d8f.whissi@gentoo
1 commit: c0ff4971ff0d25924489c8c968ee96d7d7759d8f
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 15 12:35:20 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 15 12:35:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0ff4971
7
8 net-vpn/strongswan: security cleanup
9
10 Bug: https://bugs.gentoo.org/668862
11 Package-Manager: Portage-2.3.51, Repoman-2.3.12
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 net-vpn/strongswan/Manifest | 3 -
15 net-vpn/strongswan/strongswan-5.6.0-r1.ebuild | 303 --------------------------
16 net-vpn/strongswan/strongswan-5.6.2.ebuild | 303 --------------------------
17 net-vpn/strongswan/strongswan-5.6.3.ebuild | 303 --------------------------
18 4 files changed, 912 deletions(-)
19
20 diff --git a/net-vpn/strongswan/Manifest b/net-vpn/strongswan/Manifest
21 index b35b74232d7..29fdc73b496 100644
22 --- a/net-vpn/strongswan/Manifest
23 +++ b/net-vpn/strongswan/Manifest
24 @@ -1,4 +1 @@
25 -DIST strongswan-5.6.0.tar.bz2 4850722 BLAKE2B edb9f2b277cd8bccf886a824e4b3fb3c06af7510d9e21283fcb8d8ba9cf234f38182fcd1ca0c350b4039945ab10888406986d9a0b8edac24fe09faf0b8967fb2 SHA512 9362069a01c3642e62864d88fdb409a3c7514bf7c92cbe36e552c6a80915119cf5bb91c39592aab2d15b562684a0628a764e4fa7636d3b5fd2ebaf165c0ce649
26 -DIST strongswan-5.6.2.tar.bz2 4977859 BLAKE2B 83943ec95e6b95724e9fc130a09f7c7364147d0ce50528ac8b64452db53516b143e92c7dcb746c0c25aaac9182dda14d55e5c267fbdcd5bb9a63cbf48801274b SHA512 cf2d5cb6c45d991fe0ad8eed4ea8628f95a1871e9728ddf0985aa26e78d1e6da1c92c961772aafd3e55cfcfa84516204a15561389d373f78140f05607b248c52
27 -DIST strongswan-5.6.3.tar.bz2 4961579 BLAKE2B 177d9ca9a730c8ccb3293c9f1c1397429879177aef60c90a3561fffed64cd4fe18cdf1c74bd52956c576e061ce33935b7dc34864576edeac7d4824841b0ee3e0 SHA512 080402640952b1a08e95bfe9c7f33c6a7dd01ac401b5e7e2e78257c0f2bf0a4d6078141232ac62abfacef892c493f6824948b3165d54d72b4e436ed564fd2609
28 DIST strongswan-5.7.1.tar.bz2 4967533 BLAKE2B e438d1b44a997eb0e012586b18604bd35ac6f53cce1c34ff89192a760bbd0d6a9aaa7b90b389ff1a5e7c6d2356ff5cc74b40daad1d6579fa5026f4878489bf66 SHA512 43102814434bee7c27a5956be59099cc4ffb9bb5b0d6382ce4c6a80d1d82ed6639f698f5f5544b9ca563554a344638c953525b0e2d39bc6b71b19055c80e07fc
29
30 diff --git a/net-vpn/strongswan/strongswan-5.6.0-r1.ebuild b/net-vpn/strongswan/strongswan-5.6.0-r1.ebuild
31 deleted file mode 100644
32 index 7682afd92ad..00000000000
33 --- a/net-vpn/strongswan/strongswan-5.6.0-r1.ebuild
34 +++ /dev/null
35 @@ -1,303 +0,0 @@
36 -# Copyright 1999-2018 Gentoo Foundation
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -EAPI=5
40 -inherit eutils linux-info systemd user
41 -
42 -DESCRIPTION="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE"
43 -HOMEPAGE="http://www.strongswan.org/"
44 -SRC_URI="http://download.strongswan.org/${P}.tar.bz2"
45 -
46 -LICENSE="GPL-2 RSA DES"
47 -SLOT="0"
48 -KEYWORDS="amd64 arm ppc ~ppc64 x86"
49 -IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite pam pkcs11"
50 -
51 -STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici"
52 -STRONGSWAN_PLUGINS_OPT="blowfish ccm ctr gcm ha ipseckey ntru padlock rdrand unbound whitelist"
53 -for mod in $STRONGSWAN_PLUGINS_STD; do
54 - IUSE="${IUSE} +strongswan_plugins_${mod}"
55 -done
56 -
57 -for mod in $STRONGSWAN_PLUGINS_OPT; do
58 - IUSE="${IUSE} strongswan_plugins_${mod}"
59 -done
60 -
61 -COMMON_DEPEND="!net-misc/openswan
62 - gmp? ( >=dev-libs/gmp-4.1.5:= )
63 - gcrypt? ( dev-libs/libgcrypt:0 )
64 - caps? ( sys-libs/libcap )
65 - curl? ( net-misc/curl )
66 - ldap? ( net-nds/openldap )
67 - openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] )
68 - mysql? ( virtual/mysql )
69 - sqlite? ( >=dev-db/sqlite-3.3.1 )
70 - networkmanager? ( net-misc/networkmanager )
71 - pam? ( sys-libs/pam )
72 - strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )"
73 -DEPEND="${COMMON_DEPEND}
74 - virtual/linux-sources
75 - sys-kernel/linux-headers"
76 -RDEPEND="${COMMON_DEPEND}
77 - virtual/logger
78 - sys-apps/iproute2
79 - !net-vpn/libreswan
80 - selinux? ( sec-policy/selinux-ipsec )"
81 -
82 -UGID="ipsec"
83 -
84 -pkg_setup() {
85 - linux-info_pkg_setup
86 - elog "Linux kernel version: ${KV_FULL}"
87 -
88 - if ! kernel_is -ge 2 6 16; then
89 - eerror
90 - eerror "This ebuild currently only supports ${PN} with the"
91 - eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16."
92 - eerror
93 - fi
94 -
95 - if kernel_is -lt 2 6 34; then
96 - ewarn
97 - ewarn "IMPORTANT KERNEL NOTES: Please read carefully..."
98 - ewarn
99 -
100 - if kernel_is -lt 2 6 29; then
101 - ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to"
102 - ewarn "include all required IPv6 modules even if you just intend"
103 - ewarn "to run on IPv4 only."
104 - ewarn
105 - ewarn "This has been fixed with kernels >= 2.6.29."
106 - ewarn
107 - fi
108 -
109 - if kernel_is -lt 2 6 33; then
110 - ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards"
111 - ewarn "compliant implementation for SHA-2 HMAC support in ESP and"
112 - ewarn "miss SHA384 and SHA512 HMAC support altogether."
113 - ewarn
114 - ewarn "If you need any of those features, please use kernel >= 2.6.33."
115 - ewarn
116 - fi
117 -
118 - if kernel_is -lt 2 6 34; then
119 - ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only"
120 - ewarn "ESP cipher is only included in kernels >= 2.6.34."
121 - ewarn
122 - ewarn "If you need it, please use kernel >= 2.6.34."
123 - ewarn
124 - fi
125 - fi
126 -
127 - if use non-root; then
128 - enewgroup ${UGID}
129 - enewuser ${UGID} -1 -1 -1 ${UGID}
130 - fi
131 -}
132 -
133 -src_prepare() {
134 - epatch_user
135 -}
136 -
137 -src_configure() {
138 - local myconf=""
139 -
140 - if use non-root; then
141 - myconf="${myconf} --with-user=${UGID} --with-group=${UGID}"
142 - fi
143 -
144 - # If a user has already enabled db support, those plugins will
145 - # most likely be desired as well. Besides they don't impose new
146 - # dependencies and come at no cost (except for space).
147 - if use mysql || use sqlite; then
148 - myconf="${myconf} --enable-attr-sql --enable-sql"
149 - fi
150 -
151 - # strongSwan builds and installs static libs by default which are
152 - # useless to the user (and to strongSwan for that matter) because no
153 - # header files or alike get installed... so disabling them is safe.
154 - if use pam && use eap; then
155 - myconf="${myconf} --enable-eap-gtc"
156 - else
157 - myconf="${myconf} --disable-eap-gtc"
158 - fi
159 -
160 - for mod in $STRONGSWAN_PLUGINS_STD; do
161 - if use strongswan_plugins_${mod}; then
162 - myconf+=" --enable-${mod}"
163 - fi
164 - done
165 -
166 - for mod in $STRONGSWAN_PLUGINS_OPT; do
167 - if use strongswan_plugins_${mod}; then
168 - myconf+=" --enable-${mod}"
169 - fi
170 - done
171 -
172 - econf \
173 - --disable-static \
174 - --enable-ikev1 \
175 - --enable-ikev2 \
176 - --enable-swanctl \
177 - --enable-socket-dynamic \
178 - $(use_with caps capabilities libcap) \
179 - $(use_enable curl) \
180 - $(use_enable constraints) \
181 - $(use_enable ldap) \
182 - $(use_enable debug leak-detective) \
183 - $(use_enable dhcp) \
184 - $(use_enable eap eap-sim) \
185 - $(use_enable eap eap-sim-file) \
186 - $(use_enable eap eap-simaka-sql) \
187 - $(use_enable eap eap-simaka-pseudonym) \
188 - $(use_enable eap eap-simaka-reauth) \
189 - $(use_enable eap eap-identity) \
190 - $(use_enable eap eap-md5) \
191 - $(use_enable eap eap-aka) \
192 - $(use_enable eap eap-aka-3gpp2) \
193 - $(use_enable eap md4) \
194 - $(use_enable eap eap-mschapv2) \
195 - $(use_enable eap eap-radius) \
196 - $(use_enable eap eap-tls) \
197 - $(use_enable eap xauth-eap) \
198 - $(use_enable eap eap-dynamic) \
199 - $(use_enable farp) \
200 - $(use_enable gmp) \
201 - $(use_enable gcrypt) \
202 - $(use_enable mysql) \
203 - $(use_enable networkmanager nm) \
204 - $(use_enable openssl) \
205 - $(use_enable pam xauth-pam) \
206 - $(use_enable pkcs11) \
207 - $(use_enable sqlite) \
208 - "$(systemd_with_unitdir)" \
209 - ${myconf}
210 -}
211 -
212 -src_install() {
213 - emake DESTDIR="${D}" install
214 -
215 - doinitd "${FILESDIR}"/ipsec
216 -
217 - local dir_ugid
218 - if use non-root; then
219 - fowners ${UGID}:${UGID} \
220 - /etc/ipsec.conf \
221 - /etc/strongswan.conf
222 -
223 - dir_ugid="${UGID}"
224 - else
225 - dir_ugid="root"
226 - fi
227 -
228 - diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid}
229 - dodir /etc/ipsec.d \
230 - /etc/ipsec.d/aacerts \
231 - /etc/ipsec.d/acerts \
232 - /etc/ipsec.d/cacerts \
233 - /etc/ipsec.d/certs \
234 - /etc/ipsec.d/crls \
235 - /etc/ipsec.d/ocspcerts \
236 - /etc/ipsec.d/private \
237 - /etc/ipsec.d/reqs
238 -
239 - dodoc NEWS README TODO || die
240 -
241 - # shared libs are used only internally and there are no static libs,
242 - # so it's safe to get rid of the .la files
243 - find "${D}" -name '*.la' -delete || die "Failed to remove .la files."
244 -}
245 -
246 -pkg_preinst() {
247 - has_version "<net-vpn/strongswan-4.3.6-r1"
248 - upgrade_from_leq_4_3_6=$(( !$? ))
249 -
250 - has_version "<net-vpn/strongswan-4.3.6-r1[-caps]"
251 - previous_4_3_6_with_caps=$(( !$? ))
252 -}
253 -
254 -pkg_postinst() {
255 - if ! use openssl && ! use gcrypt; then
256 - elog
257 - elog "${PN} has been compiled without both OpenSSL and libgcrypt support."
258 - elog "Please note that this might effect availability and speed of some"
259 - elog "cryptographic features. You are advised to enable the OpenSSL plugin."
260 - elif ! use openssl; then
261 - elog
262 - elog "${PN} has been compiled without the OpenSSL plugin. This might effect"
263 - elog "availability and speed of some cryptographic features. There will be"
264 - elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21,"
265 - elog "25, 26) and ECDSA."
266 - fi
267 -
268 - if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then
269 - chmod 0750 "${ROOT}"/etc/ipsec.d \
270 - "${ROOT}"/etc/ipsec.d/aacerts \
271 - "${ROOT}"/etc/ipsec.d/acerts \
272 - "${ROOT}"/etc/ipsec.d/cacerts \
273 - "${ROOT}"/etc/ipsec.d/certs \
274 - "${ROOT}"/etc/ipsec.d/crls \
275 - "${ROOT}"/etc/ipsec.d/ocspcerts \
276 - "${ROOT}"/etc/ipsec.d/private \
277 - "${ROOT}"/etc/ipsec.d/reqs
278 -
279 - ewarn
280 - ewarn "The default permissions for /etc/ipsec.d/* have been tightened for"
281 - ewarn "security reasons. Your system installed directories have been"
282 - ewarn "updated accordingly. Please check if necessary."
283 - ewarn
284 -
285 - if [[ $previous_4_3_6_with_caps == 1 ]]; then
286 - if ! use non-root; then
287 - ewarn
288 - ewarn "IMPORTANT: You previously had ${PN} installed without root"
289 - ewarn "privileges because it was implied by the 'caps' USE flag."
290 - ewarn "This has been changed. If you want ${PN} with user privileges,"
291 - ewarn "you have to re-emerge it with the 'non-root' USE flag enabled."
292 - ewarn
293 - fi
294 - fi
295 - fi
296 - if ! use caps && ! use non-root; then
297 - ewarn
298 - ewarn "You have decided to run ${PN} with root privileges and built it"
299 - ewarn "without support for POSIX capability dropping. It is generally"
300 - ewarn "strongly suggested that you reconsider- especially if you intend"
301 - ewarn "to run ${PN} as server with a public ip address."
302 - ewarn
303 - ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled."
304 - ewarn
305 - fi
306 - if use non-root; then
307 - elog
308 - elog "${PN} has been installed without superuser privileges (USE=non-root)."
309 - elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'"
310 - elog "but also a few to the IKEv2 daemon 'charon'."
311 - elog
312 - elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot"
313 - elog
314 - elog "pluto uses a helper script by default to insert/remove routing and"
315 - elog "policy rules upon connection start/stop which requires superuser"
316 - elog "privileges. charon in contrast does this internally and can do so"
317 - elog "even with reduced (user) privileges."
318 - elog
319 - elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown"
320 - elog "script to pluto or charon which requires superuser privileges, you"
321 - elog "can work around this limitation by using sudo to grant the"
322 - elog "user \"ipsec\" the appropriate rights."
323 - elog "For example (the default case):"
324 - elog "/etc/sudoers:"
325 - elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec"
326 - elog "Under the specific connection block in /etc/ipsec.conf:"
327 - elog " leftupdown=\"sudo -E ipsec _updown iptables\""
328 - elog
329 - fi
330 - elog
331 - elog "Make sure you have _all_ required kernel modules available including"
332 - elog "the appropriate cryptographic algorithms. A list is available at:"
333 - elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules"
334 - elog
335 - elog "The up-to-date manual is available online at:"
336 - elog " http://wiki.strongswan.org/"
337 - elog
338 -}
339
340 diff --git a/net-vpn/strongswan/strongswan-5.6.2.ebuild b/net-vpn/strongswan/strongswan-5.6.2.ebuild
341 deleted file mode 100644
342 index c7dbeeac3be..00000000000
343 --- a/net-vpn/strongswan/strongswan-5.6.2.ebuild
344 +++ /dev/null
345 @@ -1,303 +0,0 @@
346 -# Copyright 1999-2018 Gentoo Foundation
347 -# Distributed under the terms of the GNU General Public License v2
348 -
349 -EAPI=5
350 -inherit eutils linux-info systemd user
351 -
352 -DESCRIPTION="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE"
353 -HOMEPAGE="http://www.strongswan.org/"
354 -SRC_URI="http://download.strongswan.org/${P}.tar.bz2"
355 -
356 -LICENSE="GPL-2 RSA DES"
357 -SLOT="0"
358 -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
359 -IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite pam pkcs11"
360 -
361 -STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici"
362 -STRONGSWAN_PLUGINS_OPT="blowfish ccm ctr gcm ha ipseckey ntru padlock rdrand unbound whitelist"
363 -for mod in $STRONGSWAN_PLUGINS_STD; do
364 - IUSE="${IUSE} +strongswan_plugins_${mod}"
365 -done
366 -
367 -for mod in $STRONGSWAN_PLUGINS_OPT; do
368 - IUSE="${IUSE} strongswan_plugins_${mod}"
369 -done
370 -
371 -COMMON_DEPEND="!net-misc/openswan
372 - gmp? ( >=dev-libs/gmp-4.1.5:= )
373 - gcrypt? ( dev-libs/libgcrypt:0 )
374 - caps? ( sys-libs/libcap )
375 - curl? ( net-misc/curl )
376 - ldap? ( net-nds/openldap )
377 - openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] )
378 - mysql? ( virtual/mysql )
379 - sqlite? ( >=dev-db/sqlite-3.3.1 )
380 - networkmanager? ( net-misc/networkmanager )
381 - pam? ( sys-libs/pam )
382 - strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )"
383 -DEPEND="${COMMON_DEPEND}
384 - virtual/linux-sources
385 - sys-kernel/linux-headers"
386 -RDEPEND="${COMMON_DEPEND}
387 - virtual/logger
388 - sys-apps/iproute2
389 - !net-vpn/libreswan
390 - selinux? ( sec-policy/selinux-ipsec )"
391 -
392 -UGID="ipsec"
393 -
394 -pkg_setup() {
395 - linux-info_pkg_setup
396 - elog "Linux kernel version: ${KV_FULL}"
397 -
398 - if ! kernel_is -ge 2 6 16; then
399 - eerror
400 - eerror "This ebuild currently only supports ${PN} with the"
401 - eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16."
402 - eerror
403 - fi
404 -
405 - if kernel_is -lt 2 6 34; then
406 - ewarn
407 - ewarn "IMPORTANT KERNEL NOTES: Please read carefully..."
408 - ewarn
409 -
410 - if kernel_is -lt 2 6 29; then
411 - ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to"
412 - ewarn "include all required IPv6 modules even if you just intend"
413 - ewarn "to run on IPv4 only."
414 - ewarn
415 - ewarn "This has been fixed with kernels >= 2.6.29."
416 - ewarn
417 - fi
418 -
419 - if kernel_is -lt 2 6 33; then
420 - ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards"
421 - ewarn "compliant implementation for SHA-2 HMAC support in ESP and"
422 - ewarn "miss SHA384 and SHA512 HMAC support altogether."
423 - ewarn
424 - ewarn "If you need any of those features, please use kernel >= 2.6.33."
425 - ewarn
426 - fi
427 -
428 - if kernel_is -lt 2 6 34; then
429 - ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only"
430 - ewarn "ESP cipher is only included in kernels >= 2.6.34."
431 - ewarn
432 - ewarn "If you need it, please use kernel >= 2.6.34."
433 - ewarn
434 - fi
435 - fi
436 -
437 - if use non-root; then
438 - enewgroup ${UGID}
439 - enewuser ${UGID} -1 -1 -1 ${UGID}
440 - fi
441 -}
442 -
443 -src_prepare() {
444 - epatch_user
445 -}
446 -
447 -src_configure() {
448 - local myconf=""
449 -
450 - if use non-root; then
451 - myconf="${myconf} --with-user=${UGID} --with-group=${UGID}"
452 - fi
453 -
454 - # If a user has already enabled db support, those plugins will
455 - # most likely be desired as well. Besides they don't impose new
456 - # dependencies and come at no cost (except for space).
457 - if use mysql || use sqlite; then
458 - myconf="${myconf} --enable-attr-sql --enable-sql"
459 - fi
460 -
461 - # strongSwan builds and installs static libs by default which are
462 - # useless to the user (and to strongSwan for that matter) because no
463 - # header files or alike get installed... so disabling them is safe.
464 - if use pam && use eap; then
465 - myconf="${myconf} --enable-eap-gtc"
466 - else
467 - myconf="${myconf} --disable-eap-gtc"
468 - fi
469 -
470 - for mod in $STRONGSWAN_PLUGINS_STD; do
471 - if use strongswan_plugins_${mod}; then
472 - myconf+=" --enable-${mod}"
473 - fi
474 - done
475 -
476 - for mod in $STRONGSWAN_PLUGINS_OPT; do
477 - if use strongswan_plugins_${mod}; then
478 - myconf+=" --enable-${mod}"
479 - fi
480 - done
481 -
482 - econf \
483 - --disable-static \
484 - --enable-ikev1 \
485 - --enable-ikev2 \
486 - --enable-swanctl \
487 - --enable-socket-dynamic \
488 - $(use_with caps capabilities libcap) \
489 - $(use_enable curl) \
490 - $(use_enable constraints) \
491 - $(use_enable ldap) \
492 - $(use_enable debug leak-detective) \
493 - $(use_enable dhcp) \
494 - $(use_enable eap eap-sim) \
495 - $(use_enable eap eap-sim-file) \
496 - $(use_enable eap eap-simaka-sql) \
497 - $(use_enable eap eap-simaka-pseudonym) \
498 - $(use_enable eap eap-simaka-reauth) \
499 - $(use_enable eap eap-identity) \
500 - $(use_enable eap eap-md5) \
501 - $(use_enable eap eap-aka) \
502 - $(use_enable eap eap-aka-3gpp2) \
503 - $(use_enable eap md4) \
504 - $(use_enable eap eap-mschapv2) \
505 - $(use_enable eap eap-radius) \
506 - $(use_enable eap eap-tls) \
507 - $(use_enable eap xauth-eap) \
508 - $(use_enable eap eap-dynamic) \
509 - $(use_enable farp) \
510 - $(use_enable gmp) \
511 - $(use_enable gcrypt) \
512 - $(use_enable mysql) \
513 - $(use_enable networkmanager nm) \
514 - $(use_enable openssl) \
515 - $(use_enable pam xauth-pam) \
516 - $(use_enable pkcs11) \
517 - $(use_enable sqlite) \
518 - "$(systemd_with_unitdir)" \
519 - ${myconf}
520 -}
521 -
522 -src_install() {
523 - emake DESTDIR="${D}" install
524 -
525 - doinitd "${FILESDIR}"/ipsec
526 -
527 - local dir_ugid
528 - if use non-root; then
529 - fowners ${UGID}:${UGID} \
530 - /etc/ipsec.conf \
531 - /etc/strongswan.conf
532 -
533 - dir_ugid="${UGID}"
534 - else
535 - dir_ugid="root"
536 - fi
537 -
538 - diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid}
539 - dodir /etc/ipsec.d \
540 - /etc/ipsec.d/aacerts \
541 - /etc/ipsec.d/acerts \
542 - /etc/ipsec.d/cacerts \
543 - /etc/ipsec.d/certs \
544 - /etc/ipsec.d/crls \
545 - /etc/ipsec.d/ocspcerts \
546 - /etc/ipsec.d/private \
547 - /etc/ipsec.d/reqs
548 -
549 - dodoc NEWS README TODO || die
550 -
551 - # shared libs are used only internally and there are no static libs,
552 - # so it's safe to get rid of the .la files
553 - find "${D}" -name '*.la' -delete || die "Failed to remove .la files."
554 -}
555 -
556 -pkg_preinst() {
557 - has_version "<net-vpn/strongswan-4.3.6-r1"
558 - upgrade_from_leq_4_3_6=$(( !$? ))
559 -
560 - has_version "<net-vpn/strongswan-4.3.6-r1[-caps]"
561 - previous_4_3_6_with_caps=$(( !$? ))
562 -}
563 -
564 -pkg_postinst() {
565 - if ! use openssl && ! use gcrypt; then
566 - elog
567 - elog "${PN} has been compiled without both OpenSSL and libgcrypt support."
568 - elog "Please note that this might effect availability and speed of some"
569 - elog "cryptographic features. You are advised to enable the OpenSSL plugin."
570 - elif ! use openssl; then
571 - elog
572 - elog "${PN} has been compiled without the OpenSSL plugin. This might effect"
573 - elog "availability and speed of some cryptographic features. There will be"
574 - elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21,"
575 - elog "25, 26) and ECDSA."
576 - fi
577 -
578 - if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then
579 - chmod 0750 "${ROOT}"/etc/ipsec.d \
580 - "${ROOT}"/etc/ipsec.d/aacerts \
581 - "${ROOT}"/etc/ipsec.d/acerts \
582 - "${ROOT}"/etc/ipsec.d/cacerts \
583 - "${ROOT}"/etc/ipsec.d/certs \
584 - "${ROOT}"/etc/ipsec.d/crls \
585 - "${ROOT}"/etc/ipsec.d/ocspcerts \
586 - "${ROOT}"/etc/ipsec.d/private \
587 - "${ROOT}"/etc/ipsec.d/reqs
588 -
589 - ewarn
590 - ewarn "The default permissions for /etc/ipsec.d/* have been tightened for"
591 - ewarn "security reasons. Your system installed directories have been"
592 - ewarn "updated accordingly. Please check if necessary."
593 - ewarn
594 -
595 - if [[ $previous_4_3_6_with_caps == 1 ]]; then
596 - if ! use non-root; then
597 - ewarn
598 - ewarn "IMPORTANT: You previously had ${PN} installed without root"
599 - ewarn "privileges because it was implied by the 'caps' USE flag."
600 - ewarn "This has been changed. If you want ${PN} with user privileges,"
601 - ewarn "you have to re-emerge it with the 'non-root' USE flag enabled."
602 - ewarn
603 - fi
604 - fi
605 - fi
606 - if ! use caps && ! use non-root; then
607 - ewarn
608 - ewarn "You have decided to run ${PN} with root privileges and built it"
609 - ewarn "without support for POSIX capability dropping. It is generally"
610 - ewarn "strongly suggested that you reconsider- especially if you intend"
611 - ewarn "to run ${PN} as server with a public ip address."
612 - ewarn
613 - ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled."
614 - ewarn
615 - fi
616 - if use non-root; then
617 - elog
618 - elog "${PN} has been installed without superuser privileges (USE=non-root)."
619 - elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'"
620 - elog "but also a few to the IKEv2 daemon 'charon'."
621 - elog
622 - elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot"
623 - elog
624 - elog "pluto uses a helper script by default to insert/remove routing and"
625 - elog "policy rules upon connection start/stop which requires superuser"
626 - elog "privileges. charon in contrast does this internally and can do so"
627 - elog "even with reduced (user) privileges."
628 - elog
629 - elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown"
630 - elog "script to pluto or charon which requires superuser privileges, you"
631 - elog "can work around this limitation by using sudo to grant the"
632 - elog "user \"ipsec\" the appropriate rights."
633 - elog "For example (the default case):"
634 - elog "/etc/sudoers:"
635 - elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec"
636 - elog "Under the specific connection block in /etc/ipsec.conf:"
637 - elog " leftupdown=\"sudo -E ipsec _updown iptables\""
638 - elog
639 - fi
640 - elog
641 - elog "Make sure you have _all_ required kernel modules available including"
642 - elog "the appropriate cryptographic algorithms. A list is available at:"
643 - elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules"
644 - elog
645 - elog "The up-to-date manual is available online at:"
646 - elog " http://wiki.strongswan.org/"
647 - elog
648 -}
649
650 diff --git a/net-vpn/strongswan/strongswan-5.6.3.ebuild b/net-vpn/strongswan/strongswan-5.6.3.ebuild
651 deleted file mode 100644
652 index a9486f5cba7..00000000000
653 --- a/net-vpn/strongswan/strongswan-5.6.3.ebuild
654 +++ /dev/null
655 @@ -1,303 +0,0 @@
656 -# Copyright 1999-2018 Gentoo Foundation
657 -# Distributed under the terms of the GNU General Public License v2
658 -
659 -EAPI="7"
660 -inherit linux-info systemd user
661 -
662 -DESCRIPTION="IPsec-based VPN solution, supporting IKEv1/IKEv2 and MOBIKE"
663 -HOMEPAGE="https://www.strongswan.org/"
664 -SRC_URI="https://download.strongswan.org/${P}.tar.bz2"
665 -
666 -LICENSE="GPL-2 RSA DES"
667 -SLOT="0"
668 -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
669 -IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite systemd pam pkcs11"
670 -
671 -STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici"
672 -STRONGSWAN_PLUGINS_OPT="aesni blowfish ccm chapoly ctr forecast gcm ha ipseckey newhope ntru padlock rdrand save-keys unbound whitelist"
673 -for mod in $STRONGSWAN_PLUGINS_STD; do
674 - IUSE="${IUSE} +strongswan_plugins_${mod}"
675 -done
676 -
677 -for mod in $STRONGSWAN_PLUGINS_OPT; do
678 - IUSE="${IUSE} strongswan_plugins_${mod}"
679 -done
680 -
681 -COMMON_DEPEND="!net-misc/openswan
682 - gmp? ( >=dev-libs/gmp-4.1.5:= )
683 - gcrypt? ( dev-libs/libgcrypt:0 )
684 - caps? ( sys-libs/libcap )
685 - curl? ( net-misc/curl )
686 - ldap? ( net-nds/openldap )
687 - openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] )
688 - mysql? ( virtual/mysql )
689 - sqlite? ( >=dev-db/sqlite-3.3.1 )
690 - systemd? ( sys-apps/systemd )
691 - networkmanager? ( net-misc/networkmanager )
692 - pam? ( sys-libs/pam )
693 - strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )"
694 -DEPEND="${COMMON_DEPEND}
695 - virtual/linux-sources
696 - sys-kernel/linux-headers"
697 -RDEPEND="${COMMON_DEPEND}
698 - virtual/logger
699 - sys-apps/iproute2
700 - !net-vpn/libreswan
701 - selinux? ( sec-policy/selinux-ipsec )"
702 -
703 -UGID="ipsec"
704 -
705 -pkg_setup() {
706 - linux-info_pkg_setup
707 -
708 - elog "Linux kernel version: ${KV_FULL}"
709 -
710 - if ! kernel_is -ge 2 6 16; then
711 - eerror
712 - eerror "This ebuild currently only supports ${PN} with the"
713 - eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16."
714 - eerror
715 - fi
716 -
717 - if kernel_is -lt 2 6 34; then
718 - ewarn
719 - ewarn "IMPORTANT KERNEL NOTES: Please read carefully..."
720 - ewarn
721 -
722 - if kernel_is -lt 2 6 29; then
723 - ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to"
724 - ewarn "include all required IPv6 modules even if you just intend"
725 - ewarn "to run on IPv4 only."
726 - ewarn
727 - ewarn "This has been fixed with kernels >= 2.6.29."
728 - ewarn
729 - fi
730 -
731 - if kernel_is -lt 2 6 33; then
732 - ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards"
733 - ewarn "compliant implementation for SHA-2 HMAC support in ESP and"
734 - ewarn "miss SHA384 and SHA512 HMAC support altogether."
735 - ewarn
736 - ewarn "If you need any of those features, please use kernel >= 2.6.33."
737 - ewarn
738 - fi
739 -
740 - if kernel_is -lt 2 6 34; then
741 - ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only"
742 - ewarn "ESP cipher is only included in kernels >= 2.6.34."
743 - ewarn
744 - ewarn "If you need it, please use kernel >= 2.6.34."
745 - ewarn
746 - fi
747 - fi
748 -
749 - if use non-root; then
750 - enewgroup ${UGID}
751 - enewuser ${UGID} -1 -1 -1 ${UGID}
752 - fi
753 -}
754 -
755 -src_configure() {
756 - local myconf=""
757 -
758 - if use non-root; then
759 - myconf="${myconf} --with-user=${UGID} --with-group=${UGID}"
760 - fi
761 -
762 - # If a user has already enabled db support, those plugins will
763 - # most likely be desired as well. Besides they don't impose new
764 - # dependencies and come at no cost (except for space).
765 - if use mysql || use sqlite; then
766 - myconf="${myconf} --enable-attr-sql --enable-sql"
767 - fi
768 -
769 - # strongSwan builds and installs static libs by default which are
770 - # useless to the user (and to strongSwan for that matter) because no
771 - # header files or alike get installed... so disabling them is safe.
772 - if use pam && use eap; then
773 - myconf="${myconf} --enable-eap-gtc"
774 - else
775 - myconf="${myconf} --disable-eap-gtc"
776 - fi
777 -
778 - for mod in $STRONGSWAN_PLUGINS_STD; do
779 - if use strongswan_plugins_${mod}; then
780 - myconf+=" --enable-${mod}"
781 - fi
782 - done
783 -
784 - for mod in $STRONGSWAN_PLUGINS_OPT; do
785 - if use strongswan_plugins_${mod}; then
786 - myconf+=" --enable-${mod}"
787 - fi
788 - done
789 -
790 - econf \
791 - --disable-static \
792 - --enable-ikev1 \
793 - --enable-ikev2 \
794 - --enable-swanctl \
795 - --enable-socket-dynamic \
796 - $(use_enable curl) \
797 - $(use_enable constraints) \
798 - $(use_enable ldap) \
799 - $(use_enable debug leak-detective) \
800 - $(use_enable dhcp) \
801 - $(use_enable eap eap-sim) \
802 - $(use_enable eap eap-sim-file) \
803 - $(use_enable eap eap-simaka-sql) \
804 - $(use_enable eap eap-simaka-pseudonym) \
805 - $(use_enable eap eap-simaka-reauth) \
806 - $(use_enable eap eap-identity) \
807 - $(use_enable eap eap-md5) \
808 - $(use_enable eap eap-aka) \
809 - $(use_enable eap eap-aka-3gpp2) \
810 - $(use_enable eap md4) \
811 - $(use_enable eap eap-mschapv2) \
812 - $(use_enable eap eap-radius) \
813 - $(use_enable eap eap-tls) \
814 - $(use_enable eap eap-ttls) \
815 - $(use_enable eap xauth-eap) \
816 - $(use_enable eap eap-dynamic) \
817 - $(use_enable farp) \
818 - $(use_enable gmp) \
819 - $(use_enable gcrypt) \
820 - $(use_enable mysql) \
821 - $(use_enable networkmanager nm) \
822 - $(use_enable openssl) \
823 - $(use_enable pam xauth-pam) \
824 - $(use_enable pkcs11) \
825 - $(use_enable sqlite) \
826 - $(use_enable systemd) \
827 - $(use_with caps capabilities libcap) \
828 - --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
829 - ${myconf}
830 -}
831 -
832 -src_install() {
833 - emake DESTDIR="${D}" install
834 -
835 - doinitd "${FILESDIR}"/ipsec
836 -
837 - local dir_ugid
838 - if use non-root; then
839 - fowners ${UGID}:${UGID} \
840 - /etc/ipsec.conf \
841 - /etc/strongswan.conf
842 -
843 - dir_ugid="${UGID}"
844 - else
845 - dir_ugid="root"
846 - fi
847 -
848 - diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid}
849 - dodir /etc/ipsec.d \
850 - /etc/ipsec.d/aacerts \
851 - /etc/ipsec.d/acerts \
852 - /etc/ipsec.d/cacerts \
853 - /etc/ipsec.d/certs \
854 - /etc/ipsec.d/crls \
855 - /etc/ipsec.d/ocspcerts \
856 - /etc/ipsec.d/private \
857 - /etc/ipsec.d/reqs
858 -
859 - dodoc NEWS README TODO || die
860 -
861 - # shared libs are used only internally and there are no static libs,
862 - # so it's safe to get rid of the .la files
863 - find "${D}" -name '*.la' -delete || die "Failed to remove .la files."
864 -}
865 -
866 -pkg_preinst() {
867 - has_version "<net-vpn/strongswan-4.3.6-r1"
868 - upgrade_from_leq_4_3_6=$(( !$? ))
869 -
870 - has_version "<net-vpn/strongswan-4.3.6-r1[-caps]"
871 - previous_4_3_6_with_caps=$(( !$? ))
872 -}
873 -
874 -pkg_postinst() {
875 - if ! use openssl && ! use gcrypt; then
876 - elog
877 - elog "${PN} has been compiled without both OpenSSL and libgcrypt support."
878 - elog "Please note that this might effect availability and speed of some"
879 - elog "cryptographic features. You are advised to enable the OpenSSL plugin."
880 - elif ! use openssl; then
881 - elog
882 - elog "${PN} has been compiled without the OpenSSL plugin. This might effect"
883 - elog "availability and speed of some cryptographic features. There will be"
884 - elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21,"
885 - elog "25, 26) and ECDSA."
886 - fi
887 -
888 - if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then
889 - chmod 0750 "${ROOT}"/etc/ipsec.d \
890 - "${ROOT}"/etc/ipsec.d/aacerts \
891 - "${ROOT}"/etc/ipsec.d/acerts \
892 - "${ROOT}"/etc/ipsec.d/cacerts \
893 - "${ROOT}"/etc/ipsec.d/certs \
894 - "${ROOT}"/etc/ipsec.d/crls \
895 - "${ROOT}"/etc/ipsec.d/ocspcerts \
896 - "${ROOT}"/etc/ipsec.d/private \
897 - "${ROOT}"/etc/ipsec.d/reqs
898 -
899 - ewarn
900 - ewarn "The default permissions for /etc/ipsec.d/* have been tightened for"
901 - ewarn "security reasons. Your system installed directories have been"
902 - ewarn "updated accordingly. Please check if necessary."
903 - ewarn
904 -
905 - if [[ $previous_4_3_6_with_caps == 1 ]]; then
906 - if ! use non-root; then
907 - ewarn
908 - ewarn "IMPORTANT: You previously had ${PN} installed without root"
909 - ewarn "privileges because it was implied by the 'caps' USE flag."
910 - ewarn "This has been changed. If you want ${PN} with user privileges,"
911 - ewarn "you have to re-emerge it with the 'non-root' USE flag enabled."
912 - ewarn
913 - fi
914 - fi
915 - fi
916 - if ! use caps && ! use non-root; then
917 - ewarn
918 - ewarn "You have decided to run ${PN} with root privileges and built it"
919 - ewarn "without support for POSIX capability dropping. It is generally"
920 - ewarn "strongly suggested that you reconsider- especially if you intend"
921 - ewarn "to run ${PN} as server with a public ip address."
922 - ewarn
923 - ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled."
924 - ewarn
925 - fi
926 - if use non-root; then
927 - elog
928 - elog "${PN} has been installed without superuser privileges (USE=non-root)."
929 - elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'"
930 - elog "but also a few to the IKEv2 daemon 'charon'."
931 - elog
932 - elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot"
933 - elog
934 - elog "pluto uses a helper script by default to insert/remove routing and"
935 - elog "policy rules upon connection start/stop which requires superuser"
936 - elog "privileges. charon in contrast does this internally and can do so"
937 - elog "even with reduced (user) privileges."
938 - elog
939 - elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown"
940 - elog "script to pluto or charon which requires superuser privileges, you"
941 - elog "can work around this limitation by using sudo to grant the"
942 - elog "user \"ipsec\" the appropriate rights."
943 - elog "For example (the default case):"
944 - elog "/etc/sudoers:"
945 - elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec"
946 - elog "Under the specific connection block in /etc/ipsec.conf:"
947 - elog " leftupdown=\"sudo -E ipsec _updown iptables\""
948 - elog
949 - fi
950 - elog
951 - elog "Make sure you have _all_ required kernel modules available including"
952 - elog "the appropriate cryptographic algorithms. A list is available at:"
953 - elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules"
954 - elog
955 - elog "The up-to-date manual is available online at:"
956 - elog " http://wiki.strongswan.org/"
957 - elog
958 -}