Commit Graph

12604 Commits

Author SHA1 Message Date
Andreas Steffen e658fd475a sw-collector: Moved info class to libimcv 2017-08-09 13:28:00 +02:00
Tobias Brunner eb3239b921 libimcv: Cast chunk length to int when printing as string 2017-08-08 15:32:08 +02:00
Tobias Brunner cbade9b6b9 sw-collector: Cast chunk length to int when printing as string 2017-08-08 15:31:56 +02:00
Tobias Brunner 0392f76804 sw-collector: Fix memory leak after failing to open DB 2017-08-08 15:30:44 +02:00
Tobias Brunner d093488b96 sw-collector: Use correct variable to report failure to open history file 2017-08-08 15:29:41 +02:00
Andreas Steffen 3295b35c6a imv-database: Improve performance by creating file_hashes index 2017-08-07 17:43:54 +02:00
Tobias Brunner e64cdb15c5 sw-collector: Add missing Doxygen group
Fix location of two classes.
2017-08-07 17:37:00 +02:00
Tobias Brunner 5d65aad8a6 libimcv: Add missing Doxgen group for SWIMA-related classes
Fix location of swima_error_t.
2017-08-07 17:36:48 +02:00
Tobias Brunner ca280574ba Fixed some typos, courtesy of codespell 2017-08-07 17:22:01 +02:00
Tobias Brunner 6fadc6a859 kernel-netlink: Wipe buffer used to read Netlink messages
When querying SAs the keys will end up in this buffer (the allocated
messages that are returned are already wiped). The kernel also returns
XFRM_MSG_NEWSA as response to XFRM_MSG_ALLOCSPI but we can't distinguish
this here as we only see the response.

References #2388.
2017-08-07 16:55:40 +02:00
Tobias Brunner 1a75514b76 sha2: Write final hash directly to output buffer
This avoids having the last output in internal memory that's not wiped.

References #2388.
2017-08-07 16:55:33 +02:00
Tobias Brunner e0c78d7516 prf-plus: Wipe seed and internal buffer
The buffer contains key material we handed out last and the seed can
contain the DH secret.

References #2388.
2017-08-07 16:55:28 +02:00
Eyal Birger 32e5c49234 child-sa: Allow requesting different unique marks for in/out
When requiring unique flags for CHILD_SAs, allow the configuration to
request different marks for each direction by using the %unique-dir keyword.

This is useful when different marks are desired for each direction but the
number of peers is not predefined.

An example use case is when implementing a site-to-site route-based VPN
without VTI devices.

A use of 0.0.0.0/0 - 0.0.0.0/0 traffic selectors with identical in/out marks
results in outbound traffic being wrongfully matched against the 'fwd'
policy - for which the underlay 'template' does not match - and dropped.

Using different marks for each direction avoids this issue as the 'fwd' policy
uses the 'in' mark will not match outbound traffic.

Closes strongswan/strongswan#78.
2017-08-07 14:22:27 +02:00
Tobias Brunner 1a8226429a trap-manager: Don't require that remote is resolvable during installation
Initiation might later fail, of course, but we don't really
require an IP address when installing, that is, unless the remote
traffic selector is dynamic. As that would result in installing a
0.0.0.0/0 remote TS which is not ideal when a single IP is expected as
remote.
2017-08-07 14:22:13 +02:00
Tobias Brunner 7bcd48d1b1 child-create: Don't log CHILD_SA initiation until we know the unique ID 2017-08-07 14:22:13 +02:00
Tobias Brunner 663b749c9f child-rekey: Add CHILD_SA name and unique ID to collision log messages 2017-08-07 14:22:13 +02:00
Tobias Brunner 859dae255c child-sa: Suppress CHILD_SA state changes if there is no change 2017-08-07 14:22:13 +02:00
Tobias Brunner 772957778c charon-tkm: Call esa_reset() when the inbound SA is deleted
After a rekeying the outbound SA and policy is deleted immediately, however,
the inbound SA is not removed until a few seconds later, so delayed packets
can still be processed.

This adds a flag to get_esa_id() that specifies the location of the
given SPI.
2017-08-07 10:46:00 +02:00
Tobias Brunner dbaeaaf605 charon-tkm: Remove unused get_other_esa_id() method 2017-08-07 10:46:00 +02:00
Tobias Brunner 15e745cf4d child-rekey: Don't install outbound SA in case of lost collisions
This splits the SA installation also on the initiator, so we can avoid
installing the outbound SA if we lost a rekey collision, which might
have caused traffic loss depending on the timing of the DELETEs that are
sent in both directions.
2017-08-07 10:46:00 +02:00
Tobias Brunner f9fbcbb1a0 bus: Don't trigger child_updown() for rekeyed CHILD_SAs
We don't trigger it either when they are deleted individually.
2017-08-07 10:44:05 +02:00
Tobias Brunner d24b831fe7 charon-tkm: Don't select new outbound SA until the policy is installed
This tries to avoid packet loss during rekeying by delaying the usage of
the new outbound IKE_SA until the old one is deleted.

Note that esa_select() is a no-op in the current TKM implementation. And
the implementation also doesn't benefit from the delayed deletion of the
inbound SA as it calls esa_reset() when the outbound SA is deleted.
2017-08-07 10:44:05 +02:00
Tobias Brunner 0d42a76275 charon-tkm: Claim to support SPIs on policies
This fixes rekeying as the delayed installation of the outbound SA
caused the nonce context to be expired already.
2017-08-07 10:44:05 +02:00
Tobias Brunner a146b4c9ef child-sa: Install outbound SA immediately if kernel supports SPIs on policies 2017-08-07 10:44:05 +02:00
Tobias Brunner 2c116ef589 child-sa: Use flags to track installation of outbound SA and policies separately 2017-08-07 10:44:05 +02:00
Tobias Brunner 2699c8387a kernel-netlink: Set SPI on outbound policy
This should cause the right SA to get used if there are multiple outbound
SAs and the policies are installed properly.
2017-08-07 10:44:05 +02:00
Tobias Brunner a46d233c0e kernel-interface: Not all kernel interfaces support SPIs on policies 2017-08-07 10:44:05 +02:00
Andreas Steffen 88501a64ca swid-gen: Share SWID generator between sw-collector, imc-swima and imc-swid 2017-08-04 19:15:26 +02:00
Andreas Steffen 073c179a88 sw-collector: Added --full option 2017-08-03 09:02:54 +02:00
Andreas Steffen bea3f5d07f sw-collector: Added --installed/removed options 2017-08-03 09:02:54 +02:00
Tobias Brunner 95ecc11774 unit-tests: Double escape backslashes in Windows paths in settings test
That's required when these are used as include paths in settings file
strings.
2017-07-28 11:22:40 +02:00
Tobias Brunner 67ad553a2c unit-tests: Stringify direction in message asserts early
x86_64-w64-mingw32-gcc on Windows requires this.
2017-07-28 11:18:59 +02:00
Tobias Brunner 65064cc33b unit-tests: iv_gen_seq has a dependency on RNG_STRONG
We currently don't have an RNG in Windows builds.
2017-07-28 11:18:59 +02:00
Tobias Brunner 8d4ebb3ac4 peer-cfg: Use an rwlock instead of a mutex to safely access child-cfgs
If multiple threads want to enumerate child-cfgs and potentially lock
other locks (e.g. check out IKE_SAs) while doing so a deadlock could
be caused (as was the case with VICI configs with start_action=start).
It should also improve performance for roadwarrior connections and lots
of clients connecting concurrently.

Fixes #2374.
2017-07-27 13:34:40 +02:00
Tobias Brunner 578d893b4a credential-manager: Log issuer identity if not found 2017-07-27 13:28:13 +02:00
Tobias Brunner 0b756fbe95 auth-cfg: Don't limit subjectAltName check to received certificates
Otherwise this won't work if the certificate is only locally available.
2017-07-27 13:27:19 +02:00
Tobias Brunner 4272a3e9d7 swanctl: Read default socket from swanctl.socket option
Also read from swanctl.plugins.vici.socket so we get
libstrongswan.plugins.vici.socket if it is defined.

Fixes #2372.
2017-07-27 13:22:57 +02:00
Tobias Brunner ae48325a59 swanctl: Include config snippets from conf.d subdirectory
Fixes #2371.
2017-07-27 13:20:24 +02:00
Tobias Brunner 67402ec77b curl: Enable following redirects
The maximum number of redirects can be limited. The functionality can also
be disabled.

Fixes #2366.
2017-07-27 13:15:43 +02:00
Tobias Brunner 791cfe82a1 ikev2: AES-CMAC-PRF-128 only uses the first 64 bits of each nonce
References #2377.
2017-07-27 13:09:26 +02:00
Tobias Brunner ed926a73df error-notify: Don't stop sending notifies after removing a disconnected listener
This prevented new listeners from receiving notifies if they joined
after another listener disconnected previously, and if they themselves
disconnected their old connection would prevent them again from getting
notifies.
2017-07-27 13:07:24 +02:00
Tobias Brunner 6138b8d629 farp: Only remove one tracked entry
Multiple CHILD_SAs sharing the same traffic selectors (e.g. during
make-before-break reauthentication) also have the same reqid assigned.
If all matching entries are removed we could end up without entry even
though an SA exists that still uses these traffic selectors.

Fixes #2373.
2017-07-27 13:07:23 +02:00
Tobias Brunner a0cde76958 ike: Trigger CHILD_INSTALLED state change after corresponding log message
This way we get the log message in stroke and swanctl as last message
when establishing a connection. It's already like this for the IKE_SA
where IKE_ESTABLISHED is set after the corresponding log message.

Fixes #2364.
2017-07-27 13:07:23 +02:00
Andreas Steffen f35fbb2b5f sw-collector: sw-collector.first_file setting retrieves creation date from file stats 2017-07-26 19:51:21 +02:00
Tobias Brunner 6b69a66379 swima-collector: Fix compile error if SWID_DIRECTORY is not defined 2017-07-24 11:34:39 +02:00
Tobias Brunner bf565b650c libimcv: Add missing files to Android.mk 2017-07-24 11:31:19 +02:00
Andreas Steffen a9383c2b46 checksum: Compile sw-collector before checksum 2017-07-18 20:02:21 +02:00
Andreas Steffen 8362378a15 checksum: Added pt-tls-client and sw-collector 2017-07-18 07:25:46 +02:00
Andreas Steffen 964bf73237 sw-collector: Moved to its own directory and added man page 2017-07-18 07:25:45 +02:00
Andreas Steffen 34cade8b84 pt-tls-client: Added man page 2017-07-16 15:37:03 +02:00