Commit Graph

118 Commits

Author SHA1 Message Date
Philip Prindeville 93cbdcbef5 strongswan: add /etc/config/ipsec to sysupgrade list
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-08-01 14:57:39 -06:00
Noel Kuntze 6c3d30c0cb
strongswan: update to version 5.9.3
Signed-off-by: Noel Kuntze <noel.kuntze@thermi.consulting>
2021-07-18 04:30:35 +02:00
Philip Prindeville 40d30f123d strongswan: trivial improvement in 'stroke' packaging
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-07-01 12:12:15 -06:00
Philip Prindeville d279a64df8 strongswan: add priority option
Also from Vincent Wiemann <vincent.wiemann@ironai.com>.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:45:43 -06:00
Philip Prindeville 6c79715676 strongswan: add ipcomp support
Also from Vincent Wiemann <vincent.wiemann@ironai.com>.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:34:45 -06:00
Philip Prindeville 11ff072672 strongswan: add interface option for children
This option sets the interface of the policy.

Also from Vincent Wiemann <vincent.wiemann@ironai.com>.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:31:31 -06:00
Philip Prindeville 0231e043b7 strongswan: add support for hw_offload
Also from Vincent Wiemann <vincent.wiemann@ironai.com>.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:31:31 -06:00
Philip Prindeville 0fe23b0e4a strongswan: miscellaneous cleanup of config file, etc
Use list's where appropriate for multi-value config variables.

Forbid absolute/relative paths for certificate and key files.

Get rid of last remnants of left/right naming.

Factor invariant code paths.

Drop redundant secrets.rsa.filename section.

Thanks to Vincent Wiemann <vincent.wiemann@ironai.com> for calling
out many of these improvements.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:31:31 -06:00
Philip Prindeville 09dcf7486d strongswan: rename config functions
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-27 16:31:31 -06:00
Vincent Wiemann 59732ba018 strongswan: fix PSK config generation
There were closing curly braces missing and it was checking for empty
strings while it should have been checking for non-empty strings.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
2021-06-18 04:42:01 +02:00
Philip Prindeville cac7608211 strongswan: use correct directory for CA's
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-17 18:53:08 -06:00
Philip Prindeville 2ccd2665cb strongswan: fix sharing of ipsec section variables
Variables set in config_ipsec() need to be shared with do_postamble()
function, so change scoping to parent (prepare_env()).

Also, remove unused settings like "remote_sourceip", "reqid", and
"packet_marker".

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-17 09:46:55 -06:00
Philip Prindeville a783986cbc strongswan: start charon directly from swanctl
ipsec uses starter, and reads /etc/ipsec.conf (which then includes
/var/ipsec/ipsec.conf, etc). This is overly complicated, and can
be problematic if you're using both swanctl and ipsec for migration.

Running charon directly from procd via the init.d script avoid
all of this.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-02 00:23:54 -06:00
Philip Prindeville c6e94656c3
Merge pull request #15601 from pprindeville/strongswan-make-swanctl-default
strongswan: make default bundle use swanctl
2021-05-14 11:49:35 -06:00
Philip Prindeville 8eba0209ab strongswan: make default bundle use swanctl
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-05-10 22:17:00 -06:00
Philip Prindeville ba79998e52 strongswan: swanctl init script doesn't load connections
Fixes issue #15446

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-05-05 11:58:34 -06:00
Philip Prindeville 9217aa859f strongswan: change name of config base directory
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-15 17:57:48 -06:00
Philip Prindeville a3f625954a strongswan: add certificate generation utility
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-15 13:10:08 -06:00
Philip Prindeville 505db629de strongswan: add deprecation warning to ipsec script
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-14 12:27:07 -06:00
Philip Prindeville ff33f4ccd3 strongswan: handle chacha20poly1305 as AEAD
chacha20policy1305 is also an AEAD cipher, and hence does not
permit a hash algorithm.

Fixes issue #15397.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-13 12:46:07 -06:00
Philip Prindeville c95fd69973 strongswan: fail on serious configuration errors
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-13 12:46:07 -06:00
Philip Prindeville 210640d606 strongswan: drop subshell when possible
A subshell caused by $(...) can't persistently modify globals as a
side-effect.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-13 12:45:57 -06:00
Eneas U de Queiroz e50ba32402
strongswan: libnttft must not select strongswan
The strongswan-libnttfft package should not select the strongswan
package, but should depend on it instead.  Otherwise a circular
dependency is created.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-04-09 23:54:43 -03:00
Philip Prindeville e44b2665e7
Merge pull request #6924 from derekyerger/strongswan-lattice-sha3
strongswan: add more crypto plugins
2021-04-08 22:26:56 -06:00
Philip Prindeville ae3d5aa73e strongswan: bump to 5.9.2
Retire weak algorithms like MD5 and 3DES.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-05 14:58:54 -07:00
Derek Yerger 4c1fc7e311 strongswan: add more crypto plugins
Adds modules for BLISS signature scheme, NTRU and New Hope key
exchange algorithms, and dependencies ChaCha20-Poly1305 AEAD,
ChaCha20 XOF, MGF1 mask generation function, SHA3 hasher SHAKE
XOF, and the Number Theoretic Transform library.

Signed-off-by: Derek Yerger <derek@altdevs.net>
2021-04-05 14:31:49 -05:00
Philip Prindeville a72780a9c2 strongswan: force PIC on all builds
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-05 07:31:40 -10:00
Philip Prindeville f9d91f1f47 strongswan: migrate to swanctl configs
Derived from the ipsec initd script, with the following changes:

(1) various code improvements, corrections (get rid of left/right
    updown scripts, since there's only one), etc;
(2) add reauth and fragmentation parameters;
(3) add x.509 certificate-based authentication;

and other minor changes.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-04 11:58:51 -06:00
Philip Prindeville baa38a1420 strongswan: remove synthesized ipsec conf files
If you shutdown ipsec service, and it doesn't clean up
/var/ipsec/ipsec.conf, then when you start swanctl service it
might see an incompatible file on startup.  Remedy is to
remove unneeded files when shutting down the service.  They
can always be regenerated when the service starts again.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-01 15:06:00 -06:00
Philip Prindeville e626255b37 strongswan: move ipsec conf files to subpackage
These config files are only used by the ipsec interface to charon,
and shouldn't be part of the base package.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-03-31 21:19:40 -06:00
Philip Prindeville 643df01275 strongswan: make the include's in the .conf files persistent
Having scripts diddle user written config files seems potentially
dangerous.  Plus there's really no downside to including some
empty files.  Best to just make the includes be permanent.

Additional feature suggested by Luiz: if a -opkg version of the
config file was created unnecessarily, remove it as part of the
upgrade process since changes won't be happening to that file
as an artifact of the service starting.  The include lines are
now permanent, which means that (1) additional configuration
synthesized by UCI won't be anywhere that opkg (or sysupgrade,
for that matter) cares about since it won't be persistent, and
(2) if changes are being made, then they're being done by a
person with an editor and they really should be distinguished.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-03-26 14:29:32 -06:00
Philip Prindeville 0bd4410e30 strongswan: change maintainers
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-03-25 21:37:56 -06:00
Philip Prindeville ec72d3a9e4 strongswan: fix local_gateway discovery
This has been observed by myself and @luizluca: ip route get is
appending uid0 to the output, as seen from:

root@OpenWrt2:~# ip route get 1.1.1.1
1.1.1.1 via 174.27.160.1 dev eth3 src 174.27.182.184 uid 0
    cache
root@OpenWrt2:~#

so the fix is an anchored match, discarding all else. Also, using
ip -o means never having to do multiline matches...

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-02-16 13:32:26 -07:00
Philip Prindeville af866db607
Merge pull request #14668 from pprindeville/strongswan-create-swanctl.d-dir
strongswan: create /etc/swanctl/conf.d directory
2021-02-09 22:24:20 -07:00
Philip Prindeville 6753414f85 strongswan: include /etc/swanctl/conf.d/ directory
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-02-08 23:51:45 -07:00
Philip Prindeville 9ddc502872 strongswan: avoid duplicate logging
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-02-05 22:10:29 -07:00
Stijn Tintel 5f0918281b strongswan: bump to 5.9.1
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-11-30 19:02:57 +02:00
Stijn Tintel 35ef427185 strongswan: bump to 5.9.0
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-09-02 23:20:33 +03:00
Michael C. Bazarewsky 51214e191f strongswan: add left and mark configuration to UCI
This commit allows for UCI configuration of the "left=" and the
"mark=" values in a StrongSwan IPSec connection.  This improves
VTI support and allows certain stricter connection scenarios.

Signed-off-by: Michael C. Bazarewsky <github@bazstuff.com>
2020-08-27 16:06:34 -04:00
Stijn Tintel d1e31481ec strongswan: bump to 5.8.4
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-05-08 06:02:32 +03:00
Stijn Tintel b5eb749a0d strongswan: move ipsec.* to strongswan-ipsec
When building with strongswan-ipsec disabled, strongswan fails to build
because the ipsec.conf file does not exist. Fix this by moving the
ipsec.* files and directories to the strongswan-ipsec package.

Closes #10879 while keeping ipsec.conf to avoid breaking existing
setups, as opposed to #11709.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-03-30 14:50:18 +03:00
Sven Roederer 49f298eb74
strongswan: add conffiles for swanctl util
Add a conffiles-section for the /etc/swanctl folder, which is used by the  swanctl util. This will keep the configfiles during an sysupgrade.

Signed-off-by: Sven Roederer <S.Roederer@colvistec.de>
2020-03-25 12:03:48 +01:00
Eneas U de Queiroz 404c113bc2
strongswan: quote 'comment' parameter in Config.in
Newer versions of the kconfig generator require quotes.  Prepare the
package for an eventual update.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2020-03-18 09:40:54 -03:00
Stijn Tintel f68f23f094 strongswan: bump to 5.8.2
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-01-17 00:53:36 +02:00
Paul Fertser a8fa557cd5 strongswan: allow to specify per-connection reqid with UCI
This is useful to assign all traffic to a fw3 zone, e.g.:

/etc/config/ipsec:

config remote 'test'
	list tunnel		'dev'
...

config 'tunnel' 'dev'
	option reqid		'33'
...

/etc/config/firewall:

config zone
	option name		wan
	option extra_src	"-m policy --pol none --dir in"
	option extra_dest	"-m policy --pol none --dir out"
...

config zone
	option name		vpn
	# subnet needed for firewall3 before 22 Nov 2019, 8174814a
	list subnet		'0.0.0.0/0'
	option extra_src	"-m policy --pol ipsec --dir in --reqid 33"
	option extra_dest	"-m policy --pol ipsec --dir out --reqid 33"
...

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2019-11-26 15:27:54 +03:00
Jan Pavlinec 299e5b0a9b
treewide: add PKG_CPE_ID for better cvescanner coverage
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
2019-09-17 12:40:26 +02:00
Stijn Tintel 6bcfacca5e strongswan: bump to 5.8.1
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-09-16 02:28:20 +03:00
Sven Eckelmann bbb1ea7345 treewide: Change .*GPL.*+ licenses to SPDX compatible identifier
The CONTRIBUTING.md requests an (or multiple) SPDX identifier for GPL
licenses. But a lot of packages did use a different, non-SPDX style with a
"+" at the end instead of "-or-later".

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-09-10 07:45:15 +02:00
Lucian Cristian 179175e27c strongswan: update to 5.8.0
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
2019-05-23 20:54:28 +03:00
Moritz Warning 21e989190e strongswan: collapse menu items
Signed-off-by: Moritz Warning <moritzwarning@web.de>
2019-03-27 18:21:54 +01:00