aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* child-sa: Install "outbound" FWD policy with lower priorityTobias Brunner2016-05-061-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a fix if symmetrically overlapping policies are installed as e.g. the case in the ikev2/ip-two-pools-db scenario: carol 10.3.0.1/32 ----- 10.3.0.0/16, 10.4.0.0/16 moon alice 10.4.0.1/32 ----- 10.3.0.0/16, 10.4.0.0/16 moon Among others, the following FWD policies are installed on moon: src 10.3.0.1/32 dst 10.4.0.0/16 ... tmpl ... src 10.4.0.0/16 dst 10.3.0.1/32 ... src 10.4.0.1/32 dst 10.3.0.0/16 ... tmpl ... src 10.3.0.0/16 dst 10.4.0.1/32 ... Because the network prefixes are the same for all of these they all have the same priority. Due to that it depends on the install order which policy gets used. For instance, a packet from 10.3.0.1 to 10.4.0.1 will match the first as well as the last policy. However, when handling the inbound packet we have to use the first one as the packet will otherwise be dropped due to a template mismatch. And we can't install templates with the "outbound" FWD policies as that would prevent using different IPsec modes or e.g. IPComp on only one of multiple SAs. Instead we install the "outbound" FWD policies with a lower priority than the "inbound" FWD policies so the latter are preferred. But we use a higher priority than default drop policies would use (in case they'd be defined with the same subnets).
* kernel-netlink: Check proper watcher state in parallel modeTobias Brunner2016-05-061-1/+1
| | | | | | | | | | | | | After adding the read callback the state is WATCHER_QUEUED and it is switched to WATCHER_RUNNING only later by an asynchronous job. This means that a thread that sent a Netlink message shortly after registration might see the state as WATCHER_QUEUED. If it then tries to read the response and the watcher thread is quicker to actually read the message from the socket, it could block on recv() while still holding the lock. And the asynchronous job that actually read the message and tries to queue it will block while trying to acquire the lock, so we'd end up in a deadlock. This is probably mostly a problem in the unit tests.
* trap-manager: Allow local address to be unspecifiedTobias Brunner2016-05-061-3/+1
| | | | | | | | If there is currently no route to reach the other peer we just default to left=%any. The local address is only really used to resolve leftsubnet=%dynamic anyway (and perhaps for MIPv6 proxy transport mode). Fixes #1375.
* kernel-netlink: Order routes by prefix before comparing priority/metricTobias Brunner2016-05-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Metrics are basically defined to order routes with equal prefix, so ordering routes by metric first makes not much sense as that could prefer totally unspecific routes over very specific ones. For instance, the previous code did break installation of routes for passthrough policies with two routes like these in the main routing table: default via 192.168.2.1 dev eth0 proto static 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.10 metric 1 Because the default route has no metric set (0) it was used, instead of the more specific other one, to determine src and next hop when installing a route for a passthrough policy for 192.168.2.0/24. Therefore, the installed route in table 220 did then incorrectly redirect all local traffic to "next hop" 192.168.2.1. The same issue occurred when determining the source address while installing trap policies. Fixes 6b57790270fb ("kernel-netlink: Respect kernel routing priorities for IKE routes"). Fixes #1416.
* ikev1: Activate DELETE tasks before other tasks in state ESTABLISHEDTobias Brunner2016-05-061-7/+7
| | | | Fixes #1410.
* ikev1: Don't use rekeyed CHILD_SAs for rekey detectionTobias Brunner2016-05-061-4/+4
| | | | | | | | | | | | An old (already rekeyed) CHILD_SA would get switched back into CHILD_REKEYING state. And we actually want to change the currently installed CHILD_SA to that state and later CHILD_REKEYED and properly call e.g. child_rekey() and not do this again with an old CHILD_SA. Instead let's only check installed or currently rekeying CHILD_SAs (in case of a rekey collision). It's also uncommon that there is a CHILD_SA in state CHILD_REKEYED but none in state CHILD_INSTALLED or CHILD_REKEYING, which could happen if e.g. a peer deleted and recreated a CHILD_SA after a rekeying. But in that case we don't want to treat the new CHILD_SA as rekeying (e.g. in regards to events on the bus).
* ikev1: Don't call updown hook etc. when deleting redundant CHILD_SAsTobias Brunner2016-05-061-0/+1
| | | | Fixes #1421.
* vici list-conns sends reauthentication and rekeying time informationAndreas Steffen2016-05-048-21/+43
|
* proposal: Remove some weaker and rarely used DH groups from the default proposalTobias Brunner2016-05-041-3/+5
| | | | | | | | | | | This fixes an interoperability issue with Windows Server 2012 R2 gateways. They insist on using modp1024 for IKE, however, Microsoft's IKEv2 implementation seems only to consider the first 15 DH groups in the proposal. Depending on the loaded plugins modp1024 is now at position 17 or even later, causing the server to reject the proposal. By removing some of the weaker and rarely used DH groups from the default proposal we make sure modp1024 is among the first 15 DH groups. The removed groups may still be used by configuring custom proposals.
* kernel-pfkey: Add support for manual prioritiesTobias Brunner2016-04-151-7/+24
| | | | Also orders policies with equals priorities by their automatic priority.
* kernel-pfkey: Update priority calculation formula to the new one in ↵Tobias Brunner2016-04-151-14/+25
| | | | | | | kernel-netlink Since the selectors are not exactly the same (no port masks, no interface) some small tweaks have been applied.
* kernel-netlink: Order policies with equal priorities by their automatic priorityTobias Brunner2016-04-151-11/+24
| | | | | | | | | | | | This allows using manual priorities for traps, which have a lower base priority than the resulting IPsec policies. This could otherwise be problematic if, for example, swanctl --install/uninstall is used while an SA is established combined with e.g. IPComp, where the trap policy does not look the same as the IPsec policy (which is now otherwise often the case as the reqids stay the same). It also orders policies by selector size if manual priorities are configured and narrowing occurs.
* Extended IPsec kernel policy schemeAndreas Steffen2016-04-091-18/+53
| | | | | | | | The kernel policy now considers src and dst port masks as well as restictions to a given network interface. The base priority is 100'000 for passthrough shunts, 200'000 for IPsec policies, 300'000 for IPsec policy traps and 400'000 for fallback drop shunts. The values 1..30'000 can be used for manually set priorities.
* Include manual policy priorities and restriction to interfaces in vici ↵Andreas Steffen2016-04-091-1/+14
| | | | list-conn command
* Implemented IPsec policies restricted to given network interfaceAndreas Steffen2016-04-097-14/+63
|
* Support manually-set IPsec policy prioritiesAndreas Steffen2016-04-097-22/+77
|
* peer-cfg: Use struct to pass data to constructorTobias Brunner2016-04-0911-167/+220
|
* child-cfg: Use struct to pass data to constructorTobias Brunner2016-04-0911-295/+293
|
* kernel-pfkey: Prefer policies with reqid over those withoutTobias Brunner2016-04-091-1/+7
|
* kernel-pfkey: Only install templates for regular IPsec policies with reqidTobias Brunner2016-04-091-32/+35
|
* shunt-manager: Install "outbound" FWD policyTobias Brunner2016-04-091-2/+8
| | | | | | If there is a default drop policy forwarded traffic might otherwise not be allowed by a specific passthrough policy (while local traffic is allowed).
* kernel-netlink: Prefer policies with reqid over those withoutTobias Brunner2016-04-091-1/+7
| | | | | | | This allows two CHILD_SAs with reversed subnets to install two FWD policies each. Since the outbound policy won't have a reqid set we will end up with the two inbound FWD policies installed in the kernel, with the correct templates to allow decrypted traffic.
* kernel-netlink: Only associate templates with inbound FWD policiesTobias Brunner2016-04-091-1/+1
| | | | | | We can't set a template on the outbound FWD policy (or we'd have to make it optional). Because if the traffic does not come from another (matching) IPsec tunnel it would get dropped due to the template mismatch.
* child-sa: Install "outbound" FWD policyTobias Brunner2016-04-091-0/+16
| | | | | | | If there is a DROP shunt that matches outbound forwarded traffic it would get dropped as the FWD policy we install only matches decrypted inbound traffic. That's because the Linux kernel first checks the FWD policies before looking up the OUT policy and SA to encrypt the packets.