Commit Graph

16504 Commits

Author SHA1 Message Date
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
Tobias Brunner f42dd430d8 trap-manager: Compare peer config name during installation 2018-02-22 11:31:05 +01:00
Tobias Brunner ca213e1907 trap-manager: Uninstall trap policies by name and not reqid
If a trap policy is concurrently uninstalled and reinstalled under a
different name the reqid will be the same so the wrong trap might be
removed.
2018-02-22 11:31:05 +01:00
Tobias Brunner 6f569263a0 vici: Remove external enumeration to uninstall shunt policies 2018-02-22 11:31:05 +01:00
Tobias Brunner 9d69d8a399 stroke: Remove external enumeration to unroute shunt policies 2018-02-22 11:31:05 +01:00
Tobias Brunner 57ea3f73bb shunt-manager: Remove first match if no namespace given during uninstall
Also makes namespace mandatory.
2018-02-22 11:31:05 +01:00
Tobias Brunner c1c63a400e appveyor: Allow events to trigger early in threading unit tests
The timed wait functions tested in the threading unit tests often but
randomly trigger a bit early on AppVeyor Windows containers.  We allow this
if it is not earlier than 5ms.
2018-02-22 09:19:14 +01:00
Tobias Brunner ee8c25516a charon-nm: Fix building list of DNS/MDNS servers with libnm
g_variant_builder_add() creates a new GVariant using g_variant_new() and
then adds it to the builder.  Passing a GVariant probably adds the
pointer to the array, not the value.  I think an alternative fix would
be to use "@u" as type string for the g_variant_builder_add() call, then
the already allocated GVariant is adopted.

Fixes: 9a71b7219c ("charon-nm: Port to libnm")
2018-02-22 09:05:48 +01:00
Tobias Brunner 9ba01ce380 x509: Fix leak if a CRL contains multiple authorityKeyIdentifiers 2018-02-21 11:13:42 +01:00
Tobias Brunner bd6e4bbe68 fuzzing: Add fuzzer for CRL parsing 2018-02-20 17:54:08 +01:00
Tobias Brunner 29b983309f nm: Version bump to 1.4.3 2018-02-19 14:45:15 +01:00
Andreas Steffen 68c00bc839 Version bump to 5.6.2 2018-02-19 12:59:37 +01:00
Tobias Brunner b640afdb2e NEWS: Add info about CVE-2018-6459 2018-02-19 10:37:43 +01:00
Tobias Brunner 40da179f28 signature-params: Properly handle MGF1 algorithm identifier without parameters
Credit to OSS-Fuzz.

Fixes: CVE-2018-6459
2018-02-19 10:29:32 +01:00
Andreas Steffen 0bb4d2179d Version bump to 5.6.2rc1 2018-02-16 13:37:00 +01:00
Andreas Steffen 22157b8163 testing: Enable counters and save-keys plugins 2018-02-16 13:36:44 +01:00
Tobias Brunner c65bec5137 NEWS: Added some news for 5.6.2 2018-02-16 11:06:40 +01:00
Tobias Brunner fb545dd34d vici: Also return close action 2018-02-16 09:55:22 +01:00
Tobias Brunner bac71410f3 save-keys: Add warning message to log if keys are being saved 2018-02-15 23:03:29 +01:00
Tobias Brunner 1da1ba01c4 save-keys: Add options to enable saving IKE and/or ESP keys 2018-02-15 23:03:29 +01:00
Codrut Cristian Grosu 88e151d10d save-keys: Store derived CHILD_SA keys in Wireshark format 2018-02-15 23:03:29 +01:00
Codrut Cristian Grosu 4be7db5f60 save-keys: Store derived IKE_SA keys in Wireshark format
The path has to be set first, otherwise, nothing is done.
2018-02-15 23:03:29 +01:00