aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * child-sa: Add method to associate rekeyed CHILD_SAs with their replacementTobias Brunner2017-05-232-0/+35
| |
| * child-sa: Add methods that allow partial installation of CHILD_SATobias Brunner2017-05-232-5/+144
| | | | | | | | | | | | | | Using install() for the inbound SA and register_outbound() for the outbound SA followed by install_policies(), will delay the installation of the outbound SA as well as the installation of the outbound policies in the kernel until install_outbound() is called later.
| * child-sa: Add new state to track installation of only the inbound SATobias Brunner2017-05-232-1/+7
| |
| * child-sa: Change API used to set/install policiesTobias Brunner2017-05-236-79/+119
| | | | | | | | This way we only have to pass the traffic selectors once.
| * child-sa: Split in- and outbound policy de-/installationTobias Brunner2017-05-231-62/+127
| | | | | | | | Only install outbound fallback policies.
| * child-create: Trigger NARROW_RESPONDER_POST hook before installing SAsTobias Brunner2017-05-231-25/+21
|/ | | | | This makes sure we use the same set of traffic selectors when installing the SAs and installing the policies.
* Merge branch 'fuzzing'Tobias Brunner2017-05-2326-41/+380
|\ | | | | | | | | | | | | | | | | | | | | | | Adds support for fuzzing the certificate parser provided by the default plugins (x509, pem, gmp etc.) on Google's OSS-Fuzz infrastructure (or generally with libFuzzer). Fixes several issues that were found while fuzzing these plugins. When building the libraries monolithically and statically the plugin constructors are now hard-coded in each library so the plugin code is not removed by the linker because it thinks none of their symbols are ever referenced.
| * tnc-ifmap: Null-terminate buffer to make sscanf()-calls safeTobias Brunner2017-05-231-4/+5
| |
| * libimcv: Make sure the first argument to sscanf() is null-terminatedTobias Brunner2017-05-232-2/+6
| |
| * asn1: Make sure the first argument to sscanf() is null-terminatedTobias Brunner2017-05-231-7/+9
| |
| * x509: Fix leak when parsing CDPs if an invalid one follows valid onesTobias Brunner2017-05-231-2/+2
| |
| * pem: Ensure a value before checking Proc-Type in PEM headerTobias Brunner2017-05-231-1/+1
| |
| * chunk: Correctly parse Base64 text where four = follow in a rowTobias Brunner2017-05-231-1/+1
| | | | | | | | | | | | | | That's not correct Base64 but invalid data could trigger this. Since outlen would get reduced four times, but is only ever increased three times per iteration, this could result in an integer underflow and then a potential buffer overflow.
| * configure: Don't modify CFLAGs if fuzzing is enabledTobias Brunner2017-05-231-5/+0
| | | | | | | | Just rely on the flags passed by the build process.
| * plugin-loader: Disable some logging output when building fuzz targetsTobias Brunner2017-05-231-4/+19
| | | | | | | | | | This avoids evaluating %N. An alternative would be to define a printf-hook for plugin features.
| * x509: Manually print CRL/OCSP URIs when fuzzingTobias Brunner2017-05-232-8/+28
| | | | | | | | This avoids a warning about the custom %Y printf specifier.
| * processor: Move priority threads assignment to set_threads()Tobias Brunner2017-05-231-4/+9
| | | | | | | | | | | | This avoids the evaluation of %N even if the thread pool is never used. We need to avoid as many custom printf specifiers as possible when fuzzing our code to avoid excessive log messages.
| * fuzz: Change how fuzz_certs is builtTobias Brunner2017-05-231-5/+11
| | | | | | | | | | | | We mainly do this because we have to create a self-contained executable and it isn't so easy to actually get libtool to link e.g. libgmp statically.
| * Add plugin constructor registration for all libraries that provide pluginsTobias Brunner2017-05-239-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, we can't just add the generated C file to the sources in Makefile.am as the linker would remove that object file when it notices that no symbol in it is ever referenced. So we include it in the file that contains the library initialization, which will definitely be referenced by the executable. This allows building an almost stand-alone static version of e.g. charon when building with `--enable-monolithic --enable-static --disable-shared` (without `--disable-shared` libtool will only build a version that links the libraries dynamically). External libraries (e.g. gmp or openssl) are not linked statically this way, though.
| * plugin-constructors: Add script to generate constructor registrationTobias Brunner2017-05-232-0/+61
| | | | | | | | Using a Python script so this works in cross-compilation situations.
| * plugin-loader: Add facility to register plugin constructorsTobias Brunner2017-05-233-4/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enabled when building monolithically and statically. This should allow us to work around the -whole-archive issue with libtool. If the libraries register the plugin constructors they provide they reference the constructors and will therefore prevent the linker from removing these seemingly unused symbols from the final executable. For use cases where dlsym() can be used, e.g. because the static libraries are manually linked with -whole-archive (Linux) or -force-load (Apple), this can be disabled by passing ss_cv_static_plugin_constructors=no to the configure script.
| * configure: Don't build static libraries by defaultTobias Brunner2017-05-231-0/+1
| | | | | | | | | | This way we can actually detect if someone wants to build strongSwan statically because --enable-static has to be passed explicitly.
| * library: Add compile option to disable memwipe() checkTobias Brunner2017-05-231-0/+6
| |
| * fuzz: Make path to libFuzzer.a configurableTobias Brunner2017-05-232-1/+2
| |
| * pem: Don't read beyond line endsTobias Brunner2017-05-231-2/+2
| |
| * x509: Fix leak if there is an empty CDPTobias Brunner2017-05-231-1/+7
| |
| * x509: Fix leak if a certificate contains multiple authorityKeyIdentifiersTobias Brunner2017-05-231-0/+1
| |
| * fuzz: Add fuzzing boilerplateTobias Brunner2017-05-236-8/+75
|/
* testing: Avoid expiration of allocated SPIs due to low retransmission settingsTobias Brunner2017-05-231-1/+6
|
* kernel-netlink: Use total retransmit timeout as acquire timeoutTobias Brunner2017-05-233-16/+26
| | | | | | | By using the total retransmit timeout, modifications of timeout settings automatically reflect on the value of xfrm_acq_expires. If set, the value of xfrm_acq_expires configured by the user takes precedence over the calculated value.
* task-manager: Add helper function to calculate the total retransmit timeoutTobias Brunner2017-05-232-1/+42
|
* ike: Use optional jitter to calculate retransmission timeoutsTobias Brunner2017-05-235-6/+75
| | | | | Also adds an optional limit to avoid very high retransmission timeouts with high numbers of retries.
* kernel-netlink: Try to add new inbound SA if update failsThomas Egerer2017-05-231-3/+12
| | | | | | | | | | | | | | | When establishing a traffic-triggered CHILD_SA involves the setup of an IKE_SA more than one exchange is required. As a result the temporary acquire state may have expired -- even if the acquire expiration (xfrm_acq_expires) time is set properly (165 by default). The expire message sent by the kernel is not processed in charon since no trap can be found by the trap manager. A possible solution could be to track allocated SPIs. But since this is a corner case and the tracking introduces quite a bit of overhead, it seems much more sensible to add a new state if the update of a state fails with NOT_FOUND. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* kernel-pfkey: Update SA addresses if supported by the kernelTobias Brunner2017-05-231-21/+16
| | | | | | Upcoming FreeBSD kernels will support updating the addresses of existing SAs with new SADB_X_EXT_NEW_ADDRESS_SRC|DST extensions for the SADB_UPDATE message.
* kernel-pfkey: Use new encap flag on Mac OS X when updating SAsTobias Brunner2017-05-231-1/+1
|
* receiver: Restrict init limit to half-open SAs as responderThomas Egerer2017-05-231-4/+2
| | | | Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* Merge branch 'hw-offload'Tobias Brunner2017-05-2316-172/+229
|\ | | | | | | | | Allows enabling hardware offload for IPsec SAs as introduced by Linux 4.11 for specific hardware.
| * kernel-netlink: Update hardware offload attribute when SAs are updatedTobias Brunner2017-05-231-11/+37
| |
| * kernel-netlink: Base SA update on correct message in multi-message responseTobias Brunner2017-05-231-7/+7
| |
| * vici: Make hardware offload configurableTobias Brunner2017-05-232-0/+15
| |
| * child-sa: Optionally enable hardware offload for CHILD_SAsTobias Brunner2017-05-231-0/+1
| |
| * child-cfg: Add flag to enable hardware offloadTobias Brunner2017-05-231-0/+3
| |
| * child-cfg: Use flags for boolean optionsTobias Brunner2017-05-2312-153/+129
| | | | | | | | Makes it potentially easier to add new flags.
| * kernel-netlink: Enable hardware offloading if configured for an SATobias Brunner2017-05-231-0/+25
| |
| * kernel-ipsec: Add flag to enable hardware offloading for an IPsec SATobias Brunner2017-05-231-0/+2
| |
| * include: Update xfrm.h to include hardware offloading extensionsTobias Brunner2017-05-231-1/+10
|/
* kernel-netlink: Directly handle Netlink messages if thread pool is emptyTobias Brunner2017-05-231-1/+2
| | | | | | | | | During initialization of the plugins the thread pool is not yet initialized so there is no watcher thread that could handle the queued Netlink message and the main thread will wait indefinitely for a response. Fixes #2199.
* socket-default: Add an option to force the sending interface via IP_PKTINFOMartin Willi2017-05-232-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | On Linux, setting the source address is insufficient to force a packet to be sent over a certain path. The kernel uses the best route to select the outgoing interface, even if we set a source address of a lower priority interface. This is not only true for interfaces attaching to the same subnet, but also for unrelated interfaces; the kernel (at least on 4.7) sends out the packet on whatever interface it sees fit, even if that network does not expect packets from the source address we force to. When a better interface becomes available, strongSwan sends its MOBIKE address list update using the old source address. But the kernel sends that packet over the new best interface. If that network drops packets having the unexpected source address from the old path, the MOBIKE update fails and the SA finally times out. To enforce a specific interface for our packet, we explicitly set the interface index from the interface where the source address is installed. According to ip(7), this overrules the specified source address to the primary interface address. As this could have side effects to installations using multiple addresses on a single interface, we disable the option by default for now. This also allows using IPv6 link-local addresses, which won't work if the outbound interface is not set explicitly.
* Add an option to announce support for IKE fragmentation but not sending ↵Tobias Brunner2017-05-236-16/+34
| | | | fragments
* swanctl: Use returned key ID to track loaded private keysTobias Brunner2017-05-231-13/+6
| | | | | | There was a direct call to load_key() for unencrypted keys that didn't remove the key ID from the hashtable, which caused keys to get unloaded when --load-creds was called multiple times.