Commit Graph

12843 Commits

Author SHA1 Message Date
Adrian-Ken Rueegsegger fc08e6af8a charon-tkm: Reset ESA on child SA create failure
Since we are also releasing the ESA ID we have to make sure that the ESA
context is reset and in a clean state in order for it to be actually
reusable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 59e7298ff9 charon-tkm: Check for error when acquiring ESA ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 8e823bb8b1 charon-tkm: Fix AE context life-cycle handling
Use new reference counting feature of ID manager for AE contexts and
only perform reset if count is zero. Also, do not pass on AE ID as every
IKE SA must decrement AE ID count once it is not used any longer.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger c198ddcb3f charon-tkm: Return current refcount when releasing ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 1b2a8d963a charon-tkm: Add acquire_ref method to ID manager
The function acquires a reference to the given context reference id for
a specific context kind.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger fcde9686f6 charon-tkm: Store context ids as int instead of bool
This is in preparation of making context ids refcountable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger d35ebfbce1 charon-tkm: Add missing whitespace log message 2017-09-15 12:16:57 +02:00
Tobias Brunner da479ae2c9 child-delete: Only let SAs expire naturally if they not already did 2017-09-15 12:16:45 +02:00
Andreas Steffen 8aad7ffb11 sec-updater: Import SWID tags of updated packages
sec-updater downloads the deb package files from security updates from
a given linux repository and uses the swid_generator command to
derive a SWID tag. The SWID tag is then imported into strongTNC
using the manage.py importswid command.
2017-09-09 20:23:19 +02:00
Andreas Steffen 33a729fac2 libimcv: Corrected caption 2017-09-09 13:10:45 +02:00
Andreas Steffen 165d28174d pt-tls-client: Introduced --options as a synonym for --optionsfrom 2017-09-09 10:31:02 +02:00
Andreas Steffen 94bdd463d8 sec-updater: Write to log only if at least one update is found. 2017-09-07 14:54:41 +02:00
Tobias Brunner 311d931aef android: New release after adding OCSP, CRL cache and some other stuff 2017-09-04 11:27:40 +02:00
Tobias Brunner c353996191 ike: Reset local SPI if retrying to connect in state IKE_CONNECTING
In case we send retransmits for an IKE_SA_INIT where we propose a DH
group the responder will reject we might later receive delayed responses
that either contain INVALID_KE_PAYLOAD notifies with the group we already
use or, if we retransmitted an IKE_SA_INIT with the requested group but
then had to restart again, a KE payload with a group different from the
one we proposed.  So far we didn't change the initiator SPI when
restarting the connection, i.e. these delayed responses were processed
and might have caused fatal errors due to a failed DH negotiation or
because of the internal retry counter in the ike-init task.  Changing
the initiator SPI avoids that as we won't process the delayed responses
anymore that caused this confusion.
2017-09-04 11:16:00 +02:00
Tobias Brunner eaedcf8c00 ike-sa-manager: Add method to change the initiator SPI of an IKE_SA 2017-09-04 11:16:00 +02:00
Tobias Brunner bd371590ab ike-init: Fail if DH group in KE payload does not match proposed group 2017-09-04 11:02:55 +02:00
Tobias Brunner 1926efadde android: Add disconnect button to dialog if already connected to profile 2017-09-04 10:41:30 +02:00
Tobias Brunner 037b353d2c android: Load x509 plugin to generate OCSP requests and parse responses
BoringSSL does not support OpenSSL's OCSP API.
2017-09-04 10:41:29 +02:00
Tobias Brunner 829cc56a53 android: Add support to POST data via SimpleFetcher
That's required for OCSP verification.
2017-09-04 10:41:29 +02:00
Tobias Brunner 6e39240a3e android: Add option to clear cached CRLs 2017-09-04 10:41:29 +02:00
Tobias Brunner 0bebbae9e3 android: Cache CRLs in app directory
Fixes #2405.
2017-09-04 10:41:25 +02:00
Tobias Brunner 3fe9a436ee android: Pass absolute path to the app's data directory via JNI 2017-09-04 10:41:25 +02:00
Tobias Brunner 98ab757284 android: Hide app selection in profile editor on Android < 5 2017-09-04 10:41:25 +02:00
Tobias Brunner 0b4f7d646b android: Only apply app filter on Android 5 and newer 2017-09-04 10:41:24 +02:00
Tobias Brunner ac3189f792 android: Catch OutOfMemoryError when importing profiles
Not sure if this is actually caused because e.g. the file is too large
or due to some encoding issue.
2017-09-04 10:41:24 +02:00
Tobias Brunner 1a9261a923 android: Catch NullPointerException when parsing invalid certificates 2017-09-04 10:41:24 +02:00
Tobias Brunner e59b78254a android: Catch NullPointerException when calling VpnService.prepare()
According to the Play Console this occurs occasionally.
2017-09-04 10:41:24 +02:00
Andreas Steffen fc373b64a6 imv-os: Updated security update evaluation 2017-09-01 12:42:24 +02:00
Andreas Steffen 7b75c18696 libimcv: Updated database scheme 2017-09-01 11:19:40 +02:00
Andreas Steffen b84817375d sec-updater: Checks for security updates
sec-updater checks for security updates and backports in Debian/
Ubuntu repositories and sets the security flags in the strongTNC
policy database accordingly.
2017-09-01 11:19:40 +02:00
Andreas Steffen 076aac7069 imv-attestation: Fixed file hash measurements
The introduction of file versions broke file hash measurements.
This has been fixed by using a generic product versions having an
empty package name.
2017-09-01 10:51:15 +02:00
Tobias Brunner 66805c7b32 ike-cfg: Fix memory leak when checking for configured address 2017-08-29 16:25:42 +02:00
Andreas Steffen d2a89e9407 sw-collector.8: Some cleanups 2017-08-25 11:28:06 +02:00
Tobias Brunner 062a34e722 kernel-netlink: Set usable state whenever an interface appears
If an interface is renamed we already have an entry (based on the
ifindex) allocated but previously only set the usable state once
based on the original name.

Fixes #2403.
2017-08-23 12:10:39 +02:00
Tobias Brunner b7ad5f777f libimcv: Updated Android.mk after move of swid-gen(-info) 2017-08-21 12:17:02 +02:00
Tobias Brunner 9cf2920512 traffic-selector: Use single buffer for both address families
The generic field of size 0 in the union that was used previously
triggered index-out-of-bounds errors with the UBSAN sanitizer that's
used on OSS-Fuzz.  Since the two family specific union members don't
really provide any advantage, we can just use a single buffer for both
families to avoid the errors.
2017-08-17 12:34:40 +02:00
Tobias Brunner ed13c60c4f plugin-loader: Move indent variables into !USE_FUZZING block
This avoids compile errors on Travis.
2017-08-15 10:35:20 +02:00
Adrian-Ken Rueegsegger c15dbfaf08 charon-tkm: Build fix for kernel SAD tests
Commit 7729577... added a flag to the get_esa_id function but the unit
tests were not adjusted.
2017-08-14 18:35:37 +02:00
Tobias Brunner ef5c37fcdf gmp: Fix RSA signature verification for m >= n
By definition, m must be <= n-1, we didn't enforce that and because
mpz_export() returns NULL if the passed value is zero a crash could have
been triggered with m == n.

Fixes CVE-2017-11185.
2017-08-14 08:49:33 +02:00
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
Andreas Steffen cab4cc3a10 sw-collector: strip arch suffix from package names 2017-07-13 12:03:27 +02:00
Andreas Steffen 5b1dbc3a8d sw-collector: Check for epoch-less Debian package versions 2017-07-12 19:12:22 +02:00
Andreas Steffen eab650d62f libtpmtss: Support of Intel TABRMD interface 2017-07-12 17:07:34 +02:00
Andreas Steffen 3bf8392d36 pt-tls-client: Support for TPM keyids 2017-07-08 23:19:51 +02:00
Andreas Steffen 49d56e1b39 imv-swima: Implemented SW event processing 2017-07-08 23:19:51 +02:00
Andreas Steffen 74aa1626d2 sw-collector: Query central collector database 2017-07-08 23:19:51 +02:00
Andreas Steffen 8ba6bf511e libimcv: Moved REST API from imv_swid and imv_swima to libimcv 2017-07-08 23:19:51 +02:00
Andreas Steffen 7e796bba67 swidtag: strongSwan swidtag file with double underscores 2017-07-08 23:19:51 +02:00
Andreas Steffen 032a5767ad sw-collector: Collects endpoint software events 2017-07-08 23:19:51 +02:00
Andreas Steffen 3a7c594c14 imv-swima: Created SWIMA IMV plugin 2017-07-08 23:19:51 +02:00
Andreas Steffen 2821c0f740 imc-swima: Created SWIMA IMC plugin 2017-07-08 23:19:51 +02:00
Andreas Steffen bf22470623 unit-tests: Added IETF SWIMA PA-TNC attribute tests 2017-07-08 23:19:51 +02:00
Andreas Steffen 84c0366bd3 libimcv: Implemented IETF SW PA-TNC attributes 2017-07-08 23:19:51 +02:00
Andreas Steffen bb87af2a73 libimcv: Fixed memory leak 2017-07-08 23:19:51 +02:00
Andreas Steffen 37205b05e6 libimcv: Corrected order of subscription flags 2017-07-08 23:19:51 +02:00
Andreas Steffen 0cc0b53b2f libimcv: Added IETF Software PA-TNC attributes 2017-07-08 23:19:51 +02:00
Andreas Steffen 8c4c824706 libtncif: Added IETF Software PA-TNC message subtype 2017-07-08 23:19:51 +02:00
Andreas Steffen 6795de0408 libimcv: SWID tag generation and discovery 2017-07-08 23:19:51 +02:00
Andreas Steffen 60da0153ee libimcv: Update database to ISO 19770-2:2015 SWID standard 2017-07-08 23:19:51 +02:00
Tobias Brunner d7dc677ee5 x509: Correctly encode nonce in OCSP request
The nonce value is encoded as OCTET STRING, however, the extension
values themselves must also be encoded as OCTET STRING.
2017-07-07 08:57:14 +02:00
Tobias Brunner 93e0898f60 swanctl: Document eap_id in remote sections 2017-07-05 18:08:04 +02:00
Tobias Brunner fd0a7b4795 kernel-pfroute: Make sure there is a netmask when enumerating subnets 2017-07-05 10:21:25 +02:00
Tobias Brunner 609457e4c8 pki: Fix typo in --print man page 2017-07-05 10:15:45 +02:00
Tobias Brunner 7aa30575d5 sql: Use qualified names in SQL query statements
VIRTUAL is a new reserved keyword in MySQL 5.7.6 that caused some of these
queries to fail.

Fixes #2359.
2017-07-05 10:13:39 +02:00
Tobias Brunner a3bcbb4c64 stroke: Don't load configs with invalid proposals
References #2347.
2017-07-05 10:08:36 +02:00
Tobias Brunner 5d580ae063 ikev1: Determine transform ID before mapping integrity algorithm ID
Due to the lookup based on the mapped algorithm ID the resulting AH
proposals were invalid.

Fixes #2347.

Fixes: 8456d6f5a8 ("ikev1: Don't require AH mapping for integrity algorithm when generating proposal")
2017-07-05 10:08:20 +02:00
Tobias Brunner 1aba82bfd7 eap-aka-3gpp: Add plugin that implements 3GPP MILENAGE algorithm in software
This is similar to the eap-aka-3gpp2 plugin. K (optionally concatenated
with OPc) may be configured as binary EAP secret in ipsec.secrets or
swanctl.conf.

Based on a patch by Thomas Strangert.

Fixes #2326.
2017-07-05 10:03:38 +02:00
Tobias Brunner 7004a59a4c utils: Make second argument to memxor() const 2017-07-05 10:02:05 +02:00
Tobias Brunner 909d7dca17 android: New release after fixing issues with older Android versions and DB upgrade 2017-07-04 11:55:04 +02:00
Tobias Brunner ccb6e9f1b0 android: Fix database update from older versions 2017-07-04 11:55:04 +02:00
Tobias Brunner a63b0f9982 android: Fix version string on older Android releases
SECURITY_PATCH is apparently only available since Android 6.
2017-07-04 11:54:57 +02:00
Tobias Brunner 480d56da5f android: New release after fixing crash with existing profiles 2017-07-03 13:44:49 +02:00
Tobias Brunner ebf369c483 android: Fix null pointer dereference with existing profiles 2017-07-03 13:43:53 +02:00
Tobias Brunner 64c2d3ca3e android: Only show disconnect button if actually connected 2017-07-03 12:11:30 +02:00
Tobias Brunner 1b1060821e android: New release after adding lots of new stuff 2017-07-03 10:47:43 +02:00
Tobias Brunner 6333a756ee android: Close activity when dialog is canceled if it was not visible before
onPause/onResume() won't work because onPause() is called right before
onNewIntent().
2017-07-03 10:39:26 +02:00
Tobias Brunner 1265b353d4 android: Allow disconnecting via MainActivity but display a confirmation dialog 2017-07-03 10:39:26 +02:00
Tobias Brunner d0ed8ee89e android: Add disconnect button to notification 2017-07-03 10:39:23 +02:00
Tobias Brunner 8ae7f8b7a2 android: Make sending certificate requests configurable in the GUI 2017-07-03 10:37:09 +02:00
Tobias Brunner 11eb7e0898 android: Import the flag to suppress certificate requests 2017-07-03 10:37:09 +02:00
Tobias Brunner 3f0592d0fd android: Add flag to suppress sending certificate requests 2017-07-03 10:37:09 +02:00
Tobias Brunner 0204374e21 android: Add property for simple flags 2017-07-03 10:37:09 +02:00
Tobias Brunner aa4b6eda59 android: Import NAT-T keepalive interval 2017-07-03 10:33:29 +02:00
Tobias Brunner a2aa0ca0e4 android: Make NAT-T keepalive interval configurable in the GUI 2017-07-03 10:33:29 +02:00
Tobias Brunner db599d6b28 android: Use configured NAT-T keepalive interval 2017-07-03 10:33:29 +02:00
Tobias Brunner a28302317f android: Add property for NAT-T keepalive interval 2017-07-03 10:33:29 +02:00
Tobias Brunner 0b075420df android: Use arrays as primary config option for subnets in profile files 2017-07-03 10:27:55 +02:00
Tobias Brunner 646260f464 android: Change format of address ranges and print sets 2017-07-03 10:27:55 +02:00
Tobias Brunner 291ef58c69 android: Make app handling and selection of apps configurable in profile editor 2017-07-03 10:27:54 +02:00
Tobias Brunner 3cc6a03fa0 android: Add simple activity for the selection of apps 2017-07-03 10:27:54 +02:00
Tobias Brunner eb59c6a38a android: Add list fragment for the selection of apps 2017-07-03 10:27:54 +02:00
Tobias Brunner 208e15c0ba android: Add filterable adapter for list of installed/selected apps 2017-07-03 10:27:54 +02:00
Tobias Brunner 238c3061b7 android: Add list item layout for installed/selected apps 2017-07-03 10:27:54 +02:00
Tobias Brunner 5561633fcd android: Add class that wraps ApplicationInfo for selected apps 2017-07-03 10:27:54 +02:00
Tobias Brunner cea8213f1b android: Handle checked state in activated background 2017-07-03 10:27:54 +02:00
Tobias Brunner 34496b787d android: Add text color for checkable list entries 2017-07-03 10:27:53 +02:00
Tobias Brunner 0974addf93 android: Add a linear layout that is checkable 2017-07-03 10:27:53 +02:00
Tobias Brunner 800f881ad0 android: Add convenience methods to get/set selected apps to/from a sorted set 2017-07-03 10:27:53 +02:00
Tobias Brunner d134ae21c2 android: Import selected/excluded apps from profile file 2017-07-03 10:27:53 +02:00
Tobias Brunner f2e7156d91 android: Apply selected apps according to config
Either only the selected apps are able to access the VPN or they are
excluded from access to the VPN.
2017-07-03 10:27:53 +02:00
Tobias Brunner 43b33f075a android: Add property for selected apps to VPN profiles
A second property will control if only the selected apps have access to
the VPN or if the selected apps are excluded from the VPN, or if the
functionality is disabled.
2017-07-03 10:27:53 +02:00
Tobias Brunner 05c5e894a9 android: Make custom subnets configurable in the GUI 2017-07-03 10:27:53 +02:00
Tobias Brunner 4a04bd3da5 android: Import custom subnets from profile file 2017-07-03 10:27:53 +02:00
Tobias Brunner 4471a93481 android: Use configured included subnets instead of negotiated TS 2017-07-03 10:27:52 +02:00
Tobias Brunner abf02a2176 android: Add ability to add a range set to another 2017-07-03 10:27:52 +02:00
Tobias Brunner a9875259e8 android: Add property for included subnets to VPN profiles 2017-07-03 10:27:52 +02:00
Tobias Brunner 1a63e8e44e android: Make excluded subnets configurable in the GUI 2017-07-03 10:27:52 +02:00
Tobias Brunner 70f7eb76d9 android: Import excluded subnets from profile file 2017-07-03 10:27:52 +02:00
Tobias Brunner 72b7c289ad android: Exclude configured subnets from the VPN 2017-07-03 10:27:52 +02:00
Tobias Brunner 1e26483167 android: Implement Iterable interface and addAll() for range set 2017-07-03 10:27:52 +02:00
Tobias Brunner 54714331e4 android: Add ability to remove a range set from another 2017-07-03 10:27:51 +02:00
Tobias Brunner 78b20efb29 android: Parse two addresses separated by - as range 2017-07-03 10:27:51 +02:00
Tobias Brunner 13ead876ad android: Add property for excluded subnets to VPN profiles 2017-07-03 10:27:51 +02:00
Tobias Brunner d852a02717 android: Add class to manage a set of IP address ranges/subnets 2017-07-03 10:27:51 +02:00
Tobias Brunner bcba14504a android: Add class to handle IP ranges and subnets 2017-07-03 10:27:51 +02:00
Tobias Brunner c5ba381757 android: Log some information about the Android version and the device 2017-07-03 10:27:51 +02:00
Tobias Brunner e5ec18009f android: Escape backslashes in settings values
For usernames that use domain specifiers.
2017-07-03 10:27:51 +02:00
Tobias Brunner 59693d6c56 android: Use a specific action to disconnect from the VPN 2017-07-03 10:27:50 +02:00
Tobias Brunner bef8bc3aac android: Try to load existing user cert when importing VPN profile 2017-07-03 10:27:50 +02:00
Tobias Brunner 36e8f43617 android: Enable revocation plugin 2017-07-03 10:27:50 +02:00
Tobias Brunner 7b4177578b android: Add a simple HTTP(S) fetcher for CRLs 2017-07-03 10:27:50 +02:00
Tobias Brunner ddd4d8b427 android: Use LOCAL_LDLIBS to link libdl
Newer NDKs fail otherwise as there is no actual module anymore.
2017-07-03 10:27:50 +02:00
Tobias Brunner 74d44e15dc android: Make log view more efficient
This bunches several log messages together before posting Runnables.

Fixes #2148.
2017-07-03 10:27:45 +02:00
Tobias Brunner 9c4607b454 android: Don't update state fragment if not attached to an Activity
When the bound state service finally connects we might not actually be
attached to an Activity.
2017-06-30 09:32:27 +02:00
Tobias Brunner b14507dd90 android: Make sure every listener at the VPN state service is only registered once
We register when the service connects but also in onStart() (as we
unregister in onStop() to avoid updates when not shown).  So this could
theoretically cause the listener to get registered twice if the service
is connected before onStart() is called (it seems it usually isn't).
2017-06-30 09:32:27 +02:00
Tobias Brunner 6766c85231 android: Add menu item to import VPN profile via Storage Access Framework
This is useful in case the proper MIME type was not set for a downloaded
profile.
2017-06-30 09:32:27 +02:00
Tobias Brunner edad60ea77 android: Add translation for Traditional Chinese
Courtesy of Chris Chiang.
2017-06-30 09:32:27 +02:00
Tobias Brunner 61098dd6a3 android: Move Simplified Chinese translation to values-zg-rCN folder 2017-06-30 09:32:26 +02:00
Tobias Brunner 451498b470 android: Update Gradle plugin and wrapper 2017-06-30 09:32:26 +02:00
Tobias Brunner 083208e805 ikev1: Only delete redundant CHILD_SAs if configured
If we find a redundant CHILD_SA (the peer probably rekeyed the SA before
us) we might not want to delete the old SA because the peer might still
use it (same applies to old CHILD_SAs after rekeyings).  So only delete
them if configured to do so.

Fixes #2358.
2017-06-26 10:33:16 +02:00
Tobias Brunner 56ffcdb166 configure: Enable coverage for all plugins via PLUGIN_CFLAGS 2017-06-20 13:52:16 +02:00
Tobias Brunner ee41367188 ipsec: Remove `starter` as valid command in --help
`start` is basically the same thing.

Fixes #2362.
2017-06-20 11:52:41 +02:00
Tobias Brunner e793d65acd openssl: Properly handle flags in key usage extension 2017-06-14 10:03:13 +02:00
Tobias Brunner dad4f6a178 charon-tkm: Return cloned host from tkm_kernel_sad_t::get_dst_host()
When an expire is triggered while rekeying, the CHILD_SA might be deleted
while the returned host is still used to queue a rekey job for the CHILD_SA.
2017-06-14 09:57:09 +02:00
Tobias Brunner d29531c226 configure: Use pkg-config to determine Ruby CFLAGS/LIBS 2017-06-07 16:48:02 +02:00
Tobias Brunner aa66e2b704 nm: Version bump to 1.4.2 2017-05-30 14:36:17 +02:00
Andreas Steffen 38a8ecadb7 x509: nameConstraints sequence does not require a loop
Fixes: CVE-2017-9023
2017-05-29 11:05:04 +02:00
Andreas Steffen f2f9edbbc0 unit-tests: Updated asn1-parser tests 2017-05-29 11:05:04 +02:00
Andreas Steffen 407fcca200 asn1-parser: Fix CHOICE parsing
Fixes: CVE-2017-9023
2017-05-29 11:05:04 +02:00
Tobias Brunner 6681d98d18 gmp: Make sure the modulus is odd and the exponent not zero
Unlike mpz_powm() its secure replacement mpz_powm_sec() has the additional
requirement that the exponent must be > 0 and the modulus has to be odd.
Otherwise, it will crash with a floating-point exception.

Fixes: CVE-2017-9022
Fixes: 3e35a6e7a1 ("Use side-channel secured mpz_powm_sec of libgmp 5, if available")
2017-05-29 11:05:04 +02:00
Andreas Steffen 89f05ed5a9 imv-swid: Fixed memory leak in http REST interface 2017-05-29 10:59:22 +02:00
Andreas Steffen 29e1c58643 leak-detective: Whitelisted memory leaks in FHH IMCs and IMVs 2017-05-29 10:59:04 +02:00
Andreas Steffen c82be739bc imv-test: Fixed memory leak in server retry use case 2017-05-29 10:58:33 +02:00
Andreas Steffen fca4e70bd3 libtnccs: Fixed memory leak of global variables in libxml2 2017-05-29 10:57:34 +02:00
Tobias Brunner a09e79ed5d ike-cfg: Fix memory leak when matching against ranges
traffic_selector_t::to_subnet() always sets the net/host (unless the
address family was invalid).

Fixes: 3070697f9f ("ike: support multiple addresses, ranges and subnets in IKE address config")
2017-05-29 10:50:58 +02:00
Tobias Brunner 00d547119e ike: Apply retransmission_limit before applying the jitter 2017-05-26 18:16:40 +02:00
Tobias Brunner 8ed3168406 eap-sim-file: Remove redundant enumerator allocation 2017-05-26 16:42:59 +02:00
Tobias Brunner bb494cde03 sql: Remove redundant enumerator allocation
Interestingly, this doesn't show up in the regression tests because the
compiler removes the first assignment (and thus the allocation) due to
-O2 that's included in our default CFLAGS.
2017-05-26 16:39:33 +02:00
Tobias Brunner b2473e94a2 Fixed some typos, courtesy of codespell 2017-05-26 14:44:06 +02:00
Tobias Brunner 2e4d110d1e linked-list: Change return value of find_first() and signature of its callback
This avoids the unportable five pointer hack.
2017-05-26 13:56:44 +02:00
Tobias Brunner 8a2e4d4a8b linked-list: Change interface of callback for invoke_function()
This avoids the unportable five pointer hack.
2017-05-26 13:56:44 +02:00
Tobias Brunner 5cafea6edd linked-list: invoke_offset() doesn't take any additional arguments anymore 2017-05-26 13:56:44 +02:00
Tobias Brunner 525cc46cab Change interface for enumerator_create_filter() callback
This avoids the unportable 5 pointer hack, but requires enumerating in
the callback.
2017-05-26 13:56:44 +02:00
Tobias Brunner 95a63bf281 Migrate all enumerators to venumerate() interface change 2017-05-26 13:56:44 +02:00
Tobias Brunner 16bffa8b55 enumerator: Add venumerate() method to enumerator_t that takes a va_list
This will allow us to implement e.g. enumerator_cleaner without having to
use that unportable 5 pointer forwarding or having to define a callback for
each instance.

A generic implementation for enumerate() is provided so only venumerate()
has to be implemented, which may be simplified by using the VA_ARGS_VGET()
macro.
2017-05-26 13:56:44 +02:00
Tobias Brunner 5297c65398 utils: Add helper macros to read variadic arguments into local variables 2017-05-26 13:56:44 +02:00
Tobias Brunner 0afe0eca67 vici: Make 96-bit truncation for SHA-256 configurable 2017-05-26 11:22:28 +02:00
Tobias Brunner 4270c8fcb0 stroke: Make 96-bit truncation for SHA-256 configurable 2017-05-26 11:22:28 +02:00
Tobias Brunner 7637633bb9 child-cfg: Optionally use 96-bit truncation for HMAC-SHA-256
The correct truncation is 128-bit but some implementations insist on
using 96-bit truncation.  With strongSwan this can be negotiated using
an algorithm identifier from a private range.  But this doesn't work
with third-party implementations.  This adds an option to use 96-bit
truncation even if the official identifier is used.
2017-05-26 11:22:27 +02:00
Tobias Brunner 7b476029e6 android-log: Link against liblog 2017-05-26 09:40:14 +02:00
Tobias Brunner 2cbb2271aa unit-tests: Fix test_chunk_eq() if arguments have side-effects 2017-05-24 09:34:17 +02:00
Tobias Brunner 10c7a66806 unit-tests: Check installed IPsec SAs in child-rekey tests 2017-05-23 18:46:50 +02:00
Tobias Brunner 72655fe411 unit-tests: Add assert to check for installed IPsec SAs 2017-05-23 18:46:50 +02:00
Tobias Brunner 2b581b59f0 unit-tests: Migrate cached IPsec SAs to new IKE_SAs during rekeying 2017-05-23 18:46:49 +02:00
Tobias Brunner d80055baae unit-tests: Keep track of installed IPsec SAs in mock kernel_ipsec_t implementation 2017-05-23 18:46:49 +02:00
Tobias Brunner 44107cb7b7 child-delete: Delay the removal of the inbound SA of rekeyed CHILD_SAs
After deleting a rekeyed CHILD_SA we uninstall the outbound SA but don't
destroy the CHILD_SA (and the inbound SA) immediately.  We delay it
a few seconds or until the SA expires to allow delayed packets to get
processed. The CHILD_SA remains in state CHILD_DELETING until it finally
gets destroyed.
2017-05-23 18:46:49 +02:00
Tobias Brunner ba0796fe75 delete-child-sa-job: Add new constructor that takes the unique ID of a CHILD_SA
This makes sure we delete the right SA in case the addresses got updated
in the mean time.
2017-05-23 18:46:49 +02:00
Tobias Brunner 0cbf75eb94 child-sa: Remove state to track installation of half the SA again 2017-05-23 18:46:49 +02:00
Tobias Brunner d94c122439 unit-tests: Overload helper macro to check for outbound SA state 2017-05-23 18:46:49 +02:00
Tobias Brunner afbea8ce3c child-sa: Expose state of the outbound SA 2017-05-23 18:46:48 +02:00
Tobias Brunner c5fed4cdee child-sa: Add method to remove the outbound SA and policies 2017-05-23 18:46:46 +02:00
Tobias Brunner 4ba07a8652 child-sa: Keep track whether the outbound SA has been installed or not 2017-05-23 18:46:06 +02:00
Tobias Brunner 9a5f7a30f8 child-delete: Track flags per individual CHILD_SA 2017-05-23 18:46:06 +02:00
Tobias Brunner dc3710e987 ikev2: Delay installation of outbound SAs during rekeying on the responder
The responder has all the information needed to install both SAs before
the initiator does.  So if the responder immediately installs the outbound
SA it might send packets using the new SA which the initiator is not yet
able to process.  This can be avoided by delaying the installation of the
outbound SA until the replaced SA is deleted.
2017-05-23 18:46:06 +02:00
Tobias Brunner f84757f2e6 child-sa: Add log message for CHILD_SA state changes 2017-05-23 18:46:06 +02:00
Tobias Brunner cad13450be child-sa: Add method to associate rekeyed CHILD_SAs with their replacement 2017-05-23 18:46:06 +02:00
Tobias Brunner 8a3a389e3d child-sa: Add methods that allow partial installation of CHILD_SA
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.
2017-05-23 18:46:03 +02:00
Tobias Brunner 83186d3cf7 child-sa: Add new state to track installation of only the inbound SA 2017-05-23 18:41:31 +02:00
Tobias Brunner 4989aba822 child-sa: Change API used to set/install policies
This way we only have to pass the traffic selectors once.
2017-05-23 18:41:31 +02:00
Tobias Brunner 29ef4cf5f4 child-sa: Split in- and outbound policy de-/installation
Only install outbound fallback policies.
2017-05-23 18:41:30 +02:00
Tobias Brunner b00bcb9add child-create: Trigger NARROW_RESPONDER_POST hook before installing SAs
This makes sure we use the same set of traffic selectors when installing
the SAs and installing the policies.
2017-05-23 18:41:30 +02:00
Tobias Brunner a9b698f5be tnc-ifmap: Null-terminate buffer to make sscanf()-calls safe 2017-05-23 18:29:13 +02:00
Tobias Brunner c001716642 libimcv: Make sure the first argument to sscanf() is null-terminated 2017-05-23 18:29:13 +02:00
Tobias Brunner 411bda6836 asn1: Make sure the first argument to sscanf() is null-terminated 2017-05-23 18:29:12 +02:00
Tobias Brunner 9c42126297 x509: Fix leak when parsing CDPs if an invalid one follows valid ones 2017-05-23 18:29:12 +02:00
Tobias Brunner b72718f4b8 pem: Ensure a value before checking Proc-Type in PEM header 2017-05-23 18:29:12 +02:00
Tobias Brunner aed77b0961 chunk: Correctly parse Base64 text where four = follow in a row
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.
2017-05-23 18:29:12 +02:00
Tobias Brunner 3963dbbde5 plugin-loader: Disable some logging output when building fuzz targets
This avoids evaluating %N. An alternative would be to define a printf-hook
for plugin features.
2017-05-23 18:29:12 +02:00
Tobias Brunner 92a10e4645 x509: Manually print CRL/OCSP URIs when fuzzing
This avoids a warning about the custom %Y printf specifier.
2017-05-23 18:29:12 +02:00
Tobias Brunner 83eacc448c processor: Move priority threads assignment to set_threads()
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.
2017-05-23 18:29:12 +02:00
Tobias Brunner 4a0b6d659d Add plugin constructor registration for all libraries that provide plugins
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.
2017-05-23 18:29:12 +02:00
Tobias Brunner 8699275ed6 plugin-constructors: Add script to generate constructor registration
Using a Python script so this works in cross-compilation situations.
2017-05-23 18:29:12 +02:00
Tobias Brunner 1a06bf03f9 plugin-loader: Add facility to register plugin constructors
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.
2017-05-23 18:29:12 +02:00
Tobias Brunner 98b55c8b83 library: Add compile option to disable memwipe() check 2017-05-23 18:29:11 +02:00
Tobias Brunner 30c03a7df9 pem: Don't read beyond line ends 2017-05-23 18:29:11 +02:00
Tobias Brunner 388351609d x509: Fix leak if there is an empty CDP 2017-05-23 18:29:11 +02:00
Tobias Brunner 5e37f7e550 x509: Fix leak if a certificate contains multiple authorityKeyIdentifiers 2017-05-23 18:29:11 +02:00
Tobias Brunner 70855696ad kernel-netlink: Use total retransmit timeout as acquire timeout
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.
2017-05-23 18:05:58 +02:00
Tobias Brunner bfbd3af850 task-manager: Add helper function to calculate the total retransmit timeout 2017-05-23 18:05:58 +02:00
Tobias Brunner 389e4b8e67 ike: Use optional jitter to calculate retransmission timeouts
Also adds an optional limit to avoid very high retransmission timeouts
with high numbers of retries.
2017-05-23 18:02:15 +02:00
Thomas Egerer d140b3bd3f kernel-netlink: Try to add new inbound SA if update fails
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>
2017-05-23 17:58:51 +02:00