15 months agokernel-netlink: Align concatenated Netlink responses
Thomas Egerer [Thu, 16 Aug 2018 07:12:37 +0000 (09:12 +0200)]
kernel-netlink: Align concatenated Netlink responses

The code to support parallel Netlink queries (commit 3c7193f) made use
of nlmsg_len member from struct nlmsghdr to allocate and copy the
responses. Since NLMSG_NEXT is later used to parse these responses, they
must be aligned, or the results are undefined.

Signed-off-by: Thomas Egerer <>
16 months agolibimcv: Fix
Tobias Brunner [Fri, 10 Aug 2018 08:09:07 +0000 (10:09 +0200)]
libimcv: Fix

16 months agolibtpmtss: Fixed
Vishal Rana [Thu, 9 Aug 2018 05:28:03 +0000 (22:28 -0700)]
libtpmtss: Fixed

Closes strongswan/strongswan#111

Signed-off-by: Vishal Rana <>
16 months agoREADME: Fix typos
Tom Schlenkhoff [Mon, 6 Aug 2018 11:24:18 +0000 (13:24 +0200)]
README: Fix typos

Closes strongswan/strongswan#110.

16 months agotravis: Fix vici Python tests when using Clang
Tobias Brunner [Mon, 6 Aug 2018 09:54:24 +0000 (11:54 +0200)]
travis: Fix vici Python tests when using Clang

For some reason the clang binary that's installed in an uncommon
directory could not be found anymore when installing packages via pip for
the last couple of builds. While the directory is obviously contained in PATH,
using `sudo -E` didn't help. So we now install the Python packages in the
user's home directory to avoid having to use sudo.

16 months agoVersion bump to 5.7.0dr8 5.7.0dr8
Andreas Steffen [Thu, 2 Aug 2018 05:30:05 +0000 (07:30 +0200)]
Version bump to 5.7.0dr8

16 months agoMerge branch 'swima-subscriptions'
Andreas Steffen [Thu, 2 Aug 2018 05:28:52 +0000 (07:28 +0200)]
Merge branch 'swima-subscriptions'

16 months agotnccs-20: Defer handshake retry when sending SRETRY batch
Andreas Steffen [Sat, 28 Jul 2018 12:57:49 +0000 (14:57 +0200)]
tnccs-20: Defer handshake retry when sending SRETRY batch

Set a retry_handshake flag on a TNC server when sending a SRETRY
batch and do the retry only after receiving the next CDATA batch
from the TNC client.

16 months agolibimcv: Reset of IMC state for new measurement cycle
Andreas Steffen [Tue, 31 Jul 2018 12:06:21 +0000 (14:06 +0200)]
libimcv: Reset of IMC state for new measurement cycle

16 months agolibimcv: Reset of IMV state for new measurement cycle
Andreas Steffen [Thu, 26 Jul 2018 15:24:32 +0000 (17:24 +0200)]
libimcv: Reset of IMV state for new measurement cycle

16 months agoimv-swima: Support subscriptions
Andreas Steffen [Wed, 25 Jul 2018 06:41:05 +0000 (08:41 +0200)]
imv-swima: Support subscriptions

16 months agoimc-swima: Support subscriptions
Andreas Steffen [Tue, 24 Jul 2018 20:35:55 +0000 (22:35 +0200)]
imc-swima: Support subscriptions

16 months agolibimcv: Missing comma in pa_tnc_error_code_names
Andreas Steffen [Tue, 24 Jul 2018 18:43:31 +0000 (20:43 +0200)]
libimcv: Missing comma in pa_tnc_error_code_names

16 months agoVersion bump to 5.7.0dr6 5.7.0dr6
Andreas Steffen [Sat, 21 Jul 2018 07:30:53 +0000 (09:30 +0200)]
Version bump to 5.7.0dr6

16 months agolibtpmss: Configure TCTI device options
Andreas Steffen [Thu, 19 Jul 2018 15:53:31 +0000 (17:53 +0200)]
libtpmss: Configure TCTI device options

16 months agoVersion bump to 5.7.0dr5 5.7.0dr5
Andreas Steffen [Thu, 19 Jul 2018 12:13:09 +0000 (14:13 +0200)]
Version bump to 5.7.0dr5

16 months agolibimcv: Added Debian 8.11 and Ubunut 18.04 to IMV database
Andreas Steffen [Thu, 19 Jul 2018 12:11:44 +0000 (14:11 +0200)]
libimcv: Added Debian 8.11 and Ubunut 18.04 to IMV database

16 months agolibtpmtss: Support of RSAPSS signature scheme
Andreas Steffen [Wed, 18 Jul 2018 20:55:27 +0000 (22:55 +0200)]
libtpmtss: Support of RSAPSS signature scheme

16 months agolibtpmtss: Support for TSS2 v2 libraries
Andreas Steffen [Tue, 17 Jul 2018 21:22:52 +0000 (23:22 +0200)]
libtpmtss: Support for TSS2 v2 libraries

17 months agotesting: Optionally build/install strongSwan only on a specific guest
Tobias Brunner [Wed, 11 Jul 2018 16:38:09 +0000 (18:38 +0200)]
testing: Optionally build/install strongSwan only on a specific guest

This may be used to test different strongSwan versions against each

17 months agoconf: Fix bench_time documentation
Tobias Brunner [Mon, 9 Jul 2018 16:10:07 +0000 (18:10 +0200)]
conf: Fix bench_time documentation

17 months agomessage: Report the size of the complete reassembled IKE message
Tobias Brunner [Thu, 5 Jul 2018 15:36:21 +0000 (17:36 +0200)]
message: Report the size of the complete reassembled IKE message

This way we see the same size on both ends, namely that of the complete
IKE message as if it was sent in a single packet (excluding UDP/IP headers).

17 months agoencrypted-payload: Change how the length for reassembled messages is calculated
Tobias Brunner [Thu, 5 Jul 2018 15:21:47 +0000 (17:21 +0200)]
encrypted-payload: Change how the length for reassembled messages is calculated

If we have an AEAD transform we add the overhead as if the data would have
been transported in a single encrypted payload.

17 months agoencrypted-payload: Add getter for the used AEAD transform
Tobias Brunner [Thu, 5 Jul 2018 15:20:52 +0000 (17:20 +0200)]
encrypted-payload: Add getter for the used AEAD transform

17 months agotesting: Fix checks after changing fragmentation log messages
Tobias Brunner [Thu, 5 Jul 2018 15:19:39 +0000 (17:19 +0200)]
testing: Fix checks after changing fragmentation log messages

17 months agocharon-nm: Parse any type of private key in need_secrets
SC Lee [Mon, 9 Jul 2018 09:54:25 +0000 (17:54 +0800)]
charon-nm: Parse any type of private key in need_secrets

Previously, when the user supplied an ECDSA key for public key authentication,
the user was always asked to provide a password, even if the key was not

Related: 954f73ea6e7e ("charon-nm: Parse any type of private key not only RSA")
Closes strongswan/strongswan#108.

17 months agokernel-pfkey: Add support for native ChaCha20/Poly1305 on macOS
Tobias Brunner [Fri, 6 Jul 2018 08:17:52 +0000 (10:17 +0200)]
kernel-pfkey: Add support for native ChaCha20/Poly1305 on macOS

17 months agokernel-pfkey: Enable macOS native AES_GCM_ICV16 support
Ruben Tytgat [Thu, 5 Jul 2018 15:54:42 +0000 (17:54 +0200)]
kernel-pfkey: Enable macOS native AES_GCM_ICV16 support

macOS supports AES_GCM_ICV16 natively using PF_KEYv2.

This change enables AES_GCM if the corresponding definition is detected
in the headers.

With this change it is no longer necessary to use the libipsec module to
use AES_GCM on macOS.

Closes strongswan/strongswan#107.

17 months agotesting: The dhcp plugin uses the DHCP client port again by default
Tobias Brunner [Thu, 5 Jul 2018 16:12:40 +0000 (18:12 +0200)]
testing: The dhcp plugin uses the DHCP client port again by default

This reverts parts of commit becf027cd9b0af162247015a9fff6c00e59fd6ce.

Fixes: 707b70725a7d ("dhcp: Only use DHCP server port if explicitly configured")

17 months agoandroid: New release after fixing EAP-PEAP issue and Autofill crash
Tobias Brunner [Wed, 4 Jul 2018 09:51:44 +0000 (11:51 +0200)]
android: New release after fixing EAP-PEAP issue and Autofill crash

17 months agoRevert "android: Enable the eap-ttls and eap-peap plugins"
Tobias Brunner [Wed, 4 Jul 2018 17:35:55 +0000 (19:35 +0200)]
Revert "android: Enable the eap-ttls and eap-peap plugins"

This reverts commit 064c97afaeabc341f98577eae67073641b1591db.

We have to make this optional and more configurable.  It seems some
commercial VPN providers use self-signed certificates for their AAA

17 months agoandroid: Move hint from TextInputEditText to TextInputLayout
Tobias Brunner [Wed, 4 Jul 2018 09:43:40 +0000 (11:43 +0200)]
android: Move hint from TextInputEditText to TextInputLayout

This avoids a NullPointerException on Android 8 related to the optional
Autofill functionality.  The bug has been fixed in Android 8.1 [1] but there
is no fix for Android 8.


17 months agoandroid: Don't enforce the server address as AAA identity for EAP-PEAP/TTLS
Tobias Brunner [Wed, 4 Jul 2018 09:17:04 +0000 (11:17 +0200)]
android: Don't enforce the server address as AAA identity for EAP-PEAP/TTLS

This is similar to EAP-TLS.  We could probably make this configurable

17 months agoandroid: New release after fixing cancelling connecting on older systems
Tobias Brunner [Tue, 3 Jul 2018 13:43:32 +0000 (15:43 +0200)]
android: New release after fixing cancelling connecting on older systems

17 months agoandroid: Poll dropper TUN device for data on older Android systems
Tobias Brunner [Tue, 3 Jul 2018 13:03:51 +0000 (15:03 +0200)]
android: Poll dropper TUN device for data on older Android systems

It seems that even the NIO version of read() is uninterruptible on
platforms < Android 7 (24).

17 months agoMerge branch 'android-updates'
Tobias Brunner [Tue, 3 Jul 2018 10:15:52 +0000 (12:15 +0200)]
Merge branch 'android-updates'

Lots of new features, e.g. Quick Settings tile, Always-on VPN, error
recovery, and lots of improvements under the hood.

17 months agoandroid: New version after adding lots of new features
Tobias Brunner [Thu, 21 Jun 2018 17:06:49 +0000 (19:06 +0200)]
android: New version after adding lots of new features

17 months agoandroid: Use ListView for log messages
Tobias Brunner [Mon, 2 Jul 2018 16:05:13 +0000 (18:05 +0200)]
android: Use ListView for log messages

This is hopefully a bit more efficient for large log files than the previous
single TextView.  The ListView widget also provides an auto-scroll mechanism.

17 months agoandroid: Simplify error handling in VPN state fragment
Tobias Brunner [Fri, 29 Jun 2018 14:42:18 +0000 (16:42 +0200)]
android: Simplify error handling in VPN state fragment

Always reset the error state when disconnecting via state service. This
way the error state is also cleared when the connection is terminated
directly via control activity.

17 months agoandroid: Remove MIME type filter when importing trusted certificates
Tobias Brunner [Fri, 29 Jun 2018 14:04:10 +0000 (16:04 +0200)]
android: Remove MIME type filter when importing trusted certificates

This way we should see files even if the MIME type has not been set
correctly while downloading it.

17 months agoandroid: Show date/thread prefix in log view if we have enough space
Tobias Brunner [Fri, 29 Jun 2018 10:50:31 +0000 (12:50 +0200)]
android: Show date/thread prefix in log view if we have enough space

This is the case for tablets or even phones in landscape orientation.
600dp is the breaking point for small tablets according to Google's

17 months agoandroid: Change log message when initializing the native code and add a divider
Tobias Brunner [Fri, 29 Jun 2018 10:07:17 +0000 (12:07 +0200)]
android: Change log message when initializing the native code and add a divider

We don't really start a daemon and the divider should make it easier to
identify retries.

17 months agoandroid: Don't use infinite keying tries on Android 5+
Tobias Brunner [Fri, 29 Jun 2018 09:41:41 +0000 (11:41 +0200)]
android: Don't use infinite keying tries on Android 5+

This way we get some feedback about the issue in the GUI (otherwise it
would just switch to connecting state) and also some delays between retries.

17 months agoandroid: Allow explicit termination of a profile without confirmation
Tobias Brunner [Mon, 25 Jun 2018 09:02:08 +0000 (11:02 +0200)]
android: Allow explicit termination of a profile without confirmation

17 months agoandroid: Handle restarts of the control Activity better
Tobias Brunner [Fri, 22 Jun 2018 11:57:51 +0000 (13:57 +0200)]
android: Handle restarts of the control Activity better

For instance, rotating a device will restart it and this previously
could have started the wrong profile or shown the system's VPN
confirmation dialog twice.

17 months agoandroid: Properly handle pressing home when VPN confirmation dialog is shown
Tobias Brunner [Fri, 22 Jun 2018 09:22:23 +0000 (11:22 +0200)]
android: Properly handle pressing home when VPN confirmation dialog is shown

As documented, onActivityResult() is called right before onResume() when
the activity is reactivated.  However, if the system's VPN confirmation
dialog is shown and the home button is pressed, the activity is stopped
and not just paused, so its state is saved.  And onActivityResult() is
actually also called before onStart().  This means that no fragment
transactions may be committed (i.e. no dialog may be shown) when the
activity is later restarted (e.g. because there is another attempt to
connect the VPN) until onStart() has been called.  So if we'd try to show
the error dialog in onActivityResult() after returning to the launcher
it would result in an IllegalStateException.

However, showing the dialog for the previous confirmation dialog is not
ideal anyway, so we just ignore that result.

17 months agoandroid: Crudely catch exception if no file browser is available
Tobias Brunner [Thu, 21 Jun 2018 17:05:33 +0000 (19:05 +0200)]
android: Crudely catch exception if no file browser is available

Seen on Android TV in the emulator.

17 months agoandroid: Enable the eap-ttls and eap-peap plugins
Tobias Brunner [Thu, 21 Jun 2018 16:35:37 +0000 (18:35 +0200)]
android: Enable the eap-ttls and eap-peap plugins

17 months agoandroid: Pass UUID to VPN service to initiate profiles
Tobias Brunner [Thu, 21 Jun 2018 14:46:13 +0000 (16:46 +0200)]
android: Pass UUID to VPN service to initiate profiles

17 months agoandroid: Remove Suite B ESP proposals and reorder some algorithms
Tobias Brunner [Thu, 21 Jun 2018 12:49:22 +0000 (14:49 +0200)]
android: Remove Suite B ESP proposals and reorder some algorithms

17 months agoandroid: Make RSA/PSS flag configurable in the GUI
Tobias Brunner [Thu, 21 Jun 2018 10:51:51 +0000 (12:51 +0200)]
android: Make RSA/PSS flag configurable in the GUI

17 months agoandroid: Import RSA/PSS flag
Tobias Brunner [Thu, 21 Jun 2018 10:25:28 +0000 (12:25 +0200)]
android: Import RSA/PSS flag

17 months agoandroid: Add flag to enable RSA/PSS
Tobias Brunner [Thu, 21 Jun 2018 10:09:47 +0000 (12:09 +0200)]
android: Add flag to enable RSA/PSS

17 months agoandroid: Make fetching OCSP/CRL interruptible
Tobias Brunner [Thu, 21 Jun 2018 09:17:22 +0000 (11:17 +0200)]
android: Make fetching OCSP/CRL interruptible

This allows cancelling connecting if e.g. the OCSP server is not
reachable. Previously this caused some delay in disconnecting state but
even worse it cause an ANR if the user tried reconnecting during that
time as the main thread would get struck in setNextProfile() (we could
probably find a better solution there too in the future).

17 months agoandroid: Make CRL/OCSP/strict flags configurable in the GUI
Tobias Brunner [Wed, 20 Jun 2018 15:37:44 +0000 (17:37 +0200)]
android: Make CRL/OCSP/strict flags configurable in the GUI

17 months agoandroid: Import CRL/OCSP/strict flags
Tobias Brunner [Wed, 20 Jun 2018 15:25:18 +0000 (17:25 +0200)]
android: Import CRL/OCSP/strict flags

17 months agoandroid: Fix import of certificate request flag
Tobias Brunner [Wed, 20 Jun 2018 15:23:08 +0000 (17:23 +0200)]
android: Fix import of certificate request flag

17 months agoandroid: Add flags to control CRL/OCSP fetching and strict revocation
Tobias Brunner [Wed, 20 Jun 2018 15:18:03 +0000 (17:18 +0200)]
android: Add flags to control CRL/OCSP fetching and strict revocation

17 months agorevocation: Support en-/disabling CRL/OCSP at runtime
Tobias Brunner [Thu, 21 Jun 2018 06:59:40 +0000 (08:59 +0200)]
revocation: Support en-/disabling CRL/OCSP at runtime

17 months agoandroid: Use activity when reconnecting without (or a possibly wrong) password
Tobias Brunner [Wed, 20 Jun 2018 10:25:09 +0000 (12:25 +0200)]
android: Use activity when reconnecting without (or a possibly wrong) password

17 months agoandroid: Use startForegroundService() to start VpnService
Tobias Brunner [Tue, 19 Jun 2018 15:31:51 +0000 (17:31 +0200)]
android: Use startForegroundService() to start VpnService

This gives us some time to call startForeground() so we don't get

17 months agoandroid: Install a blocking TUN device until the VPN is established
Tobias Brunner [Tue, 19 Jun 2018 15:14:17 +0000 (17:14 +0200)]
android: Install a blocking TUN device until the VPN is established

It's reinstalled when reconnecting (or during error recovery) and
eventually uninstalled after disconnecting.

Only on Android 5+, otherwise we'd block our fetcher (and Android 4.4 is
stupid in regards to overlapping TUN devices anyway).

Note that Android 8's blocking feature blocks everything that passes by
the VPN, so this only works when tunneling everything (i.e. neither subnets,
nor apps can be excluded from the VPN if that feature is enabled).

17 months agoandroid: Exclude our own app from the VPN
Tobias Brunner [Tue, 19 Jun 2018 15:01:21 +0000 (17:01 +0200)]
android: Exclude our own app from the VPN

Otherwise, a blocking VPN interface would prevent our fetcher from working
as we currently rely on an interface that doesn't allow access to the
underlying socket/FD, which would be required to call VpnService.protect().

17 months agoandroid: Log retries to the same log file
Tobias Brunner [Tue, 19 Jun 2018 09:15:16 +0000 (11:15 +0200)]
android: Log retries to the same log file

It's cleared when a new connection is started or there is a manual

17 months agoandroid: Use capped exponential backoff for automatic retries
Tobias Brunner [Mon, 18 Jun 2018 17:04:03 +0000 (19:04 +0200)]
android: Use capped exponential backoff for automatic retries

17 months agoandroid: Show countdown and retry button in notification
Tobias Brunner [Mon, 18 Jun 2018 14:57:03 +0000 (16:57 +0200)]
android: Show countdown and retry button in notification

17 months agoandroid: Avoid IllegalStateException in state fragments
Tobias Brunner [Mon, 18 Jun 2018 14:45:37 +0000 (16:45 +0200)]
android: Avoid IllegalStateException in state fragments

This happened if the state service got connected while such a fragment was
not visible (anymore or at all).

17 months agoandroid: Don't hide the notification if we are connecting to a profile
Tobias Brunner [Mon, 18 Jun 2018 14:30:26 +0000 (16:30 +0200)]
android: Don't hide the notification if we are connecting to a profile

In particular, if we are reconnecting after an error.

17 months agoandroid: Add an automatic reconnect on errors
Tobias Brunner [Fri, 15 Jun 2018 12:40:01 +0000 (14:40 +0200)]
android: Add an automatic reconnect on errors

This way the connection will be attempted to be kept up even on "fatal"
errors like authentication failures.

17 months agoike-sa-manager: Fix races when changing initiator SPI of an IKE_SA
Tobias Brunner [Fri, 15 Jun 2018 10:34:15 +0000 (12:34 +0200)]
ike-sa-manager: Fix races when changing initiator SPI of an IKE_SA

Removing and readding the entry to a potentially different row/segment,
while driving out waiting and new threads, could prevent threads from
acquiring the SA even if they were waiting to check it out by unique
ID (which doesn't change), or if they were just trying to enumerate it.
With this change the row and segment doesn't change anymore and waiting
threads may acquire the SA. However, those looking for an IKE_SA by SPIs
might get one back that has a different SPI (but that's probably not
something that happens very often this early).

This was noticed because we check out SAs by unique ID in the Android
app to terminate them after failed retransmits if we are not reestablishing
the SA (otherwise we continue), and this sometimes failed.

Fixes: eaedcf8c0054 ("ike-sa-manager: Add method to change the initiator SPI of an IKE_SA")

17 months agoandroid: Show a retry button in the error banner
Tobias Brunner [Fri, 15 Jun 2018 09:00:08 +0000 (11:00 +0200)]
android: Show a retry button in the error banner

The button to view the log is now below the status info.  And since the
IMC results are just below that we don't need a special handling for
that anymore.

17 months agoandroid: Add function to quickly reconnect the current profile
Tobias Brunner [Fri, 15 Jun 2018 08:58:59 +0000 (10:58 +0200)]
android: Add function to quickly reconnect the current profile

17 months agoandroid: Use Java 8 features
Tobias Brunner [Thu, 14 Jun 2018 16:13:44 +0000 (18:13 +0200)]
android: Use Java 8 features

17 months agoandroid: Show an error if client certificate is unavailable
Tobias Brunner [Thu, 14 Jun 2018 13:20:57 +0000 (15:20 +0200)]
android: Show an error if client certificate is unavailable

This can happen on systems (e.g. Android 7.x) where Always-on VPNs are
triggered right after booting before the KeyChain is unlocked by the user.
Retrieving the certificate chain or private key then fails with
"KeyChainException: IllegalStateException: keystore is LOCKED" until the
user unlocks the screen once.

The built-in client actually also fails in this situation (e.g. with XAuth
RSA), it tries three times then stops and shows an error notification.

17 months agoandroid: Show an error if a profile without a password is initiated
Tobias Brunner [Thu, 14 Jun 2018 13:16:45 +0000 (15:16 +0200)]
android: Show an error if a profile without a password is initiated

This could happen if an incomplete profile is used with Always-on VPN.

17 months agoandroid: Use modern shortcuts on Android 8+
Tobias Brunner [Tue, 19 Jun 2018 10:32:55 +0000 (12:32 +0200)]
android: Use modern shortcuts on Android 8+

17 months agoandroid: Add an adaptive launcher icon
Tobias Brunner [Thu, 14 Jun 2018 12:02:22 +0000 (14:02 +0200)]
android: Add an adaptive launcher icon

Using <inset> in a mipmap folder apparently is not fully valid, at least
Android Studio complains about it (it seems to work fine, though).

17 months agoandroid: Show the actual error description in the notification
Tobias Brunner [Wed, 13 Jun 2018 14:31:41 +0000 (16:31 +0200)]
android: Show the actual error description in the notification

17 months agoandroid: Change format for error strings
Tobias Brunner [Wed, 13 Jun 2018 14:42:24 +0000 (16:42 +0200)]
android: Change format for error strings

Place the dot in the main message not the descriptions of the individual

17 months agoandroid: Collapse Quick Settings drawer if password entry is required
Tobias Brunner [Wed, 13 Jun 2018 14:07:28 +0000 (16:07 +0200)]
android: Collapse Quick Settings drawer if password entry is required

17 months agoandroid: Initiate configured default profile when triggered as Always-on VPN
Tobias Brunner [Tue, 12 Jun 2018 15:46:08 +0000 (17:46 +0200)]
android: Initiate configured default profile when triggered as Always-on VPN

With Android 8.1 this isn't triggered after a reboot until the device
has been unlocked once (solving the issue with the key store) and traffic
may optionally be blocked by the user until the VPN is established.

There are still some issues (e.g. password prompts and fatal errors), and we
might need some workaround for older Android releases.

17 months agoandroid: Just reconnect if the tile is clicked even if there was an error
Tobias Brunner [Tue, 12 Jun 2018 15:06:28 +0000 (17:06 +0200)]
android: Just reconnect if the tile is clicked even if there was an error

A long press click on the tile (or a click on the notification) will open
the main activity if more information about the error are necessary.

17 months agoandroid: Allow reconnecting without confirmation in case of an error
Tobias Brunner [Tue, 12 Jun 2018 15:05:00 +0000 (17:05 +0200)]
android: Allow reconnecting without confirmation in case of an error

17 months agoandroid: Show connection errors as banner, not as modal dialog
Tobias Brunner [Fri, 8 Jun 2018 13:41:46 +0000 (15:41 +0200)]
android: Show connection errors as banner, not as modal dialog

17 months agoandroid: Add Quick Settings tile to toggle VPN state
Tobias Brunner [Fri, 8 Jun 2018 12:22:52 +0000 (14:22 +0200)]
android: Add Quick Settings tile to toggle VPN state

Only if there is no currently active (or previously active) profile does
this currently operate on the configured (or stored most recently used)
profile.  This way it's possible to use a different connection and
quickly disable and re-enable it again.  When unlocked the profile name
is shown, when locked a generic text is used (this detection doesn't seem
to work 100% reliably).  To disconnect, the user is forced to unlock the
device, connecting is possible without, if the credentials are available
and no fatal error occurs (it even works with the system credential store,
at least on Android 8.1).

Note that the tile is not available right after a reboot.  It seems that
the system has to be unlocked once to activate third-party tiles (will
be interesting to see how this works together with Always-on VPN).

17 months agoandroid: Store the ID of the most recently used profile as preference
Tobias Brunner [Fri, 8 Jun 2018 11:54:46 +0000 (13:54 +0200)]
android: Store the ID of the most recently used profile as preference

17 months agoandroid: Add settings activity and default profile selection
Tobias Brunner [Fri, 8 Jun 2018 09:57:38 +0000 (11:57 +0200)]
android: Add settings activity and default profile selection

The default profile can then be used for a Quick Settings tile or the
Always-on VPN feature.

17 months agoandroid: Reset error state after user confirmed it
Tobias Brunner [Fri, 8 Jun 2018 09:23:05 +0000 (11:23 +0200)]
android: Reset error state after user confirmed it

This allows other listeners to change their display.

17 months agoandroid: Use specific icon when connecting to the VPN
Tobias Brunner [Fri, 8 Jun 2018 09:22:21 +0000 (11:22 +0200)]
android: Use specific icon when connecting to the VPN

17 months agoandroid: Use a handler to show/remove notification from main UI thread
Tobias Brunner [Fri, 8 Jun 2018 09:17:26 +0000 (11:17 +0200)]
android: Use a handler to show/remove notification from main UI thread

This avoids races that were previously seen (e.g. when disconnecting
while connecting, which sometimes showed a "Disconnecting..."

17 months agoandroid: Use separate activity to control VPN connections
Tobias Brunner [Thu, 7 Jun 2018 16:00:16 +0000 (18:00 +0200)]
android: Use separate activity to control VPN connections

This way we don't have to open the main window, but only show a dialog
if necessary (or nothing in many cases).

17 months agoandroid: Migrate onAttach() from deprecated version
Tobias Brunner [Thu, 7 Jun 2018 15:57:41 +0000 (17:57 +0200)]
android: Migrate onAttach() from deprecated version

17 months agoandroid: Make certificate import activity properly transparent
Tobias Brunner [Thu, 7 Jun 2018 15:12:56 +0000 (17:12 +0200)]
android: Make certificate import activity properly transparent

17 months agoandroid: Remove deprecated progress indicator in MainActivity
Tobias Brunner [Thu, 7 Jun 2018 12:44:22 +0000 (14:44 +0200)]
android: Remove deprecated progress indicator in MainActivity

Support for this was already removed with API level 21. On modern
devices loading CA certs should be quick enough anyway.

17 months agoandroid: Replace deprecated ProgressDialog during profile import
Tobias Brunner [Thu, 7 Jun 2018 12:42:40 +0000 (14:42 +0200)]
android: Replace deprecated ProgressDialog during profile import

17 months agoandroid: Add notification channel for API level 26+
Tobias Brunner [Wed, 6 Jun 2018 16:55:45 +0000 (18:55 +0200)]
android: Add notification channel for API level 26+

Unfortunately, setLockscreenVisibility() doesn't seem to have any
effect. So the full notification is shown unless the user manually
configures the notification settings.

17 months agoandroid: Set compile-/targetSdkVersion to 26
Tobias Brunner [Wed, 6 Jun 2018 14:57:31 +0000 (16:57 +0200)]
android: Set compile-/targetSdkVersion to 26

This allows us to add tiles to Quick Settings and enabling the Always-on
VPN feature in the VPN settings (both require API level 24, but 26 will
be required as targetSdkVersion later this year).

17 months agoandroid: Show profile ID at bottom of advanced settings
Tobias Brunner [Wed, 6 Jun 2018 14:38:26 +0000 (16:38 +0200)]
android: Show profile ID at bottom of advanced settings

Can be selected and copied to the clipboard to use in automation
software that doesn't support the shortcut.

17 months agoandroid: Accept a profile's UUID when initiating
Tobias Brunner [Wed, 6 Jun 2018 14:29:02 +0000 (16:29 +0200)]
android: Accept a profile's UUID when initiating

17 months agoandroid: Add additional Intent filter for import Activity with MIME type mask
Tobias Brunner [Wed, 6 Jun 2018 13:35:00 +0000 (15:35 +0200)]
android: Add additional Intent filter for import Activity with MIME type mask

Chrome creates such an Intent when opening downloaded files (not when
directly opening them), a MIME type is set, but apparently not ours.