Martin Willi [Fri, 17 May 2013 08:30:13 +0000 (10:30 +0200)]
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.
Martin Willi [Fri, 17 May 2013 08:22:00 +0000 (10:22 +0200)]
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.
Martin Willi [Thu, 16 May 2013 11:32:48 +0000 (13:32 +0200)]
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.
Tobias Brunner [Tue, 11 Jun 2013 13:38:56 +0000 (15:38 +0200)]
leak-detective: Resolve hooked functions during initialization
If uses of dlopen(), e.g. when loading plugins, produce errors an error
string could get allocated dynamically. At this point realloc() might not
yet be resolved and when dlsym() is later called by leak detective to do
so the error string might get freed while leak detective is disabled and
real_free() will be called with a pointer into one of leak detective's
memory blocks instead of a pointer to the block itself, causing a SIGSEGV.
Tobias Brunner [Fri, 31 May 2013 17:01:05 +0000 (19:01 +0200)]
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.
Tobias Brunner [Tue, 11 Jun 2013 09:18:33 +0000 (11:18 +0200)]
Merge branch 'plugin-loader'
Improves how plugin loader resolves dependencies between plugins. The
old loader had problems if plugins had dependencies on features provided
by plugins listed later in the plugin list. For instance, it was not
possible to use the X.509 implementation provided by the x509 plugin
while using all the crypto primitives provided by the openssl plugin.
Because the x509 plugin has a dependency on SHA1, the old loader skipped
that plugin until it loaded a SHA1 implementation. Because the loader
also loaded all features with resolved dependencies provided by a specific
plugin it would, while loading the openssl plugin's SHA1 implementation,
also load its X.509 implementation. So to use the x509 plugin it was
necessary to load the sha1 plugin before it so that its dependencies
could be properly resolved.
With the new implementation the plugins don't have to be in a specific
order to resolve dependencies. But the order still matters if two
plugins provide the same feature.
Also, support for the get_features() interface was added to all plugins.
Tobias Brunner [Sat, 8 Jun 2013 13:46:33 +0000 (15:46 +0200)]
Refactored plugin-loader with improved dependency resolution
With the new implementation the plugins don't have to be listed in any
special order, dependencies are properly resolved. The order only
matters if two plugins provide the same feature.
Tobias Brunner [Tue, 11 Jun 2013 09:07:43 +0000 (11:07 +0200)]
Merge branch 'unit-tests'
Adds a test runner and several test suites for libstrongswan.
Also adds an option to produce a test coverage report.
Several bugs were fixed in the process and chunk_hash() was replaced
with an improved implementation based on SipHash-2-4 (with a randomly
allocated key to prevent hash flooding attacks).
Tobias Brunner [Tue, 4 Jun 2013 15:29:40 +0000 (17:29 +0200)]
Ensure buffer in bio_writer_t is properly increased
The previous code was problematic if bufsize/increase was smaller than 8
and an u_int64_t was written when the buffer was too small. Also, for
large chunks and small bufsizes realloc() was called several times
instead of just once.
Tobias Brunner [Wed, 27 Mar 2013 15:15:10 +0000 (16:15 +0100)]
Remove dead code in token enumerator
Since we always search for the nearest separator (and strip them from
the front of the next token) there can't be any separators left at the
end of a token.