Commit Graph
841 Commits
Author SHA1 Message Date
Tobias Brunner bf92887af1 ike: Resolve hosts only for address families currently supported 2013-07-05 09:48:26 +02:00
Tobias Brunner c949a4d501 Reuse reqid when restarting CHILD_SAs for dpd|closeaction=restart 2013-07-01 09:58:34 +02:00
Tobias Brunner 4c74fa664b Reuse reqid for trap policies installed for dpd|closeaction=hold 2013-07-01 09:58:25 +02:00
Martin Willi a650242643 ikev2: keep the CHILD_SA we delete as initiator in the list to destroy
If the responder not correctly send the correct protocol or SPI in the delete
response, we should remove the CHILD_SA regardless.
2013-06-25 14:03:51 +02:00
Tobias Brunner 01955eec71 ike: Force NAT-T/UDP encapsulation if kernel interface requires it 2013-06-21 17:03:21 +02:00
Martin Willi 888dbac50e ikev2: use protocol of selected proposal to delete a failed CHILD_SA
Depending on the failure, the protocol might not yet be set on the CHILD_SA.
2013-06-20 12:09:46 +02:00
Martin Willi ad5ad02ade ikev2: properly fall back to tunnel mode if transport/BEET mode not configured 2013-06-19 16:36:01 +02:00
Martin Willi 975457c4d8 ikev2: support transport mode over NAT 2013-06-19 16:36:01 +02:00
Martin Willi a7bc0bf4a6 ike: reuse the reqid of an installed trap having the same config
When we have a trap installed, but a CHILD_SA gets established for the same
config from the peer, we should reuse the same reqid. Otherwise we would have
two identical policies using different reqids, what we can't handle in our
kernel backend.
2013-06-19 16:30:40 +02:00
Martin Willi 2dcfc6983b trap-manager: add a method to find reqid for installed traps by config 2013-06-19 16:30:40 +02:00
Martin Willi f4e822c1b4 trap-manager: don't check-in nonexisting IKE_SA if acquire fails 2013-06-19 16:30:40 +02:00
Martin Willi ae131e6bac trap-manager: fix a memleak when installing a trap to %any 2013-06-19 16:30:40 +02:00
Martin Willi a8c9454423 kernel-interface: add an exchange initiator parameter to add_sa()
This new flag gives the kernel-interface a hint how it should priorize the
use of newly installed SAs during rekeying.

Consider the following rekey procedure in IKEv2:

Initiator  ---    Responder

I1 -------CREATE-------> R1
I2 <------CREATE--------
   -------DELETE-------> R2
I3 <------DELETE--------

SAs are always handled as pairs, the following happens at the SA level:

  * Initiator starts the exchange at I1
  * Responder installs new SA pair at R1
  * Initiator installs new SA pair at I2
  * Responder removes old SA pair at R2
  * Initiator removes old SA pair at I3

This makes sure SAs get installed/removed overlapping during rekeying. However,
to avoid any packet loss, it is crucial that the new outbound SA gets
activated at the correct position:

  * as exchange initiator, in I2
  * as exchange responder, in R2

This should guarantee that we don't use the new outbound SA before the peer
could install its corresponding inbound SA.

The new parameter allows the kernel backend to install the new SA with
appropriate priorities, i.e. it should:

  * as exchange inititator, have the new outbound SA installed with higher
    priority than the old SA
  * as exchange responder, have the new outbound SA installed with lower
    priority than the old SA

While we could split up the SA installation at the responder, this approach
has another advantage: it allows the kernel backend to switch SAs based on
other criteria, for example when receiving traffic on the new inbound SA.
2013-06-11 15:58:48 +02:00
Martin Willi 3568abe7be Use ref_get() to make sure IKE_SA unique IDs are unique 2013-06-11 15:54:27 +02:00
Martin Willi d64f6ef6ae Use ref_get() to make sure CHILD_SA reqids are unique 2013-06-11 15:54:27 +02:00
Martin Willi 37a60cad3c ikev1: keep vendor ID task alive during full Main/Aggressive Mode
Fixes DPD with Cisco IOS sending the DPD vendor ID not in the first message.
2013-06-11 15:54:27 +02:00
Martin Willi e196c41bd2 ikev2: if installing a CHILD_SA as initiator fails, notify the responder 2013-06-11 15:54:27 +02:00
Martin Willi ff3fff4dc9 ikev2: raise LOCAL_AUTH_FAILED when receiving INFORMATIONAL with AUTH_FAILED 2013-06-11 15:54:26 +02:00
Martin Willi ca74bf7a06 ikev2: close an established IKE_SA when receiving AUTHENTICATION_FAILED
RFC 5996 compatible implementations MAY send an INFORMATIONAL message
with an AUTHENTICATION_FAILED if the initiator failed to authenticate us.
Handle such a message like a DELETE for an IKE_SA.
2013-06-11 15:54:26 +02:00
Martin Willi eaafcec190 ikev2: if responder authentication fails, send AUTHENTICATION_FAILED
According to RFC 5996, we MAY send an INFORMATIONAL message having an
AUTHENTICATION_FAILED. We don't do any retransmits, though, but just close
the IKE_SA after one message has been sent, avoiding the danger that an
unauthenticated IKE_SA stays alive.
2013-06-11 15:54:26 +02:00
Martin Willi 44d9970f4c Allow IPComp on NATed connections, both for IKEv1 and IKEv2
While this was problematic in earlier releases, it seems that it works just
fine the way we handle compression now. So there is no need to disable it over
NATed connections or when using forceencaps.
2013-06-11 15:54:25 +02:00
Tobias Brunner 3873526f3e Properly compare CHILD_SAs during rekey collision
The previous code did not properly check for the situation when the
DELETE for a redundant CHILD_SA created by a responder during a
CHILD_SA rekey collision arrives before the responder's answer to the
initiator's winning CREATE_CHILD_SA request.
2013-06-11 14:00:02 +02:00
Martin Willi 965348cd7a Raise LOCAL_AUTH_FAILED alert after receiving AUTHENTICATION_FAILURE 2013-05-15 17:18:03 +02:00
Martin Willi 5c12700f9a kernel-interface: query SAD for last use time if SPD query didn't yield one 2013-05-06 17:01:13 +02:00
Martin Willi bdaf9f97e6 child-sa: query SAD/SPD just for what we actually need to update statistics 2013-05-06 17:01:13 +02:00
Martin Willi 60ed88b2c7 child-sa: pass traffic selector to add_sa() regardless of IPsec mode
This lets the kernel backend decide what to do with it, and in fact all kernel
interfaces already handle this correctly.
2013-05-06 16:10:11 +02:00
Martin Willi e93f386dbb Raise an ALERT_PROPOSAL_MISMATCH_CHILD also when receiving NO_PROPOSAL_CHOSEN 2013-05-06 14:56:50 +02:00
Martin Willi 00080d2b8b Raise an ALERT_PROPOSAL_MISMATCH_IKE also when receiving NO_PROPOSAL_CHOSEN 2013-05-06 14:56:50 +02:00
Martin Willi a3854d8371 Don't unset IKE_SA on bus before we released virtual IPs and attributes 2013-05-06 14:56:01 +02:00
Andreas Steffen 12fa1784d0 emit a single assig_vips bus message for all VIPs 2013-04-06 14:16:30 +02:00
Andreas Steffen ba2880d569 ifmap plugin subscribes to assing_vip bus signal 2013-04-06 11:09:41 +02:00
Martin Willi bee8b5e385 Refactor check_for_rekeyed_child() in quick_mode task 2013-04-03 17:08:00 +02:00
Martin Willi ac48d9e458 Reuse reqid of an existing Quick Mode, even if it has been rekeyed
If two peers rekey Quick Modes at the same time, the original Quick Mode is
in REKEYING state and hence the requid is not reused. This is required though,
as two identical policies won't work if they have different requids.
2013-04-03 15:56:26 +02:00
Martin Willi bee6515a28 Defer CHILD_SA rekeying if allocating an SPI fails 2013-04-03 12:25:27 +02:00
Tobias Brunner cf95d2926c Fixed some typos, courtesy of codespell 2013-03-25 10:59:37 +01:00
Tobias Brunner 8a0a1ae857 Delete IKE_SAs if responder does not initiate XAuth exchange within a certain time frame 2013-03-19 12:00:00 +01:00
Tobias Brunner 3c34e15ee4 Make sure that xauth-noauth is not used accidentally
It has to be selected explicitly with rightauth2=xauth-noauth.
2013-03-19 11:23:03 +01:00
Tobias Brunner e4013bb904 Added xauth-noauth plugin
This XAuth backend does not do any authentication of client credentials
but simply sends a successful XAuth status to the client, thereby
concluding the XAuth exchange.  This can be useful to fallback to basic
RSA authentication with clients that can not be configured without XAuth
authentication.
2013-03-19 11:23:03 +01:00
Martin Willi 49960f021d Make check whether to use IKEv1 fragmentation more readable 2013-03-14 14:20:55 +01:00
Martin Willi c45cf9048e Raise an alert if an IKE_SA could not have been reauthenticated and expires 2013-03-14 14:20:54 +01:00
Martin Willi d954a2081b child_sa_t.get_usestats() can additionally return the number of processed packets 2013-03-14 14:20:54 +01:00
Martin Willi 7eeeb1c702 kernel_ipsec_t.query_sa() additionally returns the number of processed packets 2013-03-14 14:20:54 +01:00
Martin Willi 3a23794fa2 Add missing XAuthRespPSK switch case to IKEv1 key derivation 2013-03-12 10:09:23 +01:00
Martin Willi 8f727d8007 Clean up IKE_SA state if IKE_SA_INIT request does not have message ID 0 2013-03-11 11:30:47 +01:00
Martin Willi 0235914d2f Ignore fourth Qick Mode message sent by Windows servers.
Initial patch by Paul Stewart, fixes #289.
2013-03-11 10:53:55 +01:00
Martin Willi 9d9042d6d9 As Quick Mode initiator, select a subset of the proposed and the returned TS
Cisco 5505 firewalls don't return the port if we send a specific one, letting
the is_contained_in() checks fail. Using get_subset() selection builds the
Quick Mode correctly with the common subset of selectors.

Based on an initial patch from Paul Stewart.
2013-03-07 10:00:06 +01:00
Martin Willi 4dd8d5430d Merge branch 'multi-eap'
Fixes the use of EAP methods in the non-first authentication round if the
initiator demands mutual EAP. Also mutual EAP can now be enforced when the
initiator sets rightauth=eap, not only with rightauth=any.
2013-03-01 11:36:41 +01:00
Martin Willi b611d8ba48 Merge branch 'ikev1-rekeying'
Migrates Quick Modes to the new Main Mode if an IKEv1 reauthentication replaces
the old Main Mode having a uniqueids=replace policy.
2013-03-01 11:32:02 +01:00
Martin Willi a36b49f3cb Merge branch 'opaque-ports'
Adds a %opaque port option and support for port ranges in left/rightprotoport.
Currently not supported by any of our kernel backends.
2013-03-01 11:27:12 +01:00
Martin Willi 21dd4c4bea Without MOBIKE, update remote host only if it is behind NAT 2013-03-01 11:26:47 +01:00