Commit Graph

16525 Commits

Author SHA1 Message Date
Adi Nissim 8ced1570ab child-cfg: Make HW offload auto mode configurable
Until now the configuration available to user for HW offload were:
hw_offload = no
hw_offload = yes

With this commit users will be able to configure auto mode using:
hw_offload = auto

Signed-off-by: Adi Nissim <adin@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
2018-03-21 10:32:02 +01:00
Tobias Brunner ee26f7156f kernel-netlink: Cleanup and fix some HW offload code issues
Besides some style issues there were some incorrect allocations
for ethtool requests.
2018-03-21 10:29:57 +01:00
Adi Nissim 338cc5812e kernel-netlink: Add new automatic hw_offload mode
Until now there were 2 hw_offload modes: no/yes
* hw_offload = no  : Configure the SA without HW offload.
* hw_offload = yes : Configure the SA with HW offload.
                     In this case, if the device does not support
                     offloading, SA creation will fail.

This commit introduces a new mode: hw_offload = auto
----------------------------------------------------
If the device and kernel support HW offload, configure
the SA with HW offload, but do not fail SA creation otherwise.

Signed-off-by: Adi Nissim <adin@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
2018-03-21 10:28:44 +01:00
Adi Nissim aad9bd3613 ipsec-types: Create new enum hw_offload_t
Add the new enum in order to add HW offload auto mode.

Signed-off-by: Adi Nissim <adin@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
2018-03-21 10:27:38 +01:00
Martin Willi 3b29590b70 starter: Ignore an existing PID file if it references ourself 2018-03-21 10:25:49 +01:00
Martin Willi 83187f3883 charon-tkm: Ignore an existing PID file if it references ourself 2018-03-21 10:25:49 +01:00
Martin Willi 9655a3ffbc charon: Ignore an existing PID file if it references ourself
If a daemon PID file references the process that does the check, it is safe
to ignore it; no running process can have the same PID. While this is rather
unlikely to get restarted with the same PID under normal conditions, it is
quite common when running inside PID namespaced containers: If a container
gets stopped and restarted with a PID file remaining, it is very likely that
the PID namespace assigns the same PID to our service, as they are assigned
sequentially starting from 1.
2018-03-21 10:25:49 +01:00
Tobias Brunner a7005e435b diffie-hellman: Remove unused exponent length initialization in get_params()
This isn't used anymore since 46184b07c1 ("diffie-hellman: Explicitly
initialize DH exponent sizes during initialization").
2018-03-21 10:21:32 +01:00
Tobias Brunner 8b6f615741 diffie-hellman: Don't set exponent length for DH groups with prime order subgroups
According to RFC 5114 the exponent length for these groups should always equal
the size of their prime order subgroup.
This was handled correctly before the initialization was done during
library initialization.

Fixes: 46184b07c1 ("diffie-hellman: Explicitly initialize DH exponent sizes during initialization")
2018-03-21 10:21:32 +01:00
Tobias Brunner ee019ab321 proposal: Make sure non-AEAD IKE proposals contain integrity algorithms 2018-03-21 10:15:18 +01:00
Tobias Brunner 42a6b187f7 proposal: Compress arrays after removing transforms 2018-03-21 10:15:18 +01:00
Tobias Brunner a48f3d8939 ikev2: Use correct type to check for selected signature scheme
The previous code was obviously incorrect and caused strange side effects
depending on the compiler and its optimization flags (infinite looping seen
with GCC 4.8.4, segfault when destroying the private key in build() seen
with clang 4.0.0 on FreeBSD).

Fixes #2579.
2018-03-21 10:12:59 +01:00
Tobias Brunner 70d99d67d6 vici: Make sure to read all requested data from socket in Perl binding
Closes strongswan/strongswan#91.
2018-03-21 10:10:35 +01:00
Tobias Brunner d3b9db688a libimcv: Add Debian 8.10 to IMV database
References #2582.
2018-03-20 09:20:17 +01:00
Tobias Brunner 0acd1ab4d0 stroke: Ensure a minimum message length 2018-03-19 18:06:00 +01:00
Matus Fabian 04ede658c8 libipsec: Fix ip_packet_create_from_data() version field in IPv6 header
Closes strongswan/strongswan#92.

Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-19 11:01:10 +01:00
Tobias Brunner dc2dfedda9 testing: Use HA patch compatible with 4.15.6+ 2018-03-08 10:07:33 +01:00
Tobias Brunner 39e860ea34 testing: Use a HA patch that's actually compatible with 4.15 kernels 2018-03-07 17:16:54 +01:00
Tobias Brunner 0f785f6be8 testing: Revert typo fix in FreeRADIUS patch
Fixes: 2db6d5b8b3 ("Fixed some typos, courtesy of codespell")
Fixes #2582.
2018-03-07 16:39:37 +01:00
Tobias Brunner 53827a5fde load-tester: Start numbering IDs from 1 again
ref_get() increments the number before returning it.

Fixes: 2cbaa63295 ("load-tester: Fix race condition issuing same identity")
2018-03-07 15:41:56 +01:00
Tobias Brunner f71cccec6f Merge branch 'pbkdf2-sha2'
Adds support for common SHA-2 based PRFs in PKCS#5/PBKDF2 as used by
OpenSSL 1.1 when generating PKCS#8-encoded private keys.

Fixes #2574.
2018-03-07 15:24:56 +01:00
Tobias Brunner 954f73ea6e charon-nm: Parse any type of private key not only RSA 2018-03-07 15:23:03 +01:00
Tobias Brunner 5808467ed1 pkcs5: Parse PRF algorithms if given in PBKDF2-params as defined in RFC 8018
We can't use ASN1_DEF, which would technically be more correct, as the
ASN.1 parser currently can't handle that.  For algorithm identifiers we
often use ASN1_EOC as type (with ASN1_RAW), however, that doesn't work with
ASN1_DEF because the element is assumed missing if the type doesn't match.
On the other hand, we can't set the type to ASN1_SEQUENCE because then the
parser skips the following rule if the element is missing (it does so for
all constructed types, but I guess is mainly intended for context tags),
which in this case overruns the parser rules array.
2018-03-07 15:23:03 +01:00
Tobias Brunner e5c5792ff8 prf: Add helper function to convert OIDs to algorithm identifiers 2018-03-07 15:23:03 +01:00
Tobias Brunner ba16a95454 asn1: Add OIDs for HMAC-based PRFs as defined in RFC 8018 2018-03-07 15:23:03 +01:00
Tobias Brunner b53eb857bf Merge branch 'unknown-transform-types'
This changes how unknown transform types are handled in proposals.  In
particular we make sure not to accept a proposal if it contains unknown
transform types (they were just ignored previously, which could have
resulted in an invalid selected proposal).

Fixes #2557.
2018-03-07 14:25:48 +01:00
Tobias Brunner 6b8749ab18 proposal: Compare algorithms of all transform types for equality 2018-03-05 12:25:19 +01:00
Tobias Brunner 76c7c951e1 proposal: Make sure to consider all transform types when selecting proposals
This way there will be a mismatch if one of the proposals contains
transform types not contained in the other (the fix list of transform
types used previously resulted in a match if unknown transform types
were contained in one of the proposals).  Merging the sets of types
makes comparing proposals with optional transform types easier (e.g.
DH for ESP with MODP_NONE).
2018-03-05 12:23:59 +01:00
Tobias Brunner 5eb094df11 proposal: Print all algorithms even those with currently unknown transform types 2018-03-05 12:05:36 +01:00
Tobias Brunner cc55461c8d proposal: Keep track of contained transform types 2018-03-05 12:05:36 +01:00
Tobias Brunner ec1ebb2377 transform: Move internal identifiers out of private range
Avoid any conflicts if implementations use transform types in the
private range.
Also removed the unused UNKNOWN_TRANSFORM_TYPE identifier.
2018-03-05 12:05:36 +01:00
Tobias Brunner 0d06cbd66e unit-tests: Ignore binaries of renamed test runners
Fixes: 9cc61baaf5 ("unit-tests: Rename targets for libstrongswan and kernel-netlink")
2018-03-02 17:11:27 +01:00
Tobias Brunner cdfa0ba4d1 libimcv: Fix typo in PTS hash algorithm mapping for 512-bit SHA-3
Fixes: 40f2589abf ("gmp: Support of SHA-3 RSA signatures")
2018-03-02 08:30:13 +01:00
Tobias Brunner 2f5d6be5a0 kernel-netlink: Ignore local routes in any table
Such routes seem to show up in tables other than local with recent kernels.

Fixes #2555.
2018-02-28 15:32:41 +01:00
Tobias Brunner 9189aec666 kernel-netlink: Ignore routes with next hop during local subnet enumeration
These are not locally attached and we do the same already in kernel-pfroute.

Fixes #2554.
2018-02-28 15:32:30 +01:00
Tobias Brunner d9400f44d8 kernel-netlink: Simplify rt_entry_t initialization 2018-02-28 15:32:25 +01:00
Tobias Brunner 958a0545e5 nm: Version bump to 1.4.4 2018-02-28 15:30:42 +01:00
Tobias Brunner 07f6cfe910 nm: Update German translation 2018-02-28 15:29:39 +01:00
Tobias Brunner 5bb197d880 nm: Fix tooltips for proposal text fields
There is no ! syntax as the default proposal is only used if no custom
proposal is configured.
2018-02-28 15:22:41 +01:00
Tobias Brunner 479af1ed76 Merge branch 'incorrect-inval-ke'
This improves the behavior during CREATE_CHILD_SA exchanges if the peer
sends an INVALID_KE_PAYLOAD with a DH group we didn't request or continues
to return the same notify even if we use the requested group.

Fixes #2536.
2018-02-23 09:33:48 +01:00
Tobias Brunner 574f74d232 child-rekey: Don't destroy IKE_SA if initiating CHILD_SA rekeying failed
This could happen if the peer e.g. selects an invalid DH group or
responds multiple time with an INVALID_KE_PAYLAOD notify.
2018-02-23 09:25:46 +01:00
Tobias Brunner 4f1bf89ed9 child-create: Fail if we already retried with a requested DH group
With faulty peers that always return the same unusable DH group in
INVALID_KE_PAYLOADs we'd otherwise get stuck in a loop.
2018-02-23 09:25:46 +01:00
Tobias Brunner 7754c714c1 child-create: Make sure we actually propose the requested DH group
If we receive an INVALID_KE_PAYLOAD notify we should not just retry
with the requested DH group without checking first if we actually propose
the group (or any at all).
2018-02-23 09:25:46 +01:00
Tobias Brunner ecbcfbdaa1 child-create: Make sure the returned KE payload uses the proposed DH group 2018-02-23 09:25:46 +01:00
Tobias Brunner 529ffc2fe3 child-sa: Don't update outbound policies if they are not installed
After a rekeying we keep the inbound SA and policies installed for a
while, but the outbound SA and policies are already removed.  Attempting
to update them could get the refcount in the kernel interface out of sync
as the additional policy won't be removed when the CHILD_SA object is
eventually destroyed.
2018-02-22 11:38:43 +01:00
Tobias Brunner ca79bd54ff child-sa: Don't try to update outbound SA if it is not installed anymore 2018-02-22 11:38:38 +01:00
Tobias Brunner 6df2938fd2 Merge branch 'trap-manager-uninstall'
This changes how trap policies are deleted in order to avoid conflicts if a
trap policy with changed peer config is concurrently removed and reinstalled
under a different name (the reqid will be the same, so the wrong policy
could have been deleted by the old code).
2018-02-22 11:36:53 +01:00
Tobias Brunner a541cf05c1 trap-manager: Remove unused find_reqid() method
It might actually have returned an incorrect result if there were child
configs for different peer configs sharing the same name.
2018-02-22 11:31:05 +01:00
Tobias Brunner c9998e5fea child-sa: No need to find reqid of existing trap policy
When initiating a trap policy we explicitly pass the reqid along.  I guess
the lookup was useful to get the same reqid if a trapped CHILD_SA is manually
initiated.  However, we now get the same reqid anyway if there is no
narrowing.  And if the traffic selectors do get narrowed the reqid will be
different but that shouldn't be a problem as that doesn't cause an issue with
any temporary SAs in the kernel (this is why we pass the reqid to the
triggered CHILD_SA, otherwise, no new acquire would get triggered for
traffic that doesn't match the wider trap policy).
2018-02-22 11:31:05 +01:00
Tobias Brunner 24fa1bb02a trap-manager: Remove reqid parameter from install() and change return type
Reqids for the same traffic selectors are now stable so we don't have to
pass reqids of previously installed CHILD_SAs.  Likewise, we don't need
to know the reqid of the newly installed trap policy as we now uninstall
by name.
2018-02-22 11:31:05 +01:00