Commit Graph

13289 Commits

Author SHA1 Message Date
Tobias Brunner b04f40406d configure: Add additional includes when checking for linux/fib_rules.h
This seems to be required on Cent OS 6.5.
2014-08-11 18:40:18 +02:00
Martin Willi 508f90131a starter: Wait indefinitely for charon when using --attach-gdb
This makes sure the user has time to set break points etc. before it runs
charon under gdb.
2014-08-08 16:36:00 +02:00
Thomas Egerer f51c923f69 starter: Don't monitor child if debugger is attached
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2014-08-08 09:59:57 +02:00
Andreas Steffen eafe8795ca Added Debian 7.6 to IMV database 2014-08-06 08:04:42 +02:00
Andreas Steffen 78ec8c6085 unused os_info_t object removed 2014-08-06 07:55:54 +02:00
Andreas Steffen bc14124147 Updated build-database.sh to 3.13.0-32-generic Ubuntu kernel 2014-08-06 07:54:57 +02:00
Tobias Brunner fafed376e7 imv-swid: Use pkg-config to check for libjson-c
The package/library is called libjson-c on recent distributions.
Some like Ubuntu 14.04 provide symlinks with the old name but these
will eventually disappear.  Using pkg-config allows us to easily check
for it (with a fallback) and configure the proper compiler flags.

Fixes #663.
2014-07-30 16:57:00 +02:00
Tobias Brunner ffa9b67189 dns-proxy: Don't use proxy socket if we fail to bypass it
This will result in an infinite loop as packets sent over that socket
will again pass through the TUN device and the DNS proxy.

Apparently, bypassing fails when airplane mode is enabled.

Fixes #662.
2014-07-30 09:48:08 +02:00
Tobias Brunner d236db8701 swanctl: Fix documentation of options for send_cert setting 2014-07-28 10:38:34 +02:00
Tobias Brunner 8d31df9099 android: New release after adding certificate import, DNS proxy and GUI changes 2014-07-22 11:34:09 +02:00
Tobias Brunner 1ddc1ec0b3 Merge branch 'android-dns-proxy'
Adds a DNS proxy feature that uses VPN-protected sockets to resolve the
VPN gateway's hostname while reestablishing the IKE_SA, which is
required because we keep the TUN device up to avoid leaking plaintext
traffic.

The TUN device is recreated without DNS servers before reestablishing in
case the VPN server pushed DNS servers to the client that are only
reachable via VPN.

Fixes #622.
2014-07-22 11:14:00 +02:00
Tobias Brunner ffff7219ef android: For keyingtries > 0 notify the GUI if the limit is reached when reestablishing
The IKE_SA is destroyed anyway, so letting the GUI remain in
"connecting" state would be incorrect.

We still use keyingtries=0 for now, though. And we still abort after the
first failed attempt initially, in case there is a configuration error.
2014-07-22 11:10:36 +02:00
Tobias Brunner 5fd9e5fd00 android: Terminate IKE_SA if initial IKE_SA_INIT fails
Since VpnStateService.disconnect() is now not called until the error
dialog is dismissed the daemon would continue to try connecting.
So while the error dialog is shown the connection might actually be
successfully established in the background, which is not intended.

This way the IKE_SA is destroyed right after sending the IKE_SA_INIT of
the second connection attempt (due to keyingtries=0).
2014-07-22 11:10:36 +02:00
Tobias Brunner 945832c67d android: Only allow DNS queries for the configured hostname 2014-07-22 11:10:36 +02:00
Tobias Brunner e77f226a0f android: Add optional filter functionality to DNS proxy
If specified only queries for a list of allowed host names will be
proxied.
2014-07-22 11:10:36 +02:00
Tobias Brunner c66f5f844d android: Recreate the TUN device without DNS when reestablishing IKE_SAs
This enables DNS resolution while reestablishing if the VPN gateway pushed
DNS servers to the client that are only reachable via VPN.
2014-07-22 11:10:36 +02:00
Tobias Brunner 36aab70ab0 android: Add method to BuilderAdapter to re-establish without DNS-related data
Non-DNS data is cached in the BuilderAdapter so the TUN device can be
recreated easily (since the CHILD_SA is gone we couldn't actually gather
that information).
2014-07-22 11:10:36 +02:00
Tobias Brunner cc1712a8f4 android: Use DNS proxy when reestablishing IKE_SAs 2014-07-22 11:10:36 +02:00
Tobias Brunner 614359a7d5 bus: Add ike_reestablish_pre hook, called before DNS resolution
The old hook is renamed to ike_reestablish_post and is now also called
when the initiation of the new IKE_SA failed.
2014-07-22 11:10:36 +02:00
Tobias Brunner 2dc26c557e android: Add DNS proxy implementation
This class proxies DNS requests over VPN-protected UDP sockets.
It is not really Android specific and might be useful for
kernel-libipsec or libipsec in general too, so we could maybe move it later
to libipsec (might need some portability work).
2014-07-22 11:10:36 +02:00
Tobias Brunner 16e519d42c ip_packet: Add function to easily encode UDP packets 2014-07-22 11:10:35 +02:00
Tobias Brunner 108a67893f ip_packet: Apply transport protocol ports when encoding IP packet 2014-07-22 11:10:35 +02:00
Tobias Brunner 46bb36980b ip_packet: Add getter for IP payload 2014-07-22 11:10:35 +02:00
Tobias Brunner d56d9a45d4 ip_packet: Allow creation of IP packets from data 2014-07-22 11:10:35 +02:00
Tobias Brunner b557f4a7cd chunk: Add function to calculate Internet Checksums according to RFC 1071 2014-07-22 11:10:35 +02:00
Tobias Brunner a10eb93566 ip_packet: Parse ports from TCP and UDP headers 2014-07-22 11:10:35 +02:00
Tobias Brunner 32109a535f Merge branch 'android-state-updates'
The GUI reflects the state of the IKE daemon more closely by switching
back to the "connecting" state when the IKE_SA or CHILD_SA is down and
is getting reestablished.

Fixes #616.
2014-07-22 11:06:31 +02:00
Tobias Brunner 394be2d556 android: Delay disconnecting on errors until user dismisses them
If e.g. reauthentication fails we don't want to close the TUN device
until the user acknowledged the error and is thus aware of the failure.
2014-07-22 10:55:51 +02:00
Tobias Brunner 08d545e29a android: Set CHILD_STATE_DOWN when the IKE_SA gets reestablished 2014-07-22 10:55:51 +02:00
Tobias Brunner fb5d541503 android: Set CHILD_STATE_DOWN whenever the CHILD_SA goes down
No matter what triggers it.  We also don't close the TUN device, but we
might handle that differently in the future to allow reestablishing the
IKE_SA if host names have to be re-resolved via DNS.
2014-07-22 10:55:51 +02:00
Tobias Brunner 1435bd2e1b android: Change to CONNECTING state if CHILD_SA goes down
Unless we are disconnecting.  This currently triggers the connecting
dialog, perhaps just updating the status text would do too (when switching
from CONNECTED to CONNECTING, not from DISCONNECTED to CONNECTING).
2014-07-22 10:55:51 +02:00
Tobias Brunner 94124456f2 Merge branch 'android-cert-import'
Adds support to import CA and server certificate directly in the app.
On Android 4.4 and newer the SAF allows users to easily browse for such
files, on older systems they have to open them from file manager or the
download app (only works if the MIME type is correctly detected).

Also adds support for ECDSA keys on recent Android systems.
2014-07-22 10:51:32 +02:00
Tobias Brunner d4bf6bfb15 android: Do not use deprecated TwoLineListItem 2014-07-22 10:41:51 +02:00
Tobias Brunner 7073bfe4e9 android: Add support for ECDSA private keys
With 4.4.4 these work fine now.
2014-07-22 10:41:51 +02:00
Tobias Brunner 3dc92ff9cf android: Show a confirmation dialog before importing certificates
Since the import activity can be triggered by any other app on the
system we shouldn't just import every certificate we get.

Also, in some situations (e.g. if no passphrase has been set yet for the
system-wide certificate store) we are the only application that can open
certificate files.  So if a user clicked on a certificate file she would
just get a confirmation Toast about a successful import, with no indication
whatsoever where the certificate was actually imported.  The new dialog
shows the app icon to indicate that strongSwan is involved.
2014-07-22 10:41:51 +02:00
Tobias Brunner 1ed922c918 android: Use Storage Access Framework to import certificates
Thanks to the SAF, introduced with Android 4.4, browsing and opening
files on the system is very easy to implement.

On older systems the menu option is removed.
2014-07-22 10:41:51 +02:00
Tobias Brunner 94cc8f6a72 android: Add activity to import certificate files
Such files can e.g. be opened from the Download view, if they are
associated with one of the supported mime-types.
2014-07-22 10:41:50 +02:00
Tobias Brunner ac200bcda5 android: Imported certificates may be clicked to delete them 2014-07-22 10:41:50 +02:00
Tobias Brunner eb01649079 android: Reload CA certificates without AsyncTask
We already use loaders in the GUI that can handle this asynchronously.
2014-07-22 10:41:50 +02:00
Tobias Brunner 918200378d android: Change how CA certificate reloads are initiated 2014-07-22 10:41:50 +02:00
Tobias Brunner 08de6a08f0 android: Add option to reload CA certificates to TrustedCertificatesActivity 2014-07-22 10:41:50 +02:00
Tobias Brunner 2312985b2a android: Replace option to reload CA certificates with CA certificate view
The reload option will be added there.
2014-07-22 10:41:50 +02:00
Tobias Brunner 1353f08fbc android: Only close TrustedCertificatesActivity on click when selecting a certificate 2014-07-22 10:41:50 +02:00
Tobias Brunner 9c841b1f34 android: Set action when using TrustedCertificatesActivity to select a certificate 2014-07-22 10:41:50 +02:00
Tobias Brunner f21a69dbec android: Allow selection of local certificates 2014-07-22 10:41:49 +02:00
Tobias Brunner 3b2b536b70 android: Change how CA certificates from different sources are accessed 2014-07-22 10:41:49 +02:00
Tobias Brunner 8cdce00eb1 android: Cache certificates from multiple KeyStores
Including the new local one.
2014-07-22 10:41:49 +02:00
Tobias Brunner 8d3a058abc android: Register local certificate store provider when the app is initialized 2014-07-22 10:41:49 +02:00
Tobias Brunner 5eb4297046 android: Add Provider for the local certificate store 2014-07-22 10:41:49 +02:00
Tobias Brunner 544267889e android: Add KeyStoreSpi implementation that uses LocalCertificateStore 2014-07-22 10:41:49 +02:00