Commit Graph
8794 Commits
Author SHA1 Message Date
Martin Willi d0c09c84a5 unit-tests: test supported ECDSA schemes only 2013-06-21 10:53:22 +02:00
Martin Willi 2bedb0f270 Move test-runners has_feature() function to plugin loader 2013-06-21 10:53:22 +02:00
Martin Willi df76881f11 unit-tests: enforce CET/CEST timezone to properly test non-UTC time formatting 2013-06-21 10:53:22 +02:00
Martin Willi 44886a0667 unit-tests: don't use ck_assert() to test a cleared chunk, as it allocates data
The new allocation might be in the freed area, affecting the test result.
2013-06-21 10:53:22 +02:00
Martin Willi 52bff13848 unit-tests: define 64-bit constats with ULL, fixing compiler warning on 32-bit 2013-06-21 10:53:22 +02:00
Martin Willi a88cab095d unit-tests: test some zeroed ECDSA signatures that never should succeed 2013-06-21 10:53:21 +02:00
Martin Willi 7e23f53242 unit-tests: perform signing/validation with keys ECDSA keys generated or loaded 2013-06-21 10:53:21 +02:00
Martin Willi eabb0befdc unit-tests: add an ECDSA test case loading keys 2013-06-21 10:53:21 +02:00
Martin Willi d18ff88faf unit-tests: perform a first ECDSA test case if ECDSA is supported 2013-06-21 10:53:21 +02:00
Martin Willi 200f38ad4c unit-tests: add a helper function checking if a plugin feature is available 2013-06-21 10:53:21 +02:00
Martin Willi cb1745f7a6 unit-tests: add a test case checking if all test vectors have been passed 2013-06-21 10:53:20 +02:00
Martin Willi e9e4759733 crypto-factory: count the number of test vector failures during registration 2013-06-21 10:53:20 +02:00
Martin Willi 3714979427 unit-tests: load all libstrongswan plugins in test-runner 2013-06-21 10:53:20 +02:00
Tobias Brunner 8c88ca0fcf stroke: Add statusall-nb as alias for statusallnb 2013-06-21 10:51:41 +02:00
Tobias Brunner 4182c86aed stroke: Add non-blocking versions of up and down
stroke up-nb and stroke down-nb do not block until the command has
finished.  Instead, they return right after initiating the respective
operation.
2013-06-21 10:49:39 +02:00
Tobias Brunner 9afc6e6a70 starter: Make ipsec.conf path configurable via command line 2013-06-21 10:08:56 +02:00
Tobias Brunner c0d0391a51 pubkey: Improve comparison of raw public key certificate objects 2013-06-21 10:02:25 +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 47ec2e407b charon-cmd: use a copy of pid in initiate callback
When cancelling a connection that gets established, cmd_connection_t gets
freed before terminate() is called. This results in kill()ing invalid PID.
2013-06-20 11:02:28 +02:00
Martin Willi e044a1a9e5 charon-cmd: add IKEv1 aggressive mode profiles 2013-06-20 11:01:37 +02:00
Martin Willi 483a258ad8 stroke: support %dynamic in left/rightsubnet for dynamic selectors
This has the same meaning as omitting left/rightsubnet, i.e. replace it
by the IKE address. Supporting %dynamic allows configurations with multiple
dynamic selectors in a left/rightsubnet, each with potentially different
proto/port selectors.
2013-06-19 16:36:01 +02:00
Martin Willi 3d1af879d2 kernel-netlink: install selectors on SA for transport/BEET mode without proto/port
If a transport/BEET SA has different selectors for different proto/ports,
installing just the proto/port of the first SA would break any additional
selector.
2013-06-19 16:36:01 +02:00
Martin Willi 4a7c29bf02 stroke: support a specific proto/port for each net defined in left/rightsubnet 2013-06-19 16:36:01 +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 1551d8b13d kernel-netlink: reject policy refcount if the reqid differs
Previously we silently replaced an existing policy with a new one if the
reqid changed for the same selectors. This will break an old policy in the
favour of the new one (for example if two clients behind the same NAT use
transport mode).

With this change any new policy gets rejected if the reqid differs. This will
make sure we break no existing policy. For rekeying and acquires we still can
have overlapping policies (as we use the same reqid), but for unrelated
connections this is not true anymore (it wasn't actually before, we just
silently broke the existing policy).
2013-06-19 16:30:40 +02:00
Martin Willi de2debf8e0 stroke: add exportconn{cert,chain} commands in addition to exportx509
The new commands either export a single end entity certificate or the
full trust chain for a specific connection name.
2013-06-19 16:27:19 +02:00
Martin Willi a485320393 Raise an alert if the responding peer narrowed traffic selectors 2013-06-19 16:11:46 +02:00
Martin Willi ad58246f53 backtrace: use backtrace_symbols() only if we have backtrace() and dladdr() fails 2013-06-19 16:09:31 +02:00
Tobias Brunner 4d04e2c63b utils: Remove volatile qualifier from refcount_t typedef
It's not really required anymore (if it ever was) and may cause compiler
warnings when using the non atomic versions of ref_get/ref_put.
2013-06-19 09:28:30 +02:00
Martin Willi 24303f99f7 dhcp: search for transactions only for connections having a poolname "dhcp"
When a connection has a single pool that queries recursively the DHCP backend,
we shouldn't return any attributes directly from DHCP when queried for that
pool.
2013-06-18 09:50:29 +02:00
Martin Willi 9a00d9aa2f starter: ignore return value of sete[gu]id(), now having warn_unused_result 2013-06-18 08:54:10 +02:00
Tobias Brunner c6f1929a45 socket-default: Make sure sockets are open when checking with FD_ISSET 2013-06-14 17:25:16 +02:00
Tobias Brunner 1889837767 socket-default: Properly initialize NAT-T port if opening regular socket failed 2013-06-14 16:42:56 +02:00
Tobias Brunner 92f102c21b android: Forward initiator flag to libipsec when adding IPsec SA 2013-06-13 13:55:58 +02:00
Tobias Brunner 52d7c530e9 libipsec: Add initiator flag to definition of ipsec_sa_mgr_t.add_sa() 2013-06-13 13:54:05 +02:00
Martin Willi 246e2bed1d Use subset matching instead of is_contained_in() to select a child_cfg
If one selector has a wider IP range than the other, but the other has a
wider port/protocol selector than the first one, none is completely contained
in the other. The check for a match using is_contained_in() therefore would
fail. Using get_subset() can handle such cases, fixing configuration selection.
2013-06-13 13:37:50 +02:00
Tobias Brunner 44fb978169 ha: Fix CHILD_SA installation in ha_dispatcher after adding initiator flag 2013-06-13 13:17:55 +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 3160b92adb utils: ref_get() returns the new value of the reference counter
This allows us to use ref_get() for getting unique values.
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