Commit Graph

16511 Commits

Author SHA1 Message Date
Andreas Steffen 508b308768 fuzz: Added PA-TNC fuzzer 2018-06-12 21:47:39 +02:00
Andreas Steffen ce4b8f65d6 testing: Removed TCG SWID IMC/IMV scenarios 2018-06-12 21:47:39 +02:00
Andreas Steffen a31f9b7691 libimcv: Removed TCG SWID IMC/IMV support 2018-06-12 21:47:39 +02:00
Andreas Steffen eccd2b6e09 libimcv: SWIMA SW locator must be file URI 2018-06-12 17:53:06 +02:00
Andreas Steffen 0b445a5c54 libimcv: Updated IANA numbers assigned to SWIMA 2018-06-12 17:53:06 +02:00
Micah Morton 4f1d2f2b09 Allow charon to change group on files before dropping caps
Allow charon to start as a non-root user without CAP_CHOWN and still be
able to change the group on files that need to be accessed by charon
after capabilities have been dropped. This requires the user charon starts
as to have access to socket/pidfile directory as well as belong to the
group that charon will run as after dropping capabilities.

Closes strongswan/strongswan#105.
2018-06-12 10:25:30 +02:00
Markus Sattler 1331010aa4 starter: Reset action before handling it
Stater will lose update/reload commands when there is a second signal
coming in when the previous is still processed. This can happen more
easily with big configurations.

Closes strongswan/strongswan#101.
2018-06-05 10:13:22 +02:00
Andreas Steffen 3a8a9c7029 Version bump to 5.7.0dr1 2018-05-30 23:02:57 +02:00
Andreas Steffen 6d087b33de libstrongswan: xmppaddr prefix designates an xmppAddr otherName ID type 2018-05-30 17:25:28 +02:00
Andreas Steffen b2ab0995c1 Version bump to 5.6.3 2018-05-28 15:38:58 +02:00
Tobias Brunner 64f7fd92c0 NEWS: Add info about CVE-2018-10811 2018-05-24 15:52:06 +02:00
Tobias Brunner 6d8a57342b ikev2: Initialize variable in case set_key() or allocate_bytes() fails
In case the PRF's set_key() or allocate_bytes() method failed, skeyseed
was not initialized and the chunk_clear() call later caused a crash.

This could have happened with OpenSSL in FIPS mode when MD5 was
negotiated (and test vectors were not checked, in which case the PRF
couldn't be instantiated as the test vectors would have failed).
MD5 is not included in the default proposal anymore since 5.6.1, so
with recent versions this could only happen with configs that are not
valid in FIPS mode anyway.

Fixes: CVE-2018-10811
2018-05-24 15:45:08 +02:00
Tobias Brunner 0d0c8f7d3e NEWS: Some minor updates 2018-05-24 12:18:18 +02:00
Tobias Brunner 2c7a4b0704 swanctl: Document new HW offload options/behavior 2018-05-24 10:49:19 +02:00
Andreas Steffen 88205674e5 Version bump to 5.6.3rc1 2018-05-23 22:36:39 +02:00
Tobias Brunner 7f14fefff4 NEWS: Added some news for 5.6.3 2018-05-23 20:25:50 +02:00
Tobias Brunner 887885f33b sw-collector: Proper cleanup if DB query fails in check operation 2018-05-23 20:25:50 +02:00
Tobias Brunner d837d0b339 kernel-netlink: Use strncpy to copy interface name when configuring HW offload 2018-05-23 20:25:49 +02:00
Tobias Brunner 89bd016ef4 Fixed some typos, courtesy of codespell 2018-05-23 16:33:02 +02:00
Tobias Brunner 1b67166921 Unify format of HSR copyright statements 2018-05-23 16:32:53 +02:00
Tobias Brunner 740133b12d settings: Parse assigned values in a different context
This allows us to accept characters like = or { without having to use
quoted strings.  And we can also properly warn about unexpected quoted
strings.
2018-05-23 12:01:50 +02:00
Tobias Brunner f8c20fb1c2 settings: Support CRLF in settings parser 2018-05-23 12:01:45 +02:00
Andreas Steffen 26b45beda9 Version bump to 5.6.3dr2 2018-05-22 21:58:32 +02:00
Tobias Brunner e6d17d5613 man: Remove keylife/rekeymargin from ipsec.conf man page
We continue to parse them but remove the documentation because mixing the two
sets of keywords in the same config might result in unexpected behavior.

References #2663.
2018-05-22 14:18:17 +02:00
Tobias Brunner b5461c63d9 Merge branch 'ikesa-force-destroy'
Adds new options to force the local destruction of an IKE_SA (after
trying to send a DELETE first).  This might be useful in situations where
it's known the other end is not reachable or already deleted the IKE_SA so
there is no point in retransmitting the DELETE and waiting for a response.
2018-05-22 10:13:59 +02:00
Tobias Brunner c057cd26fa swanctl: Add option to force IKE_SA termination 2018-05-22 10:06:07 +02:00
Tobias Brunner 0bcfed1aa2 vici: Optionally terminate IKE_SA immediately 2018-05-22 10:06:07 +02:00
Tobias Brunner 7b72909774 controller: Add option to force destruction of an IKE_SA
It's optionally possible to wait for a timeout to destroy the SA.
2018-05-22 10:06:07 +02:00
Tobias Brunner a79d510354 ike-sa: Add option to force the destruction of an IKE_SA after initiating a delete 2018-05-22 10:06:07 +02:00
Martin Willi c58434aeff proposal: Add a compat alg for ChaCha20Poly1305 with explicit key length
The keylength fix for ChaCha20Poly1305 (5a7b0be2) removes the keylength
attribute from the AEAD transform. This breaks compatibility between
versions with the patch and those without. The ChaCha20Poly1305 AEAD
won't match in proposals between such versions, and if no other algorithm
is available, negotiating SAs fails.

As a migration strategy, this patch introduces a new string identifier for a
ChaCha20Poly1305 proposal keyword which uses the explicit keylength, exactly
as it was used before the mentioned patch. Administrators that care about
the use of that AEAD with old clients can temporarily add this keyword to
the list of proposals, until all clients have been upgraded.

The used approach is the least invasive, as it just adds an additional
keyword that can't do any harm if not explicitly configured. Nontheless
allows it the administrator to smoothly keep ChaCha20Poly1305 working,
even if upgrading all peers simultaneously is not an option. It requires
manual configuration edits, though, but we assume that ChaCha20Poly1305
is not that widely used, and not as the only transform in proposals.

Removing the compat keyword in a future version is an option; it might
be helpful for other implementations, though, that falsely use an
explicit key length in ChaCha20Poly1305 AEAD transforms.
2018-05-22 10:05:22 +02:00
Tobias Brunner 10b8acb554 kernel-netlink: Change how routes are un-/installed
We now check if there are other routes tracked for the same destination
and replace the installed route instead of just removing it.  Same during
installation, where we previously didn't replace existing routes due to
NLM_F_EXCL.  Routes with virtual IPs as source address are preferred over
routes without.

This should allow using trap policies with virtual IPs on Linux.

Fixes #85, #2162.
2018-05-22 10:04:24 +02:00
Tobias Brunner 3f003e5e21 Merge branch 'cert-chain-fixes'
This fixes several issues that came up via BSI's Certification Path
Validation Test Tool (CPT):

 1) In compliance with RFC 4945, section 5.1.3.2, we now enforce that a
    certificate used for IKE authentication either does not contain a keyUsage
    extension (like the ones produced by pki --issue) or that they include
    digitalSignature or nonRepudiation.

 2) CRLs that are not yet valid are now rejected as that could be a
    problem in scenarios where expired certificates are removed from CRLs and
    the clock on the host doing the revocation check is trailing behind that
    of the host issuing CRLs.

 3) Results other than revocation (e.g. a skipped check because the CRL
    couldn't be fetched) are now stored also for intermediate CA certificates
    and not only for end-entity certificates, so a strict CRL policy can be
    enforced in such cases.
2018-05-22 09:52:08 +02:00
Tobias Brunner 9746c308ff testing: Add ikev2/multi-level-ca-skipped scenario 2018-05-22 09:50:47 +02:00
Tobias Brunner 0cf3549675 revocation: Fix memory leak if fetching CRL/OCSP fails
We might get a 404 error page back.
2018-05-22 09:50:47 +02:00
Tobias Brunner cae43b890a revocation: Set defaults if CRL/OCSP checking is disabled in config 2018-05-22 09:50:47 +02:00
Tobias Brunner b00d3adbd1 revocation: Also store validation results for intermediate CA certificates
If the certificate is revoked, we immediately returned and the chain was
invalid, however, if we couldn't fetch the CRL that result was not stored
for intermediate CAs and we weren't able to enforce a strict CRL policy
later.
2018-05-22 09:50:47 +02:00
Tobias Brunner 13f76a241c revocation: Ignore CRLs that are not yet valid
Using such CRLs can be a problem if the clock on the host doing the
revocation check is trailing behind that of the host issuing CRLs in
scenarios where expired certificates are removed from CRLs.  As revoked
certificates that expired will then not be part of new CRLs a host with
trailing clock might still accept such a certificate if it is still
valid according to its system clock but is not contained anymore in the
not yet valid CRL.
2018-05-22 09:50:47 +02:00
Tobias Brunner 9c6b102ee0 openssl: Fail CRL validity check if thisUpdate is in the future 2018-05-22 09:50:47 +02:00
Tobias Brunner a0902d1ae0 x509: Fail CRL validity check if thisUpdate is in the future 2018-05-22 09:50:47 +02:00
Tobias Brunner 6143f926ef ike: Reject certificates that are not compliant with RFC 4945 2018-05-22 09:50:47 +02:00
Tobias Brunner 504e12326d openssl: Set IKE compliance flag depending on keyUsage 2018-05-22 09:50:47 +02:00
Tobias Brunner 920366e688 x509: Set IKE compliance flag depending on keyUsage 2018-05-22 09:50:47 +02:00
Tobias Brunner 9fcf4fdda1 x509: Add flag that marks compliance with RFC 4945
According to RFC 4945, section 5.1.3.2, a certificate for IKE must
either not contain the keyUsage extension, or, if it does, have at least
one of the digitalSignature or nonReputiation bits set.
2018-05-22 09:50:47 +02:00
Tobias Brunner 598096e7a2 Merge branch 'dhcp-fixes'
Fixes some issues in the dhcp plugin like avoiding ICMP port unreachables
when setting a specific server address, or increasing the maximum size for
options e.g. for DNs in the client identifier option. The latter is also
only sent now if identity_lease is enabled (for most DHCP servers it
serves the same function as a unique MAC address does).
2018-05-22 09:44:51 +02:00
Tobias Brunner 7b660944b6 dhcp: Only send client identifier if identity_lease is enabled
The client identifier serves as unique identifier just like a unique MAC
address would, so even with identity_leases disabled some DHCP servers
might assign unique leases per identity.
2018-05-18 18:04:01 +02:00
Tobias Brunner 0e5b94d038 dhcp: Increase maximum size of client identification option
This increases the chances that subject DNs that might have been cut
off with the arbitrary previous limit of 64 bytes might now be sent
successfully.

The REQUEST message has the most static overhead in terms of other
options (17 bytes) as compared to DISCOVER (5) and RELEASE (7).
Added to that are 3 bytes for the DHCP message type, which means we have
288 bytes left for the two options based on the client identity (host
name and client identification).  Since both contain the same value, a
FQDN identity, which causes a host name option to get added, may be
142 bytes long, other identities like subject DNs may be 255 bytes
long (the maximum for a DHCP option).
2018-05-18 18:04:01 +02:00
Tobias Brunner 30e886fe3b dhcp: Increase buffer size for options in DHCP messages
According to RFC 2131, the minimum size of the 'options' field is 312
bytes, including the 4 byte magic cookie.  There also does not seem to
be any restriction regarding the message length, previously the length
was rounded to a multiple of 64 bytes.  The latter might have been
because in BOOTP the options field (or rather vendor-specific area as it
was called back then) had a fixed length of 64 bytes (so max(optlen+4, 64)
might actually have been what was intended), but for DHCP the field is
explicitly variable length, so I don't think it's necessary to pad it.
2018-05-18 18:04:01 +02:00
Tobias Brunner 13edecdc20 dhcp: Reduce receive buffer size on send socket
Since we won't read from the socket reducing the receive buffer saves
some memory and it should also minimize the impact on other processes that
bind the same port (Linux distributes packets to the sockets round-robin).
2018-05-18 18:04:01 +02:00
Tobias Brunner becf027cd9 dhcp: Bind server port when a specific server address is specified
DHCP servers will respond to port 67 if giaddr is non-zero, which we set
if we are not broadcasting.  While such messages are received fine via
RAW socket the kernel will respond with an ICMP port unreachable if no
socket is bound to that port.  Instead of opening a dummy socket on port
67 just to avoid the ICMPs we can also just operate with a single
socket, bind it to port 67 and send our requests from that port.

Since SO_REUSEADDR behaves on Linux like SO_REUSEPORT does on other
systems we can bind that port even if a DHCP server is running on the
same host as the daemon (this might have to be adapted to make this work
on other systems, but due to the raw socket the plugin is not that portable
anyway).
2018-05-18 18:04:01 +02:00
Tobias Brunner e8b5c7b94e dhcp: Fix destination port check in packet filter
The previous code compared the port in the packet to the client port and, if
successful, checked it also against the server port, which, therefore, never
matched, but due to incorrect offsets did skip the BPF_JA.  If the client port
didn't match the code also skipped to the instruction after the BPF_JA.
However, the latter was incorrect also and processing would have continued at
the next instruction anyway.  Basically, DHCP packets to any port were accepted.

What's not fixed with this is that the kernel returns an ICMP Port
unreachable for packets sent to the server port (67) because we don't
have a socket bound to it.

Fixes: f0212e8837 ("Accept DHCP replies on bootps port, as we act as a relay agent if server address configured")
2018-05-18 18:04:01 +02:00