Commit Graph

14260 Commits

Author SHA1 Message Date
Tobias Brunner 2b19e51707 NEWS: Add info about CVE-2015-4171 2015-06-05 13:44:43 +02:00
Martin Willi 0020b25a45 ikev2: Enforce remote authentication config before proceeding with own authentication
Previously the constraints in the authentication configuration of an
initiator were enforced only after all authentication rounds were
complete.  This posed a problem if an initiator used EAP or PSK
authentication while the responder was authenticated with a certificate
and if a rogue server was able to authenticate itself with a valid
certificate issued by any CA the initiator trusted.

Because any constraints for the responder's identity (rightid) or other
aspects of the authentication (e.g. rightca) the initiator had were not
enforced until the initiator itself finished its authentication such a rogue
responder was able to acquire usernames and password hashes from the client.
And if a client supported EAP-GTC it was even possible to trick it into
sending plaintext passwords.

This patch enforces the configured constraints right after the responder's
authentication successfully finished for each round and before the initiator
starts with its own authentication.

Fixes CVE-2015-4171.
2015-06-05 13:44:42 +02:00
Martin Willi a49393954f child-sa: Use any fixed reqid configured on the CHILD_SA config
Global reqid allocation (94eb09ac) broke fixed reqid allocation. Resupport them
by bypassing allocation in the kernel if a fixed reqid has been configured.

Fixes #976.
2015-06-05 13:44:42 +02:00
Tobias Brunner 523ea82ed5 unit-tests: Add tests for iv_gen_seq_t 2015-06-05 13:44:42 +02:00
Martin Willi b756eea4f4 ivgen: Allow reusing the same message ID twice in sequential IV gen
We use the message ID and fragment number as IV generator. As IKEv2 uses
distinct message ID counters for actively and passively initiated exchanges,
each IV would be used twice. As we explicitly reject such message IDs since
d0ed1079, original-responder initiated exchanges fail with counter mode ciphers.

This commit separates IV space in two halves for sequential IVs, and
automatically assigns once reused sequence numbers to the second half.

Fixes #980.
2015-06-05 13:44:42 +02:00
Andreas Steffen 9bb7307825 Fix timeattack script compilation under ARM 2015-06-05 12:09:38 +02:00
Andreas Steffen bd60bcc3c2 Updated SWID attribute list 2015-06-02 06:51:41 +02:00
Andreas Steffen f284c17890 Version bump to 5.3.1 2015-06-01 09:50:48 +02:00
Tobias Brunner 099260d8fd NEWS: Add info about CVE-2015-3991 2015-06-01 09:42:11 +02:00
Tobias Brunner 541543dbfe message: Log message if unknown/disallowed payload received 2015-06-01 09:42:11 +02:00
Tobias Brunner e67161fe9e message: Log original message type of unknown payloads 2015-06-01 09:42:11 +02:00
Tobias Brunner 1507647434 unknown-payload: Use a new private payload type and make original type available
This fixes a DoS and potential remote code execution vulnerability that was
caused because the original payload type that was returned previously was
used to cast such payload objects to payloads of the indicated type (e.g.
when logging notify payloads with a payload type for the wrong IKE version).

Fixes CVE-2015-3991.
2015-06-01 09:42:11 +02:00
Martin Willi 62e0abe759 ikev2: Include fragment number into message ID passed to IV gen
When using a cipher with sequential IVs, we never must pass an identical IV
to the IV generator. To avoid it when using IKEv2 fragmentation, use the lower
bits of the 64-bit message ID as the fragment number.
2015-06-01 09:42:11 +02:00
Martin Willi ef31254d34 iv-gen: Fail getting shorter IV values than the used counter size
While no algorithm actually uses such short IVs, we add a check here to ensure
we won't return just the lower bits of the counter.
2015-06-01 09:42:10 +02:00
Martin Willi d0ed107910 iv-gen: Ensure external sequential IVs are actually sequential
We allow gaps in IVs, but ensure that an IV is never used more than once.
2015-06-01 09:42:10 +02:00
Martin Willi 823a8a9b46 message: Show the fragmentation numbers in message stringification 2015-06-01 09:42:10 +02:00
Andreas Steffen b8399a2edc testing: use a decent PSK 2015-05-30 16:56:41 +02:00
Andreas Steffen 1047d44b57 testing: Added ha/active-passive scenario 2015-05-30 16:48:17 +02:00
Andreas Steffen eb423ebb54 Added 5.3.1 caption to NEWS 2015-05-28 06:26:43 +02:00
Tobias Brunner 711cb586fa ha: Document tunnel parameter 2015-05-27 12:59:39 +02:00
Tobias Brunner 06a5b0e2e8 ha: Skip SA for sync messages when resyncing HA segments 2015-05-26 15:43:46 +02:00
Tobias Brunner 0de116cadc ha: Move plugin initialization from constructor to plugin callback
This fixes support for the secret option, as otherwise the kernel interface
is not registered yet when the trap policy is installed.
2015-05-26 12:47:17 +02:00
Martin Willi 47e96391f2 libtls: As client, reject DH exchanges using primes smaller than 1024 bit
While the server signs the ephemeral DH parameters, it can be tricked to its
lowest supported DH group by a man-in-the-middle:

  https://weakdh.org/imperfect-forward-secrecy.pdf

While we at least use 2048-bit DH groups as server, the client accepts any
DH prime the server sends. If it supports export ciphers, only a 512-bit prime
may be used.

As TLS does not define nor negotiate a DH group for cipher suites, the client
actually must accept what the server offers. To avoid downgrades to weak
DH groups, we must reject what we consider insecure. We set this limit to
1024-bit primes. While this breaks compatibility with TLS servers using weaker
primes, this is what we expect servers at least use. Most browser vendors use
the same limit in a similar fix.
2015-05-26 11:36:24 +02:00
Andreas Steffen dedd0ad07c Check for NULL installed packages enumerator 2015-05-24 11:15:36 +02:00
Andreas Steffen 5d5a74b077 Fixed os_info path in strongswan.conf 2015-05-24 11:13:51 +02:00
Andreas Steffen d6b75c9563 List attribute request entries also during build 2015-05-24 09:17:29 +02:00
Tobias Brunner 13497e6cc1 testing: Include iperf and htop in base image 2015-05-22 13:30:10 +02:00
Tobias Brunner d8fe354a0e stroke: Dynamically resize stroke messages
The maximum size of a stroke message is currently 64k due to the 2 byte
length field.

Fixes #943.
2015-05-22 10:40:15 +02:00
Tobias Brunner e94aae83d3 vici: Explicitly disable --user-install when installing Ruby Gem
Only one of `--user-install` and `--install-dir` may be set and if
`--user-install` is the default on a system installation will fail
unless we disable it explicitly.

Fixes #914.
2015-05-21 17:22:11 +02:00
Tobias Brunner f16f792e17 vici: Make installation of Ruby Gem and Python Egg optional
Installing them might not work well when building distro packages (e.g.
with DESTDIR installs).  It might be easier to install them later with a
script in the distro package.

When building from source on the local system it could still be useful to
install the packages directly, which can be enabled with separate configure
options.

The main problem with DESTDIR installations of the Python Egg is that
easy_install creates or modifies a file called easy-install.pth in the
installation directory.  So it's not actually possible to simply copy
the results in DESTDIR over to the actual system as that file would have
to be merged with any existing one.

Fixes #914.
2015-05-21 17:22:01 +02:00
Tobias Brunner 5a817407bc vici: Support out-of-tree build of Python Egg
We also don't require setup.py to exist during cleanup, as e.g. with
make distcheck the source directory is not writable when the build directory
is cleaned, so setup.py can't be created (to just get removed again anyway
if VICI and the Python Eggs haven't been enabled previously).
2015-05-21 17:19:09 +02:00
Tobias Brunner 4112ebad4a ikev1: When a reauth is detected explicitly delete the old IKE_SA
Instead of just implicitly destroying the old SA we properly delete it to
notify the other peer (if the other peer keeps the SA up after the
reauthentication and sends DPDs it might consider us dead even though the
new SA is up, that seems to be the case with racoon).  We delay the DELETE
a bit to give the other peer time to get the new SA fully established.

Since DELETE messages are not retransmitted it is still possible that
the other peer misses that we deleted the SA.
2015-05-21 16:00:39 +02:00
Tobias Brunner b29c5c0f21 Merge branch 'accounting-fixes'
This fixes the usage stats reported via RADIUS Accounting in several
corner cases (e.g. with interim updates while rekeying a CHILD_SA).

Fixes #891.
2015-05-21 15:40:05 +02:00
Tobias Brunner 240ad7abf5 libipsec: Insert SAs first, so latest SA with the same reqid gets used
This was useful for testing purposes of RADIUS accounting, but OS kernels
generally will use the latest SA, so we do the same.
2015-05-21 15:38:31 +02:00
Tobias Brunner 2b51124026 eap-radius: Keep track of stats for SAs migrated during IKEv1 reauthentication 2015-05-21 15:38:31 +02:00
Tobias Brunner 6a9a69ae58 ikev1: Trigger children_migrate event if CHILD_SAs are adopted 2015-05-21 15:38:31 +02:00
Tobias Brunner 072d9dc3c6 bus: Add new hook called when IKEv1 CHILD_SAs are migrated to a new IKE_SA
The interface is currently not very nice, but if we ever were able to
safely checkout multiple SAs concurrently we could add something similar
to ike_rekey() and call that when we detect a reauthentication.
2015-05-21 15:38:31 +02:00
Tobias Brunner 8dbef6dac8 eap-radius: Remove cache entries for expired SAs during ike/child_rekey 2015-05-21 15:38:31 +02:00
Tobias Brunner 7fbe79bce7 eap-radius: Add cache for usage stats of expired/rekeyed SAs
There are several situations that the previous code didn't handle that
well, for example, interim updates during rekeying (until the rekeyed SA
was deleted the numbers were too high, then suddenly dropped afterwards),
or rekeying for IKEv1 in general because rekeyed IPsec SAs stay installed
until they expire (so if they were still around when the IKE_SA was
terminated, the reported numbers in the Stop message were too high).

If intermediate updates are not used the cache entries for rekeyed
CHILD_SA will accumulate, we can't clean them up as we don't get
child_updown() events for them.
2015-05-21 15:38:25 +02:00
Tobias Brunner d079f6a4f7 libradius: Verify message ID of RADIUS responses
If we sent retransmits for a message and didn't receive a response it might
still arrive later.  Such a message will be queued on the socket.  The next
read will then return not the expected response but the one for the earlier
request.  For this message the verification will fail and the message gets
discarded.  But with the earlier code the actual response was never received.
Instead, a subsequent request resulted in the same failure and so on.

Fixes #838.
2015-05-21 14:30:11 +02:00
Tobias Brunner 6716c6526e kernel-netlink: Ignore unusable routes 2015-05-21 14:19:53 +02:00
Tobias Brunner cc902695e8 kernel-netlink: Make buffer size for received Netlink messages configurable 2015-05-21 10:19:08 +02:00
Tobias Brunner 682aab205e testing: Don't check parent dir (and subdirs) when downloading OpenSSL packages 2015-05-21 09:32:37 +02:00
Andreas Steffen e6952442f2 Exempt ignored PA-TNC attributes from error handling 2015-05-20 06:13:15 +02:00
Tobias Brunner c077642cbd testing: Fix kernel download URL for kernel versions != 4.x 2015-05-19 17:00:06 +02:00
Adrian-Ken Rueegsegger 10b5e8bb45 man: Clarification of ah keyword description 2015-05-19 14:02:56 +02:00
Tobias Brunner 95faeaa7ed starter: Ensure the daemon executable exists when starting up
The only purpose of starter is to control the IKE daemon, so we
terminate it if the daemon executable is not found (e.g. because
DAEMON_NAME is incorrect).

This removes the charonstart setting (it was not actually configurable
anymore).
2015-05-08 19:05:26 +02:00
Tobias Brunner 5923abc6bf starter: Remove START_CHARON compile flag
Since the removal of pluto this is quite superfluous. The flag itself
might be useful to avoid starting charon if the executable does not
exist for some reason (e.g. if DAEMON_NAME is incorrect).
2015-05-05 17:56:46 +02:00
Tobias Brunner 9b4f6cfa23 charon-nm: Disable leak-detective in charon-nm
It segfaults immediately if it is enabled, at least on Ubuntu 14.04.
2015-05-05 17:53:47 +02:00
Tobias Brunner 966efbc10d testing: Fix URL to TNC@FHH project in scenario descriptions 2015-05-05 11:48:56 +02:00