aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* vici: Fix type error exception in Python bindingsodi792017-04-191-1/+1
| | | | | | | | | | Line 66 yields "TypeError: can't concat bytes to str" using Python 3.4. "requestdata" was introduced in 22f08609f1b6 but is not actually used. Since the original "request" is not used anywhere else this can be changed to be similar to the other UTF-8 encoding changes in that commit. Fixes: 22f08609f1b6 ("vici: Explicitly set the Python encoding type"). Closes strongswan/strongswan#66.
* kernel-netlink: Avoid O(n^2) copy operations when concatenating Netlink ↵Jiri Horky2017-03-271-7/+13
| | | | | | | | | | | | | | | | | | | | responses When constructing the result, all responses from Netlink were concatenated iteratively, i.e. for each response, the previously acquired result was copied to newly allocated memory and the current response appended to it. This results in O(n^2) copy operations. Instead, we now check for the total final length of the result and copy the individual responses to it in one pass, i.e. in O(n) copy operations. In particular, this issue caused very high CPU usage in memcpy() function as the result is copied over and over. Common way how to hit the issue is when having 1000+ routes and 5+ connecting clients a second. In that case, the memcpy() function can take 50%+ of one CPU thread on a decent CPU and the whole charon daemon is stuck just reading routes and concatenating them together (connecting clients are blocked in that particular case as this is done under mutex). Closes strongswan/strongswan#65. References #2055.
* addrblock: Narrow selectors when rekeying a CHILD_SA as original responderMartin Willi2017-03-241-0/+1
| | | | | | | | | | | | If a the original responder narrows the selectors of its peer in addrblock, the peer gets a subset of that selectors. However, once the original responder initiates rekeying of that CHILD_SA, it sends the full selectors to the peer, and then narrows the received selectors locally for the installation, only. This is insufficient, as the peer ends up with wider selectors, sending traffic that the original responder will reject to the stricter IPsec policy. So additionally narrow the selectors when rekeying CHILD_SAs before sending the TS list to the peer.
* kernel-wfp: Don't redefine IPPROTO_IP* if already definedTobias Brunner2017-03-231-0/+4
|
* vici: Don't fall back to uninstalling traps if a matching shunt was foundTobias Brunner2017-03-231-3/+7
| | | | | | | This is different if `ike` and `child` are provided and uninstall() fails as we call that without knowing whether a matching shunt exists. But if `ike` is not provided we explicitly search for a matching shunt and if found don't need to look for a trap policy.
* Fixed some typos, courtesy of codespellTobias Brunner2017-03-232-2/+2
|
* vici: Document how we pronounce the vici protocol and pluginMartin Willi2017-03-201-3/+3
|
* kernel: Make range of SPIs for IPsec SAs configurableTobias Brunner2017-03-022-6/+20
|
* addrblock: Use dynamic TS narrowing instead of rejecting the whole CHILD_SAMartin Willi2017-03-021-43/+28
| | | | | | | | Previously, the client had to propose no wider selectors than the certificate permits, otherwise the complete CHILD_SA was rejected. However, with IKEv2 we can dynamically narrow the selectors to what the certificate allows. This makes client and gateway configurations very simple by just proposing 0.0.0.0/0, narrowed to selectors the client is permitted to route into the network.
* addrblock: Support an optional non-strict mode accepting certs without addrblockMartin Willi2017-03-021-3/+11
| | | | | | | This allows a gateway to enforce the addrblock policy on certificates that actually have the extension only. For (legacy) certificates not having the extension, traffic selectors are validated/narrowed by other means, most likely by the configuration.
* vici: Only log messages if there actually is a listenerTobias Brunner2017-02-161-0/+7
|
* vici: Let has_event_listeners() actually check if clients are registeredTobias Brunner2017-02-161-2/+4
| | | | | Fixes: 8d96f90a7983 ("vici: Add function to test if an event should be generated")
* vici: Add support for mediation extensionTobias Brunner2017-02-161-1/+85
|
* peer-cfg: Store mediated_by as name and not peer-cfg referenceTobias Brunner2017-02-163-52/+62
| | | | | | | | | This way updates to the mediation config are respected and the order in which configs are configured/loaded does not matter. The SQL plugin currently maintains the strong relationship between mediated and mediation connection (we could theoretically change that to a string too).
* vici: Include uniqueness policy in list-connsTobias Brunner2017-02-161-0/+2
|
* vici: Add command to initiate SA rekeyingTobias Brunner2017-02-162-2/+118
|
* vici: Use unique names for CHILD_SAs in the list-sas commandTobias Brunner2017-02-162-2/+7
| | | | | | | | | The original name is returned in the new "name" attribute. This fixes an issue with bindings that map VICI messages to dictionaries. For instance, in roadwarrior scenarios where every CHILD_SA has the same name only the information of the last CHILD_SA would end up in the dictionary for that name.
* vici: Add support to load CA certificates from tokens and paths in authority ↵Tobias Brunner2017-02-161-10/+97
| | | | sections
* vici: Add support to load certificates from file pathsTobias Brunner2017-02-161-13/+32
| | | | Probably not that useful via swanctl.conf but could be when used via VICI.
* vici: Add support to load certificates from tokensTobias Brunner2017-02-161-12/+115
|
* vici: Add command to load a private key from a tokenTobias Brunner2017-02-162-3/+117
| | | | | | | PINs are stored in a "hidden" credential set, so that its shared secrets are not exposed via VICI. Since they are not explicitly loaded as shared secrets via VICI a client might consider them as removed secrets and remove them.
* vici: List namespace/peer-cfg name with policies and allow filteringTobias Brunner2017-02-162-13/+33
| | | | The two names are also transmitted in separate keys.
* vici: Explicitly use peer name when uninstalling trap and shunt policiesTobias Brunner2017-02-163-10/+40
| | | | Also adds an `ike` parameter to the `uninstall` command.
* stroke: Use peer name as namespace for shunt policiesTobias Brunner2017-02-161-2/+18
| | | | | The same goes for the start-action-job. When unrouting, we search for the first policy with a matching child-cfg.
* shunt-manager: Add an optional namespace for each shuntTobias Brunner2017-02-167-12/+13
| | | | | This will allow us to reuse the names of child configs e.g. when they are defined in different connections.
* vici: Add support for NT Hash secretsTobias Brunner2017-02-161-0/+4
| | | | Fixes #1002.
* vici: Add support for IPv6 Transport Proxy ModeTobias Brunner2017-02-162-14/+39
|
* vici: Add support for certificate policiesTobias Brunner2017-02-161-0/+17
|
* vici: Add missing dscp setting for IKE_SAsTobias Brunner2017-02-161-5/+39
| | | | Fixes #2170.
* vici: Add possibility to remove shared keys by a unique identifierTobias Brunner2017-02-162-5/+76
| | | | | This identifier can be set when adding/replacing a secret. The unique identifiers of all secrets may be enumerated.
* vici: Add commands to enumerate and remove private keysTobias Brunner2017-02-162-2/+75
| | | | They are identified by their SHA-1 key identifier.
* vici: Update get_pools() in Python and Ruby bindingsTobias Brunner2017-02-162-4/+6
|
* vici: Add option to query a specific poolTobias Brunner2017-02-162-3/+10
|
* bypass-lan: Don't use interfaces in policiesTobias Brunner2017-02-161-7/+6
| | | | | | | | | | | After an interface disappeared we can't remove the policies correctly as the name doesn't resolve to the previous index anymore. And making the policies so specific might not provide that much benefit. To handle the interfaces on the policies correctly would require some changes to the child-cfg, kernel-interface etc. so they'd take interface indices directly so we could target the policies correctly even if an interface disappeared (or reappeared and got a new index).
* kernel-netlink: Use RTA_SRC to specify route source in kernel-based lookupsMartin Willi2017-02-131-1/+8
| | | | | | | For table dumps the kernel accepts RTA_PREFSRC to filter the routes, which is what we do when doing userspace route calculations. For kernel-based route lookups, however, the RTA_PREFSRC attribute is ignored and we must specify RTA_SRC for policy based route lookups.
* kernel-netlink: Use kernel-based route lookup if we do not install routesMartin Willi2017-02-131-1/+11
| | | | | | | | | | | | For gateways with many connections, installing routes is often disabled, as we can use a static route configuration to achieve proper routing with a single rule. If this is the case, there is no need to dump all routes and do userspace route lookups, as there is no need to exclude routes we installed ourself. Doing kernel-based route lookups is not only faster with may routes, but also can use the full power of Linux policy based routing; something we can hardly rebuild in userspace when calculating routes.
* vici: Include the Netfilter marks in listed CHILD_SAsMartin Willi2017-02-132-0/+19
|
* vici: Explicitly set the Python encoding typeMartin Willi2017-02-131-4/+4
| | | | | | | | | | When using vici over RPyC and its (awesome) splitbrain, encoding and decoding strings fails in vici, most likely because of the Monkey-Patch magic splitbrain uses. When specifying the implicit UTF-8 as encoding scheme explicitly, Python uses the correct method to encode/decode the string, making vici useable in splitbrain contexts.
* kernel-pfroute: Implement enumeration of local subnetsTobias Brunner2017-02-081-0/+194
|
* bypass-lan: Allow ignoring or only considering subnets of specific interfacesTobias Brunner2017-02-083-6/+93
| | | | The config can also be reloaded by sending a SIGHUP to charon.
* bypass-lan: Configure interface on bypass policyTobias Brunner2017-02-081-1/+6
| | | | | Currently, only the kernel-netlink plugin supports this, the others will just ignore it.
* kernel-netlink: Return interface name in local subnet enumeratorTobias Brunner2017-02-081-5/+15
|
* kernel-interface: Add interface name to local subnet enumeratorTobias Brunner2017-02-082-2/+4
|
* bypass-lan: Add plugin that installs bypass policies for locally attached ↵Tobias Brunner2017-02-085-0/+426
| | | | subnets
* kernel-netlink: Implement enumerator for local subnetsTobias Brunner2017-02-081-0/+130
|
* kernel-pfkey: Use the same priority range for trap and regular policiesTobias Brunner2017-02-081-15/+15
| | | | Same as the change in the kernel-netlink plugin.
* kernel-netlink: Use the same priority range for trap and regular policiesTobias Brunner2017-02-081-14/+14
| | | | | | | | | | | | | While trap and regular policies now often look the same (mainly because reqids are kept constant) trap policies still need to have a lower priority than regular policies to handle unroute/route correctly if e.g. IPComp is used or the mode changes. But if we use a completely different priority range that's lower than that of regular policies it is not possible to install overlapping trap policies. By differentiating trap from regular policies via the priority's LSB this issue is avoided while still maintaining the proper ordering of trap and regular policies. Fixes #1243.
* kernel-netlink: Fix spacing in log message when policy is unchangedTobias Brunner2017-02-081-1/+1
|
* forecast: Mark correct port in UDP NAT-T ruleJames Laird-Wah2017-02-081-1/+1
| | | | Closes strongswan/strongswan#62.
* eap-dynamic: Publish the get_auth() method of the wrapped EAP methodTobias Brunner2017-02-071-0/+12
| | | | Fixes #2238.