Commit Graph

277 Commits

Author SHA1 Message Date
Tobias Brunner 61098dd6a3 android: Move Simplified Chinese translation to values-zg-rCN folder 2017-06-30 09:32:26 +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 95a63bf281 Migrate all enumerators to venumerate() interface change 2017-05-26 13:56:44 +02:00
Tobias Brunner 94375d46dc android: Send network change events from a separate thread via JNI
Doing this from the main UI thread (which delivers the broadcast) might
cause an ANR if there is a delay (e.g. while acquiring a mutex in the
native parts). There might also have been a race condition during
termination previously because Unregister() was not synchronized so there
might have been dangling events that got delivered while or after the mutex
in the native parts was destroyed.
2017-02-17 13:07:30 +01:00
Tobias Brunner ad882e1a43 android: Add translation for Simplified Chinese
Courtesy of Yick Xie.
2017-02-07 15:59:07 +01:00
Tobias Brunner 9665686bd8 daemon: Use separate method to set default loggers
This way it is not necessary to pass the same values to reload the
loggers.
2017-01-25 14:58:09 +01:00
Tobias Brunner 66bf2b788c android: Handle profile file names with dots in them 2017-01-20 11:44:17 +01:00
Tobias Brunner 9c79af8c38 android: Handle errors when fetching profile in more detail 2017-01-20 11:44:16 +01:00
Tobias Brunner 3107634e30 android: Add activity to import VPN profiles from JSON-encoded files
The file format is documented on the wiki.

URLs to .sswan files may be intercepted and downloaded files with a media
type of application/vnd.strongswan.profile may also be opened (the file
extension doesn't matter in that case).  Whether downloaded files for which
the media type is not correct but the extension is .sswan can be opened
depends on the app that issues the Intent.  For instance, from the default
Downloads app it won't work due to the content:// URLs that do not contain
the file name but when opening the downloaded file from within Chrome's
Downloads view it works as these Intents use file:// URLs, which contain
the complete file name (the latter requires a new permission).
2017-01-20 11:44:07 +01:00
Tobias Brunner cf6110f152 android: Use a local broadcast to notify about profile changes
This allows other components to modify the profiles and notify about
changes.
2017-01-20 11:01:32 +01:00
Tobias Brunner c4ab9af74e android: Add a UUID property to the VPN profiles
All new or edited profiles get a random UUID.  We currently don't
enforce one, though.  Later we might change that and use the UUID as
primary key.
2017-01-20 11:01:32 +01:00
Tobias Brunner 9920824e70 android: Make sure libtpmtss is loaded on older systems
On newer Android systems this seems to happen automatically (or does at
least not cause crashes if the library is not loaded).
2016-12-09 11:16:42 +01:00
Tobias Brunner 3e85b5a492 android: Ensure that the certificates are loaded when accessing them via JNI 2016-12-08 17:14:49 +01:00
Tobias Brunner 85059424a7 android: Add a public notification 2016-12-08 17:14:49 +01:00
Tobias Brunner d5070425a0 android: Display a permanent notification while connected
This forces the service to run in the foreground, meaning the system
won't kill it when low on memory.
2016-12-08 17:14:49 +01:00
Tobias Brunner e03c936982 android: Log any installed DNS servers 2016-12-08 17:14:49 +01:00
Tobias Brunner d6d12bab14 android: Unregister listener in case of error alerts
This avoids triggering additional errors via e.g. ike_updown() that
might cause the error message displayed in the GUI to change if the
status fragment is recreated.

References #2134.
2016-12-08 17:13:16 +01:00
Tobias Brunner ef2ad9db1c android: Report an error for invalid integer values
Previously we'd just ignore the invalid values without notifying the
user.
2016-12-08 16:43:51 +01:00
Tobias Brunner cefbf2bf9b android: Propose curve25519 in the ESP proposals 2016-12-08 16:43:51 +01:00
Tobias Brunner fec47b6146 android: Enable curve25519 plugin in the app 2016-12-08 16:43:51 +01:00
Tobias Brunner 5f0913fc1e android: Propose ChaCha20/Poly1305 in the ESP AEAD proposals 2016-12-08 16:43:50 +01:00
Tobias Brunner 8c0b38e9df android: Enable chapoly plugin in the app 2016-12-08 16:43:50 +01:00
Tobias Brunner 8b35d5f162 android: Identifiers for SHA2-base RSA signature schemes got renamed
Fixes: 40f2589abf ("gmp: Support of SHA-3 RSA signatures")
2016-10-11 15:29:14 +02:00
Tobias Brunner 6b726b6fb2 android: Fix build after adding libtpmtss 2016-06-28 11:28:15 +02:00
Tobias Brunner 6294f28bd3 android: Catch exception if numbers are too large for Integer 2016-06-13 16:12:17 +02:00
Tobias Brunner 25b69260fe android: Fix signature of get_nexthop() 2016-06-13 10:18:45 +02:00
Tobias Brunner 1130dbc408 android: Avoid IllegalStateException when importing certificates
When certificates are imported via Storage Access Framework we did handle
the selection directly in onActivityResult().  However, at that point the
activity might apparently not yet be resumed.  So committing
FragmentTransactions could result in IllegalStateExceptions due to the
potential state loss.  To avoid that we cache the returned URI and wait
until onPostResume() to make sure the activity's state is fully restored
before showing the confirmation dialog.
2016-05-06 12:51:49 +02:00
Tobias Brunner 2b9bfb6682 android: Use separate label strings for text fields in login dialog
In the profile editor the password is now marked as optional in the
label, which looks a bit strange in the login dialog.
2016-05-03 10:43:27 +02:00
Tobias Brunner e69781b1a2 android: Show selected user identity in profile list
This also readds the colons that were removed from the labels.
2016-05-02 18:39:19 +02:00
Tobias Brunner 67fa05aa59 android: Allow selection of user identity in GUI 2016-05-02 18:39:18 +02:00
Tobias Brunner cdcf754f64 android: Add adapter for user ID selection 2016-05-02 18:39:18 +02:00
Tobias Brunner eb507a5a0d android: Add helper function to TrustedCertificateEntry to get subjectAltNames
Duplicates (e.g. with different types) are filtered.  If necessary we
could later perhaps add a prefix.
2016-05-02 18:39:18 +02:00
Tobias Brunner e7a12cc862 android: Add auto-completion to remote ID and profile name
This makes it easy to explicitly use the server's IP/hostname as remote
identity or use it in the profile name.
2016-05-02 18:39:18 +02:00
Tobias Brunner c5fee22305 android: Make remote identity configurable in the GUI 2016-05-02 18:39:18 +02:00
Tobias Brunner be05310e7a android: Use TextInputLayout in login dialog 2016-05-02 18:39:18 +02:00
Tobias Brunner ea15f20a56 android: Use TextInputLayoutHelper in profile editor
This adds floating labels and helper texts to the form fields. It also
changed/added lots of strings in the editor.
2016-05-02 18:39:17 +02:00
Tobias Brunner 79ba4b285f android: Add TextInputLayout child class that displays a helper text below the text field
Also hides the error message if the text is changed.
2016-05-02 18:39:17 +02:00
Tobias Brunner 5ffd79b39b android: Use proper namespace for custom attribute 2016-05-02 18:39:17 +02:00
Tobias Brunner fd23ed8cf3 android: Move profile name field to the bottom and use server address as hint 2016-05-02 18:39:17 +02:00
Tobias Brunner 4a58ec24fd android: Use configured local identity in auth-cfgs
We still default to the username or subject DN if none is configured.
But we don't check if the local ID is contained in the configured
certificate.
2016-05-02 18:39:17 +02:00
Tobias Brunner 8b3bf4a4f8 android: Use configured remote ID in auth-cfg
If one is explicitly set we don't use loose identity matching and send it as
IDr to the server.

Closes #strongswan/strongswan#29.
Fixes #1268.
2016-05-02 18:38:44 +02:00
Tobias Brunner 9c55644158 android: Pass local and remote identities as settings of a connection 2016-05-02 18:38:15 +02:00
Tobias Brunner 89149dbb5f android: Add fields for local and remote identities to data model 2016-05-02 18:38:15 +02:00
Tobias Brunner 7ab8ec7ad0 android: Avoid races between FragmentManager and state saving
onSaveInstanceState is apparently called after pausing the fragment and after
that committing any FragmentTransactions causes an IllegalStateException.
We could use commitAllowingStateLoss() but that's not really necessary
as we don't need to update when we are not active anyway.  We also don't
update the view directly after registration as this happens
asynchronously, i.e. we might be paused when it finishes.
2016-05-02 18:38:15 +02:00
Tobias Brunner 73a6bec3fc android: Increase the NAT-T keepalive interval to potentially save battery life
In case this doesn't work out we could probably make it configurable.

References #1326.
2016-05-02 18:38:08 +02:00
Tobias Brunner 44c8580ebe android: Show confirmation dialog also when connecting 2016-05-02 18:35:04 +02:00
Tobias Brunner 6e398a81f2 android: Avoid ProgressDialogs in VPN state fragment
Instead we use a ProgressBar directly in the fragment and use the
existing button to cancel the process.
2016-05-02 16:43:15 +02:00
Tobias Brunner 353526601a android: Fix display of remediation instructions with support library
Because the support library creates its own layout manually and uses
different IDs than the list_content layout we can't use the method we
used previously (and which is actually recommended in the docs).
2016-05-02 16:41:50 +02:00
Tobias Brunner 7c5fec3a5a android: Use Fragment class from the support library to avoid deprecation warnings
For instance, onAttach() with an Activitiy as first argument was deprecated
with API level 23.  However, the overload with a Context as first argument
does obviously not get called on older API levels.  Luckily, the classes
provided by the support library handle that for us.
2016-05-02 16:41:50 +02:00
Tobias Brunner 1bd213db79 android: Use relative path for strongSwan sources
This avoids issues with recursion, which could have happened if the
strongswan directory was a symlink.
2016-05-02 16:41:49 +02:00
Tobias Brunner d9c5e6d786 android: Fix handling of redirects during IKE_AUTH 2016-05-02 16:41:25 +02:00
Tobias Brunner 90172b66c4 android: Fix color of lists and buttons on older platforms
This adds a workaround for an issue on older platforms where the list is
not properly styled with colorAccent.  Similarly applies to borderless buttons.
2016-04-27 14:24:27 +02:00
Tobias Brunner 2a68938b2e android: Use Activity as context for VpnProfileAdapter to fix theme
When using the application context theme customizations wouldn't get
applied for some reason.
2016-04-27 14:24:27 +02:00
Tobias Brunner 19e22af199 android: Use "server" instead of "gateway" in profile editor
The term "gateway" is unfamiliar for most new users (or they confuse it
with the default gateway of their network) but they usually know that
they want to connect to a "server".
2016-04-27 14:24:27 +02:00
Tobias Brunner 61ac729662 android: Define a new color scheme
This mainly changes the color of the appbar (colorPrimary), the color
of the status bar (colorPrimaryDark) is black like the default.
The accent color (colorAccent) used for controls like buttons and check
boxes is a slightly toned down version of the default.
2016-04-27 14:24:27 +02:00
Tobias Brunner 4c5f4a3d2a android: Replace use of deprecate getColor() method overload 2016-04-27 14:24:26 +02:00
Tobias Brunner 48123633cc android: Make font in log view monospace again on Android 5+ 2016-04-27 14:24:26 +02:00
Tobias Brunner de2fbd0e3f android: Avoid deprecated tabs in the ActionBar in TrustedCertificatesActivity
Instead we use TabLayout and ViewPager from the support libraries.
2016-04-27 14:24:26 +02:00
Tobias Brunner b9f79bc431 android: Automatically reload certificates if manager is reset
No need to manually reset the fragments anymore.
2016-04-27 14:24:26 +02:00
Tobias Brunner 01bade451f android: Make TrustedCertificateManager an Observable
Observers are notified when the manager is reset (and initially when the
certificates are first loaded).
2016-04-27 14:24:26 +02:00
Tobias Brunner 77c1c28d74 android: Switch to AppCompat/Material theme for dialogs
There is no AppCompatProgressDialog class as the use of ProgressDialog
is discouraged (instead progress bars should be placed in the layout directly).
To display the current ProgressDialog instances correctly on systems < 21 we
modify the window background color.
2016-04-27 14:24:25 +02:00
Tobias Brunner 6b31828269 android: Switch to AppCompat/Material theme and use custom Toolbar as AppBar
Also includes some whitespace/formatting changes due to the switch to
Android Studio.
2016-04-27 14:24:25 +02:00
Tobias Brunner cb65e95d4a android: OPENSSL_NO_ENGINE is now properly defined in the headers 2016-04-15 10:32:36 +02:00
Tobias Brunner 2ba5dadb12 peer-cfg: Use struct to pass data to constructor 2016-04-09 16:51:01 +02:00
Tobias Brunner 8a00a8452d child-cfg: Use struct to pass data to constructor 2016-04-09 16:51:01 +02:00
Tobias Brunner 89da06ace9 kernel: Use structs to pass information to the kernel-ipsec interface 2016-04-09 16:50:59 +02:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Tobias Brunner 2f3879c3fe android: Enable 64-bit ABIs 2016-03-23 14:18:52 +01:00
Tobias Brunner 17e36cd48c android: Enable build against API level 21
While building against this level in general would break our app on
older systems, the NDK will automatically use this level for 64-bit
ABI builds (which are not supported in older levels).  So to build
against 64-bit ABIs we have to support this API level.
2016-03-23 14:18:37 +01:00
Tobias Brunner 28649f6d91 libhydra: Remove empty unused library 2016-03-03 17:36:11 +01:00
Tobias Brunner 8394ea2a42 libhydra: Move kernel interface to libcharon
This moves hydra->kernel_interface to charon->kernel.
2016-03-03 17:36:11 +01:00
Tobias Brunner e8140531fc libipsec: Pass the same data to del_policy() as to add_policy()
We already do this for the other kernel interfaces.

Fixes e1e88d5add ("libipsec: Don't attempt deletion of any non-IPsec policies")
2016-02-04 11:02:59 +01:00
Tobias Brunner fe48e4ae31 android: Suppress compiler warnings about missing field initializers
Triggered by -Wextra for many INIT usages where we only partially
initialize a struct.
2015-11-13 18:24:45 +01:00
Tobias Brunner 3af7e09271 android: Add some (older) unit tests 2015-11-12 14:12:43 +01:00
Tobias Brunner 9e81f33b55 android: Properly handle shorter types in BufferedByteWriter
In Java all integer types are signed, when a negative integer is casted
to a larger type (e.g. int to long) then due to sign extension the upper
bytes are not 0.  So writing that value to a byte array does not produce
the expected result.  By overloading the putX() methods we make sure to
upcast the values correctly.
2015-11-12 14:12:13 +01:00
Tobias Brunner a50f3037ad android: Migrate to the Gradle build system
This uses a manual way to trigger the NDK build (the default with
on-the-fly Android.mk files does not work for us).
2015-11-12 14:11:37 +01:00