aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
Commit message (Collapse)AuthorAgeFilesLines
...
* unit-tests: Add separate test runner to test IKEv2 exchangesTobias Brunner2016-06-173-4/+100
| | | | This allows proper initialization of the daemon and the helper object.
* unit-tests: Add helper class/object to test IKE exchangesTobias Brunner2016-06-173-0/+331
|
* unit-tests: Add mock kernel_ipsec_t implementation for unit testsTobias Brunner2016-06-173-0/+165
| | | | Provides predictable sequential SPIs.
* unit-tests: Add mock sender_t implementation for unit testingTobias Brunner2016-06-174-0/+153
| | | | | This allows to retrieve packets sent by an IKE_SA and pass it to another IKE_SA directly via process_message().
* unit-tests: Don't unload plugins before calling libcharon_deinit()Tobias Brunner2016-06-171-3/+0
| | | | | | | libcharon_deinit() already calls all the functions we called manually. Unloading the plugins will not work if charon->initialize() is called as charon's static plugin features would already be unloaded before the destroyed members are accessed in destroy() to flush them.
* kernel-netlink: Don't set replay window for outbound SAsTobias Brunner2016-06-171-0/+6
| | | | | It's not necessary and might waste memory. However, if ESN is used we set the window to 1 as the kernel rejects the attribute otherwise.
* kernel-pfkey: Only set the replay window for inbound SAsTobias Brunner2016-06-171-3/+8
| | | | | It is not necessary for outbound SAs and might waste memory when large window sizes are used.
* daemon: Don't hold settings lock while executing start/stop scriptsTobias Brunner2016-06-171-20/+43
| | | | | | | If a called script interacts with the daemon or one of its plugins another thread might have to acquire the write lock (e.g. to configure a fallback or set a value). Holding the read lock prevents that, potentially resulting in a deadlock.
* quick-mode: Fix reporting lifebytes if lifetime is configuredTobias Brunner2016-06-171-2/+2
|
* load-tester: Fix load-tester on platforms where plain `char` is signedTobias Brunner2016-06-171-1/+1
| | | | | | | | fgetc() returns an int and EOF is usually -1 so when this gets casted to a char the result depends on whether `char` means `signed char` or `unsigned char` (the C standard does not specify it). If it is unsigned then its value is 0xff so the comparison with EOF will fail as that is an implicit signed int.
* configure: Check for and explicitly link against -latomicMartin Willi2016-06-141-1/+1
| | | | | Some C libraries, such as uClibc, require an explicit link for some atomic functions. Check for any libatomic, and explcily link it.
* resolve: Add refcounting for installed DNS serversTobias Brunner2016-06-101-27/+99
| | | | | | This fixes DNS server installation if make-before-break reauthentication is used as there the new SA and DNS server is installed before it then is removed again when the old IKE_SA is torn down.
* resolve: Use process abstraction when calling resolvconfTobias Brunner2016-06-101-18/+60
| | | | This allows us to capture output written to stderr/stdout.
* resolve: Make sure to clean up if calling resolvconf failedTobias Brunner2016-06-101-3/+4
| | | | | | If running resolvconf fails handle() fails release() is not called, which might leave an interface file on the system (or depending on which script called by resolvconf actually failed even the installed DNS server).
* kernel-pfroute: Return interface to reach destination from get_nexthop()Tobias Brunner2016-06-101-4/+13
|
* kernel-pfkey: Install routes with OUT policiesTobias Brunner2016-06-101-31/+30
|
* kernel-netlink: Install routes with OUT policiesTobias Brunner2016-06-101-25/+24
| | | | | This is the direction we actually need routes in and makes the code easier to read.
* kernel-pfkey: Don't install routes for drop policies and if protocol/ports ↵Tobias Brunner2016-06-101-3/+10
| | | | are in the selector
* kernel-netlink: Don't install routes for drop policies and if protocol/ports ↵Tobias Brunner2016-06-101-96/+106
| | | | | | | | | are in the selector We don't need them for drop policies and they might even mess with other routes we install. Routes for policies with protocol/ports in the selector will always be too broad and might conflict with other routes we install.
* kernel-pfkey: Also use interface returned by get_nexthop() for IPsec policiesTobias Brunner2016-06-101-1/+3
| | | | | An exception is if the local address is virtual, in which case we want the route to be via TUN device.
* kernel-netlink: Also use interface returned by get_nexthop() for IPsec policiesTobias Brunner2016-06-101-1/+2
|
* kernel-pfkey: Use interface to next hop for shunt policiesTobias Brunner2016-06-101-2/+3
|
* kernel-netlink: Use interface to next hop for shunt policiesTobias Brunner2016-06-101-10/+13
| | | | | | Using the source address to determine the interface is not correct for net-to-net shunts between two interfaces on which the host has IP addresses for each subnet.
* kernel-netlink: Return outbound interface in get_nexthop()Tobias Brunner2016-06-101-5/+43
|
* kernel-net: Let get_nexthop() return an optional interface nameTobias Brunner2016-06-1010-21/+42
| | | | | The returned name should be the interface over which the destination address/net is reachable.
* kernel-interface: Always set `vip` if get_address_by_ts() returns successfullyTobias Brunner2016-06-101-0/+4
|
* kernel-netlink: Let only a single thread work on a specific policyTobias Brunner2016-06-101-25/+69
| | | | | | | | | | | | | Other threads are free to add/update/delete other policies. This tries to prevent race conditions caused by releasing the mutex while sending messages to the kernel. For instance, if break-before-make reauthentication is used and one thread on the responder is delayed in deleting the policies that another thread is concurrently adding for the new SA. This could have resulted in no policies being installed eventually. Fixes #1400.
* kernel-netlink: Add priority and refcount to policy logTobias Brunner2016-06-101-9/+30
|
* kernel-netlink: Consistently print mark in log messages only if setTobias Brunner2016-06-101-108/+82
|
* kernel-netlink: Provide error information for Netlink socketsTobias Brunner2016-06-103-19/+25
| | | | #1467.
* kernel-netlink: Allow definition of a custom priority calculation functionTobias Brunner2016-06-102-3/+18
|
* kernel-pfkey: Use ipsec_sa_cfg_equals()Tobias Brunner2016-06-081-1/+1
|
* kernel-netlink: Use ipsec_sa_cfg_equals() and compare marks properlyTobias Brunner2016-06-081-2/+3
|
* eap-simaka-pseudonym: Properly store mappingsTobias Brunner2016-06-061-44/+38
| | | | | | | | | | | If a pseudonym changed a new entry was added to the table storing permanent identity objects (that are used as keys in the other table). However, the old mapping was not removed while replacing the mapping in the pseudonym table caused the old pseudonym to get destroyed. This eventually caused crashes when a new pseudonym had the same hash value as such a defunct entry and keys had to be compared. Fixes strongswan/strongswan#46.
* child-sa: Use non-static variable to store generated unique markTobias Brunner2016-06-061-1/+2
| | | | | | If two CHILD_SAs with mark=%unique are created concurrently they could otherwise end up with either the same mark or different marks in both directions.
* ike: Don't trigger message hook when fragmenting pre-generated messagesTobias Brunner2016-06-061-2/+10
| | | | | | | | | This is the case for the IKE_SA_INIT and the initial IKEv1 messages, which are pre-generated in tasks as at least parts of it are used to generate the AUTH payload. The IKE_SA_INIT message will never be fragmented, but the IKEv1 messages might be, so we can't just call generate_message(). Fixes #1478.
* error-notify: Notify listeners upon IKE retransmitThomas Egerer2016-06-062-0/+6
| | | | Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* task-manager: Add retransmit cleared alertTobias Brunner2016-06-063-0/+16
|
* task-manager: Add retransmit count to retransmit send alertThomas Egerer2016-06-063-4/+7
| | | | Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* stroke: Permanently store PINs in credential setTobias Brunner2016-06-061-12/+35
| | | | | | | This fixes authentication with tokens that require the PIN for every signature. Fixes #1369.
* controller: Use separate callbacks to track termination and initiation of SAsTobias Brunner2016-06-061-8/+58
| | | | | | | If a local authentication failure occurs in IKEv1 we delete the IKE_SA, which we don't want the controller to detect as success. Fixes #1449.
* ikev1: Queue INFORMATIONAL messages during XAuthTobias Brunner2016-06-061-5/+12
| | | | | | | | | | Some peers send an INITIAL_CONTACT notify after they received our XAuth username. The XAuth task waiting for the third XAuth message handles this incorrectly and closes the IKE_SA as no configuration payloads are contained in the message. We queue the INFORMATIONAL until the XAuth exchange is complete to avoid this issue. Fixes #1434.
* ikev2: Handle INITIAL_CONTACT notifies also when peer is authenticated with EAPTobias Brunner2016-06-061-16/+5
| | | | Fixes #1380.
* p-cscf: Remove libhydra reference in MakefileTobias Brunner2016-05-271-1/+0
|
* vici: Put source distribution in the dist dir in the build directoryTobias Brunner2016-05-111-1/+3
| | | | This fixes the out-of-tree build.
* vici: Add target to build a source package and universal wheel of the Python ↵Tobias Brunner2016-05-111-0/+6
| | | | package
* vici: Add README.rst to be used as description on PyPITobias Brunner2016-05-114-8/+28
|
* vici: Replace dr with dev in version numbers for the Python eggTobias Brunner2016-05-101-5/+5
| | | | | | The versioning scheme used by Python (PEP 440) supports the rcN suffix but development releases have to be named devN, not drN, which are not supported and considered legacy versions.
* vici: Update setup.pyTobias Brunner2016-05-101-4/+5
|
* vici: Ensure we read exactly the specified amount of bytes from the socket ↵Tobias Brunner2016-05-101-2/+9
| | | | | | | in Python recv() will return less bytes than specified (as that's the buffer size) if not as many are ready to be read from the socket.