Commit Graph

17314 Commits

Author SHA1 Message Date
Andreas Steffen a43407df52 drbg: Don't generate more than 2^16 bytes 2019-11-28 21:29:26 +01:00
Tobias Brunner 8b6aadae9c Merge branch 'aes-ecb'
Adds support for AES in ECB mode (where supported by the underlying
library/API) and uses it for the CTR-DRBG implementation.
2019-11-28 17:16:36 +01:00
Andreas Steffen 86a4b95eac drbg: Use AES_ECB encryption 2019-11-28 17:03:09 +01:00
Andreas Steffen b7e840af5c gcrypt: Added AES_ECB support 2019-11-28 17:03:09 +01:00
Andreas Steffen a46e436e29 af-alg: Added AES_ECB support 2019-11-28 17:03:09 +01:00
Andreas Steffen f884ee6497 aes: Added AES_ECB support 2019-11-28 17:03:09 +01:00
Andreas Steffen 6f44bd6fe8 openssl: Added AES_ECB support 2019-11-28 17:03:08 +01:00
Andreas Steffen 20f3d04b13 aesni: Added AES_ECB support 2019-11-28 17:03:08 +01:00
Tobias Brunner 1352413272 vici: Update Python egg if strongSwan version changed
Mainly useful when using the build-strongswan script of the testing
environment.
2019-11-28 16:52:30 +01:00
Andreas Steffen 11e9d2b8d1 drbg: The drbg instance owns the entropy rng 2019-11-28 09:55:56 +01:00
Andreas Steffen ccaedf8761 Version bump to 5.8.2dr2 2019-11-26 22:36:55 +01:00
Tobias Brunner b290f43c5f Merge branch 'hash-url-multi-level'
Adds support to send intermediate CA certificates in hash-and-URL
encoding.  For that it moves the generation of URLs from the config
backends to the ike-cert-post task.

Fixes #3234.
2019-11-26 14:48:25 +01:00
Tobias Brunner 91dabace11 testing: Add scenario with hash-and-URL encoding for intermediate CA certificates 2019-11-26 11:12:26 +01:00
Tobias Brunner d592ff72bc stroke: Remove obsolete certificate registration for hash-and-URL 2019-11-26 11:12:26 +01:00
Tobias Brunner ad14f3a60d vici: Remove obsolete certificate registration for hash-and-URL 2019-11-26 11:12:26 +01:00
Tobias Brunner d384f40f20 ike-cert-post: Encode intermediate CA certificates as hash-and-URL if possible 2019-11-26 11:12:26 +01:00
Tobias Brunner ae06cfad36 ike-cert-post: Generate URL for hash-and-URL here
This avoids having to register certificates with authority/ca backends
beforehand, which is tricky for intermediate CA certificates loaded
themselves via authority/ca sections.  On the other hand, the form of
these URLs can't be determined by config backends anymore (not an issue
for the two current implementations, no idea if custom implementations
ever made use of that possibility).  If that became necessary, we could
perhaps pass the certificate to the CDP enumerator or add a new method
to the credential_set_t interface.
2019-11-26 11:12:26 +01:00
Thomas Egerer a605452c03 kernel-netlink: Check for offloading support in constructor
This avoids races that could potentially occur when doing the check during
SA installation.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2019-11-26 11:00:28 +01:00
Tobias Brunner 29b4b2e8e2 testing: Import sys in Python updown script 2019-11-21 16:57:25 +01:00
Tobias Brunner ec2d2e4e5f android: New version after fixing fetching via HTTP on Android 9 2019-11-19 14:44:39 +01:00
Tobias Brunner 47c1e86a4c android: Add networkSecurityConfig to fetch CLRs/OCSP via HTTP
Android 9 restricts this to only HTTPS by default.

Fixes #3273.
2019-11-19 14:44:39 +01:00
Tobias Brunner e65f6c20da android: Update Gradle plugin 2019-11-19 14:44:39 +01:00
Tobias Brunner 0663ca5f57 Fix Android.mk for libstrongswan after adding DRBGs 2019-11-19 14:44:39 +01:00
Tobias Brunner 662574386a testing: Accept LANG and LC_* env variables via SSH on guests
The client config already includes SendEnv for them.  Without that these
variables currently default to POSIX.
2019-11-14 16:11:03 +01:00
Tobias Brunner 7cde77c638 swanctl: Document wildcard matching for remote identities 2019-11-12 10:59:38 +01:00
Tobias Brunner eea58222d5 conf: Replace deprecated OptionParser with ArgumentParser 2019-11-12 10:58:07 +01:00
zhangkaiheb@126.com a5b3c62091 testing: Remove unused connection definition in ikev2/force-udp-encaps 2019-11-07 11:35:43 +01:00
zhangkaiheb@126.com 9d8d85f23c testing: Fix SHA description in ikev*/esp-alg-null scenarios 2019-11-07 11:33:09 +01:00
Tobias Brunner 07083788e5 proposal: Fix typos and clarify things in comments 2019-11-04 15:22:18 +01:00
Kenyon Ralph 64e68d2298 man: Correct typo in description of closeaction
Closes strongswan/strongswan#158.
2019-10-29 10:50:49 +01:00
Tobias Brunner a0a03c25f7 Merge branch 'enum-strings'
Adds a compile check the number of enum strings and updates several of
these lists, in particular, the one in the pfkey-kernel plugin, where
strings for several new extensions on FreeBSD were missing.

Fixes #3210.
2019-10-28 18:46:11 +01:00
Tobias Brunner f3d8179b4b kernel-pfkey: Add additional strings for extensions on different platforms
Don't define structs for macOS as we don't need them (that's true for
most of the others too, though) and at least one is defined inside an extra
ifdef.
2019-10-28 14:26:32 +01:00
Tobias Brunner 45c8399d78 Add missing strings to several enum string definitions 2019-10-28 14:26:32 +01:00
Tobias Brunner 8b98482e04 enum: Add compile-time check for missing strings
If strings are missing (e.g. because the last value of a range changed
unknowingly or adding a string was simply forgotten) compilation will
now fail.

This could be problematic if the upper limit is out of our control (e.g.
from a system header like pfkeyv2.h), in which case patches might be
required on certain platforms (enforcing at least, and not exactly, the
required number of strings might also be an option to compile against
older versions of such a header - for internal enums it's obviously
better to enforce an exact match, though).
2019-10-28 14:26:32 +01:00
Tobias Brunner 1bf58f6ad8 kernel-netlink: Support extended table IDs for custom routes
This adds support for installing routes in tables with IDs > 255.
2019-10-25 16:21:22 +02:00
Tobias Brunner 08d0342ca6 vici: List additional information for deleted CHILD_SAs
If a CHILD_SA is terminated, the updown event is triggered after the
CHILD_SA is set to state CHILD_DELETED, so no usage stats or detail
information like SPIs were reported.  However, when an IKEv2 SA is
terminated, the updown event for its children is triggered without
changing the state first, that is, they usually remain in state
INSTALLED and detailed data was reported in the event.  IKEv1
CHILD_SAs are always terminated individually, i.e. with state
change and no extra data so far.

With this change usage stats are also returned for individually deleted
CHILD_SAs as long as the SA has not yet expired.

Fixes #3198.
2019-10-25 16:15:42 +02:00
Tobias Brunner 62e7c68b61 kernel-pfkey: Clear receive buffer before sending request
Many of the messages sent by the kernel, including confirmations to our
requests, are sent as broadcasts to all PF_KEY sockets.  So if an
external tool is used to manage SAs/policies (e.g. unrelated to IPsec)
the receive buffer might be filled, resulting in errors like these:

  error sending to PF_KEY socket: No buffer space available

To avoid this, just clear the buffer before sending any message.

Fixes #3225.
2019-10-25 13:53:06 +02:00
Tobias Brunner a463ef4435 Merge branch 'proposal-flags'
This uses flags for proposal selection and cloning that control
whether DH groups and algorithms from a private range are skipped, and
for selection whether configured or supplied proposals/algorithms are
preferred.
2019-10-24 17:47:45 +02:00
Tobias Brunner ec93acff03 proposal: Remove unused strip_dh() method 2019-10-24 17:43:21 +02:00
Tobias Brunner a2cb2c9cc8 proposal: Add selection flags to clone() method
This avoids having to call strip_dh() in child_cfg_t::get_proposals().
It also inverts the ALLOW_PRIVATE flag (i.e. makes it SKIP_PRIVATE) so
nothing has to be supplied to clone complete proposals.
2019-10-24 17:43:21 +02:00
Tobias Brunner 3187293e3d quick-mode: Promote selected DH group instead of stripping all others
Since only the first DH group is encoded for IKEv1 this should have the
same effect as removing all other groups.
2019-10-24 17:36:37 +02:00
Tobias Brunner c9599d4101 proposal: Extract proposal selection code in ike/child_cfg_t
Also invert the PREFER_CONFIGURED flag (i.e. make it PREFER_SUPPLIED)
so the default, without flags, is what we preferred so far.
2019-10-24 17:36:33 +02:00
Tobias Brunner a406bc60c5 proposal: Handle skipping DH groups directly in select() and matches()
Also renames the flag.
2019-10-24 17:33:57 +02:00
Thomas Egerer f930b732c4 proposal: Use flags to select/match proposals
During proposal selection with ike/child_cfgs a couple of boolean
variables can be set (e.g. private, prefer_self, strip_dh). To simplify
the addition of new parameters, these functions now use a set of flags
instead of indiviual boolean values.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2019-10-24 17:22:53 +02:00
Tobias Brunner 8346db09dd travis: Bump wolfSSL to 4.2.0 2019-10-23 17:50:20 +02:00
Tobias Brunner b3db361727 Merge branch 'ipv6-addrs-mobike'
Address enumeration on Linux now ignores deprecated addresses and
whether temporary or permanent IPv6 addresses are included now depends
on the charon.prefer_temporary_addrs setting.

Closes #3192.
2019-10-22 14:55:28 +02:00
Tobias Brunner 9f12b8a61c kernel-netlink: Enumerate temporary IPv6 addresses according to config
This way we announce only permanent addresses via MOBIKE by default, and
temporary ones if the option is enabled.
2019-10-22 14:14:44 +02:00
Tobias Brunner 64795cc416 kernel-netlink: Don't enumerate deprecated IPv6 addresses 2019-10-22 14:13:32 +02:00
Tobias Brunner cf98706bb8 utils: Handle NULL consistently if memwipe() is implemented via explicit_bzero()
Our own implementation ignores NULL values, however, explicit_bzero()
can't handle that, as indicated by the `__nonnull ((1))` attribute in the
function's signature in string.h, and causes a segmentation fault.  This
was noticed in one of the unit tests for NewHope.  Since we usually use
memwipe() via chunk_clear(), which already ignores NULL pointers, this
is not that much of an issue in practice.

Fixes: 149d1bbb05 ("memory: Use explicit_bzero() as memwipe() if available")
2019-10-21 13:58:12 +02:00
Tobias Brunner 393e39a1bc travis: Switch to the Ubuntu 18.04 (bionic) image for tests
Do two full build tests on 16.04 (xenial) and the two for OpenSSL 1.0
also run there.  Since 18.04 ships OpenSSL 1.1.1, which conflicts with
our custom built version, we skip that until OpenSSL 3.0 is released.
A workaround is required for an issue with sonarqube on bionic.
2019-10-21 13:58:12 +02:00