Commit Graph

9914 Commits

Author SHA1 Message Date
Andreas Steffen ab6e7d6975 Fixed typo 2014-05-01 17:00:50 +02:00
Andreas Steffen 7bd8ea2fdd Use global status variable for IMA runtime 2014-05-01 16:58:59 +02:00
Andreas Steffen 887a88d55b Similar statistics for packages and file measurements 2014-05-01 09:17:33 +02:00
Andreas Steffen 660f3200ad Updated build_database.sh to Ubuntu 14.04 2014-05-01 09:17:33 +02:00
Andreas Steffen eebc1e75b2 Updated ITA-IMA finalize messages 2014-05-01 08:16:50 +02:00
Andreas Steffen bc2721b2f2 Implemented IMA-NG support 2014-05-01 08:16:49 +02:00
Martin Willi 523dd96558 unit-tests: Document the supported env variables 2014-04-30 17:22:48 +02:00
Thomas Egerer 1b9b228c41 unit-tests: Support strongswan.conf defined plugin list and base directory
tests.load and tests.plugindir to allow the specification of the plugins
to be loaded and the directory to load them from.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2014-04-30 17:22:48 +02:00
Thomas Egerer f406a5bf72 unit-tests: Allow configuration of libstrongswan via config
By setting the environment variable TESTS_STRONGSWAN_CONF, the unit tests can
be asked to load a configuration file, thus enabling the tester to make use of
the usual configuration settings.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2014-04-30 17:22:48 +02:00
Martin Willi 20924ae28f unit-tests: Add a ck_assert_chunk_eq() convenience macro 2014-04-30 17:22:48 +02:00
Martin Willi 0456aa616f unit-tests: Silence a literal signedness warning raised by GCC 4.6.3 2014-04-30 17:22:48 +02:00
Tobias Brunner 24ea377458 sqlite: Allow query arguments to be freed before starting the enumeration
By marking the string/blob arguments as transient, SQLite will copy and
free them automatically.
2014-04-30 09:37:32 +02:00
Andreas Steffen f5b0558b15 Improved finalize messages in ITA-IMA component 2014-04-27 19:13:15 +02:00
Tobias Brunner c478dfe617 child-cfg: Fix removal of redundant traffic selectors
We have to make sure we compare every selected traffic selector with every
other in the list.

Fixes #577.
2014-04-25 19:04:35 +02:00
Tobias Brunner 446c036794 android: New release based on 5.1.3
Also links OpenSSL statically and doesn't limit the number of packets
during EAP-TTLS.
2014-04-25 14:39:22 +02:00
Tobias Brunner 711af588f9 libcharon: Added AEAD sources of libtls to Android.mk 2014-04-25 14:27:49 +02:00
Tobias Brunner 289456d26a libimcv: Updated Android.mk 2014-04-25 14:26:31 +02:00
Tobias Brunner 8064764070 android: Use static version of libcrypto
System.loadLibrary() searches in system directories first (at least in
recent releases), that is, our own build wouldn't actually get used.
2014-04-25 14:26:31 +02:00
Tobias Brunner acc042fa7b tun-device: Use SIOCAIFADDR to set IP address on FreeBSD 10
FreeBSD 10 deprecated the SIOCSIFADDR etc. commands, so we use this
newer command to set the address and netmask.  A destination address
is now also required.

Fixes #566.
2014-04-25 12:18:06 +02:00
Tobias Brunner 73c33ff423 bus: Add a fast-path if log messages don't have to be logged
For some rwlock_t implementations acquiring the read lock could be quite
expensive even if there are no writers (e.g. because the implementation
requires acquiring a mutex to check for writers) particularly if the
lock is highly contended, like it is for the vlog() method.
2014-04-24 17:54:15 +02:00
Christophe Gouault 7b08063e70 load-tester: Fix race condition issuing same SPI
Due to an unprotected incrementation, two load-tester initiators occasionally
use the same SPI under high load, and hence generate 2 IPsec SAs with the same
identifier. The responder IPsec stack will refuse to configure the second SA.

Use an atomic incrementation to avoid this race condition.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
2014-04-24 17:54:15 +02:00
Christophe Gouault 2cbaa63295 load-tester: Fix race condition issuing same identity
Due to an unprotected incrementation, two load-tester initiators occasionally
use the same identifier under high load. The responder typically drops one of
the connections.

Use an atomic incrementation to avoid this race condition.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
2014-04-24 17:54:15 +02:00
Tobias Brunner a68454bd68 ike-sa-manager: Improve scalability of half-open IKE_SA checking
This patch is based on one by Christoph Gouault.

Currently, to count the total number of half_open IKE_SAs,
get_half_open_count sums up the count of each segment in the SA hash
table (acquiring a lock for each segment).  This procedure does not scale
well when the number of segments increases, as the method is called for
each new negotiation.

Instead, lets maintain a global atomic counter.

This optimization allows the use of big values for charon.ikesa_table_size
and charon.ikesa_table_segments.
2014-04-24 17:54:14 +02:00
Tobias Brunner 0f603d425d utils: Use GCC's __atomic built-ins if available
These are available since GCC 4.7 and will eventually replace the __sync
operations.  They support the memory model defined by C++11. For instance,
by using __ATOMIC_RELAXED for some operations on the reference counters we
can avoid memory barriers, which are required by __sync operations (whose
memory model essentially is __ATOMIC_SEQ_CST).
2014-04-24 17:54:14 +02:00
Tobias Brunner efedd0d21e utils: Add ref_cur() to retrieve the current value of a reference counter
On many architectures it is safe to read the value directly (those
using cache coherency protocols, and with atomic loads for 32-bit
values) but it is not if that's not the case or if we ever decide to
make refcount_t 64-bit (load not atomic on x86).

So make sure the operation is actually atomic and that users do not
have to care about the size of refcount_t.
2014-04-24 17:53:42 +02:00
Francois ten Krooden 6afa7761a5 kernel-pfkey: Added IPComp support
- get_cpi function was implemented to retrieve a CPI from the kernel.
- add_sa/update_sa/del_sa were updated to accommodate for IPComp SA.
- Updated add_policy_internal to update the SPD to support IPComp.
2014-04-24 17:36:17 +02:00
Martin Willi 65117a0764 nm: Bump NetworkManager plugin version to 1.3.1 2014-04-24 15:53:38 +02:00
Andreas Steffen f5a1cfe3f8 pacman.sh now fetches Ubuntu 14.04 security updates 2014-04-24 09:08:07 +02:00
Martin Willi 0b3bea3965 ike: Delay actively initiated reauthentication when other exchanges in progress
If any other IKE or CHILD_SA operation takes places, we should not start
initiating reauthentication to avoid any potential races.
2014-04-17 09:59:06 +02:00
Martin Willi f02cabbe35 ikev2: Reject CHILD_SA creation/rekeying while deleting an IKE_SA
If one peer starts reauthentication by deleting the IKE_SA, while the other
starts CHILD_SA rekeying, we run in a race condition. To avoid it, temporarily
reject the rekey attempt while we are in the IKE_SA deleting state.

RFC 4306/5996 is not exactly clear about this collision, but it should be safe
to reject CHILD_SA rekeying during this stage, as the reauth will re-trigger the
CHILD_SA. For non-rekeying CHILD_SA creations, it's up to the peer to retry
establishing the CHILD_SA on the reauthenticated IKE_SA.
2014-04-17 09:59:06 +02:00
Martin Willi 094963d1b1 ikev2: Apply extensions and conditions before starting rekeying
The extensions and conditions apply to the rekeyed IKE_SA as well, so we should
migrate them. Especially when using algorithms from private space, we need
EXT_STRONGSWAN to properly select these algorithms during IKE rekeying.
2014-04-17 09:24:51 +02:00
Martin Willi 713a1122b4 ikev2: Add inherit_pre() to apply config and hosts before IKE_SA rekeying 2014-04-17 09:24:51 +02:00
Martin Willi c4c9d291d2 ikev1: Add an option to accept unencrypted ID/HASH payloads
Even in Main Mode, some Sonicwall boxes seem to send ID/HASH payloads in
unencrypted form, probably to allow PSK lookup based on the ID payloads. We
by default reject that, but accept it if the
charon.accept_unencrypted_mainmode_messages option is set in strongswan.conf.

Initial patch courtesy of Paul Stewart.
2014-04-17 08:52:28 +02:00
Tobias Brunner 4469e3d050 ikev2: Fix reauthentication if peer assigns a different virtual IP
Before this change a reqid set on the create_child_t task was used as
indicator of the CHILD_SA being rekeyed.  Only if that was not the case
would the local traffic selector be changed to 0.0.0.0/0|::/0 (as we
don't know which virtual IP the gateway will eventually assign).
On the other hand, in case of a rekeying the VIP is expected to remain
the same, so the local TS would simply equal the VIP.

Since c949a4d501 reauthenticated CHILD_SAs also have the reqid
set.  Which meant that the local TS would contain the previously
assigned VIP, basically rendering the gateway unable to assign a
different VIP to the client as the resulting TS would not match
the client's proposal anymore.

Fixes #553.
2014-04-15 16:19:06 +02:00
Andreas Steffen fa6c5f3506 Handle tag separators 2014-04-15 09:28:38 +02:00
Andreas Steffen 14007fd1d9 swid_generator software-id does not generate empty lines any more 2014-04-15 09:21:06 +02:00
Andreas Steffen 975472e42f Added result information to TPMRA workitems
On the occasion got rid of complicated functional component stuff
2014-04-15 09:21:06 +02:00
Andreas Steffen 1d7324133b Indicate IMV in assessment log statement 2014-04-15 09:21:06 +02:00
Andreas Steffen 3e7044b45e Implemented segmented SWID tag attributes on IMV side 2014-04-15 09:21:06 +02:00
Andreas Steffen 8c40609f96 Use python-based swidGenerator to generated SWID tags 2014-04-15 09:21:06 +02:00
Andreas Steffen 8505ce1cc6 Updated imv database templates 2014-04-15 09:21:05 +02:00
Andreas Steffen b138bbee4e Optimized PTS measurements 2014-04-15 09:21:05 +02:00
Andreas Steffen 40e8c67392 Use cached pid for product-based package access 2014-04-15 09:21:05 +02:00
Andreas Steffen 48f37c448c Make Attestation IMV independent of OS IMV 2014-04-15 09:21:05 +02:00
Andreas Steffen 4894bfa227 Separated IMV session management from IMV policy database 2014-04-15 09:21:05 +02:00
Andreas Steffen 0bd64fa5bf Renamed the AIK public key parameter to imc-attestation.aik_pubkey 2014-04-15 09:21:05 +02:00
Andreas Steffen c54c26dd17 Implemented configurable Device ID in OS IMC 2014-04-15 09:21:05 +02:00
Martin Willi 8503077175 ikev2: Reject CREATE_CHILD_SA exchange on unestablished IKE_SAs
Prevents a responder peer to trick us into established state by starting
IKE_SA rekeying before the IKE_SA has been authenticated during IKE_AUTH.

Fixes CVE-2014-2338.
2014-04-14 13:29:49 +02:00
Tobias Brunner abd7d3be9c eap-mschapv2: Fix potential leaks in case of invalid messages from servers 2014-04-09 18:27:02 +02:00
Tobias Brunner f0923ff377 pts: Make sure the complete AIK blob has been read 2014-04-09 17:47:32 +02:00