strongswan.git
5 years agokernel-netlink: Add global option to configure MSS-clamping on installed routes
Tobias Brunner [Mon, 4 Aug 2014 13:57:46 +0000 (15:57 +0200)]
kernel-netlink: Add global option to configure MSS-clamping on installed routes

5 years agokernel-netlink: Add global option to set MTU on installed routes
Tobias Brunner [Mon, 4 Aug 2014 13:35:18 +0000 (15:35 +0200)]
kernel-netlink: Add global option to set MTU on installed routes

5 years agochunk: Fix Doxygen comments for chunk_internet_checksum[_inc]
Tobias Brunner [Thu, 11 Sep 2014 15:56:12 +0000 (17:56 +0200)]
chunk: Fix Doxygen comments for chunk_internet_checksum[_inc]

5 years agoauth-cfg: Fix crash after several reauthentications with multiple authentication...
Tobias Brunner [Thu, 11 Sep 2014 15:33:52 +0000 (17:33 +0200)]
auth-cfg: Fix crash after several reauthentications with multiple authentication rounds

Due to the issue described in c641974, purge() inadvertently destroyed
CA certificates that should have been kept (while the pointer to these
objects remained in the array).  This lead to incorrect reference counts
and after a few reauthentications with multiple authentication rounds,
which cause calls to purge(TRUE), to crashes.

5 years agoarray: Adjust negative index before calling remove_head|tail()
Tobias Brunner [Fri, 29 Aug 2014 08:18:07 +0000 (10:18 +0200)]
array: Adjust negative index before calling remove_head|tail()

For ARRAY_TAIL we most often want to call remove_tail() not remove_head().

5 years agoarray: Warn about caveat with array_remove_at() and value based arrays
Tobias Brunner [Thu, 11 Sep 2014 15:29:21 +0000 (17:29 +0200)]
array: Warn about caveat with array_remove_at() and value based arrays

Because enumerate() for value based arrays returns a pointer directly to
the internal array elements and because array_remove_at() or rather the
called array_remove() may move elements over the element at the currently
enumerated position, the pointer passed to enumerate() will point to a
different array element after the array_remove_at() call.  The caller
will thus operate on the wrong element if that pointer is accessed again
before calling enumerate().

For performance reasons we currently don't change the implementation to copy
each array element during enumeration to a private member of the enumerator and
return a pointer to that.  Similarly, due to the danger of subtle bugs we don't
remember the pointer passed to enumerate() to later redirect it to a copy
created during the array_remove_at() call.

5 years agoasn1: Try to fill the available binary OID buffer if possible
Tobias Brunner [Tue, 9 Sep 2014 09:46:38 +0000 (11:46 +0200)]
asn1: Try to fill the available binary OID buffer if possible

5 years agounit-tests: Give worker threads time to clean up when testing thread_t.detach()
Tobias Brunner [Wed, 25 Jun 2014 14:37:25 +0000 (16:37 +0200)]
unit-tests: Give worker threads time to clean up when testing thread_t.detach()

5 years agostream-service: Prevent race conditions due to blocking call to destroy()
Tobias Brunner [Mon, 21 Jul 2014 10:23:37 +0000 (12:23 +0200)]
stream-service: Prevent race conditions due to blocking call to destroy()

In the previous implementation queued jobs could prevent a service from
getting destroyed.  This could have lead to a deadlock when the
processor is cancelled.  Now destroy() still blocks, but waits only for
actually running tasks.  The service instance is reference counted so that
queued jobs can safely be destroyed.

5 years agostream-service: Do not accept or re-register when service is terminated
Tobias Brunner [Mon, 21 Jul 2014 09:35:34 +0000 (11:35 +0200)]
stream-service: Do not accept or re-register when service is terminated

5 years agostream-service: Restart accepting without blocking
Tobias Brunner [Mon, 21 Jul 2014 09:30:34 +0000 (11:30 +0200)]
stream-service: Restart accepting without blocking

Calling on_accept() sometimes lead to deadlocks when service->destroy()
was called concurrently.  That is, two threads waiting in on_accept() but
the last worker would only wake one due to the call to signal().  Calling
broadcast() wouldn't help either as that could lead to crashes if the thread
that called destroy() is woken first.

This is also more efficient as a constant pool of concurrent workers can
be maintained, otherwise peaks at the limit were followed by only a single
worker being active.

5 years agoandroid: Add support for querying use stats of a CHILD_SA
Tobias Brunner [Wed, 20 Aug 2014 09:39:28 +0000 (11:39 +0200)]
android: Add support for querying use stats of a CHILD_SA

5 years agoeap-radius: Forward Cisco and Microsoft specific DNS/NBNS attributes
Tobias Brunner [Tue, 19 Aug 2014 12:34:28 +0000 (14:34 +0200)]
eap-radius: Forward Cisco and Microsoft specific DNS/NBNS attributes

Fixes #677.

5 years agoikev1: Make sure proposed IPsec mode matches our own
Tobias Brunner [Tue, 12 Aug 2014 13:15:02 +0000 (15:15 +0200)]
ikev1: Make sure proposed IPsec mode matches our own

References #557.

5 years agoike: Reset IKE_SA in state CONNECTING instead of reauthenticating
Tobias Brunner [Tue, 12 Aug 2014 10:05:16 +0000 (12:05 +0200)]
ike: Reset IKE_SA in state CONNECTING instead of reauthenticating

Due to how reauthentication works for IKEv1 we could get a second
IKE_SA, which might cause problems, when connectivity problems arise
when the connection is initially established.

Fixes #670.

5 years agoasn1: Make sure not to exceed buffer for binary OID
Tobias Brunner [Mon, 4 Aug 2014 12:10:40 +0000 (14:10 +0200)]
asn1: Make sure not to exceed buffer for binary OID

5 years agokernel-pfroute: Delete interfaces on RTM_IFANNOUNCE/IFAN_DEPARTURE events
Tobias Brunner [Fri, 25 Jul 2014 16:07:08 +0000 (18:07 +0200)]
kernel-pfroute: Delete interfaces on RTM_IFANNOUNCE/IFAN_DEPARTURE events

We actually never deleted cached interfaces.  So if the kernel reuses
interface indices events for newly created interfaces could have been
associated with interface objects of deactivated and deleted interfaces.

Since we also didn't update the interface name when such an interface
got reactivated we ended up using the old name e.g. to install routes.

A trigger for this was the deletion and recreation of TUN devices during
reauthentication of SAs that use virtual IPs.

5 years agoip-packet: Define our own structs to handle TCP/UDP headers
Tobias Brunner [Thu, 24 Jul 2014 12:12:50 +0000 (14:12 +0200)]
ip-packet: Define our own structs to handle TCP/UDP headers

5 years agokernel-pfkey: Report packet counts of IPsec SAs
Tobias Brunner [Fri, 18 Jul 2014 16:19:46 +0000 (18:19 +0200)]
kernel-pfkey: Report packet counts of IPsec SAs

Seems that packet counts can be retrieved after all. At least the Linux
and FreeBSD kernels treat the number of allocations as number of packets.
We actually installed packet limits in that field already.

5 years agoswanctl: Document how connections.*.unique affects initiators
Tobias Brunner [Fri, 18 Jul 2014 14:05:47 +0000 (16:05 +0200)]
swanctl: Document how connections.*.unique affects initiators

5 years agomutex: Use atomics to set current thread in recursive mutex
Tobias Brunner [Thu, 17 Jul 2014 08:35:42 +0000 (10:35 +0200)]
mutex: Use atomics to set current thread in recursive mutex

Because this->thread is also read by threads that don't hold the
mutex the previous implementation was problematic (especially since
pthread_t is an opaque type of unknown length).

Fixes #654.

5 years agocurl: Log error code too
Tobias Brunner [Fri, 11 Jul 2014 13:40:15 +0000 (15:40 +0200)]
curl: Log error code too

It seems libcurl does not always return an error message.

5 years agounit-tests: Add option to exclude specific test suites
Tobias Brunner [Fri, 11 Jul 2014 08:51:31 +0000 (10:51 +0200)]
unit-tests: Add option to exclude specific test suites

Listing test suites in TESTS_SUITES_EXCLUDE allows excluding specific
test suites from running.

5 years agoopenssl: Report correct key length for EC keys when not using NIST curves
Tobias Brunner [Tue, 26 Aug 2014 16:26:33 +0000 (18:26 +0200)]
openssl: Report correct key length for EC keys when not using NIST curves

Fixes #688.

5 years agocredmgr: Fix copy and paste error in add_validator
Thomas Egerer [Thu, 28 Aug 2014 14:04:06 +0000 (16:04 +0200)]
credmgr: Fix copy and paste error in add_validator

This won't hurt as long as sets and validators are of the same class.
But as soon as one of the object's class is changed this will cause
either a compile error (best option), or result (most likely) in a
crash.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
5 years agoGenerated new test certificates
Andreas Steffen [Thu, 28 Aug 2014 19:34:40 +0000 (21:34 +0200)]
Generated new test certificates

5 years agoha: Don't adopt IKEv1 children when building without IKEv1 support
Martin Willi [Thu, 28 Aug 2014 08:16:51 +0000 (10:16 +0200)]
ha: Don't adopt IKEv1 children when building without IKEv1 support

The adopt_children_job_create() function is not available when IKEv1 support
is disabled. Fixes uncommon builds using --enable-ha --disable-ikev1.

Fixes #690.

5 years agotesting: Make sure the kernel exists when starting
Tobias Brunner [Mon, 25 Aug 2014 08:58:46 +0000 (10:58 +0200)]
testing: Make sure the kernel exists when starting

5 years agounity: Do not bump TS to 0.0.0.0/0 as initiator when no Split-Include received
Martin Willi [Mon, 4 Aug 2014 08:38:08 +0000 (10:38 +0200)]
unity: Do not bump TS to 0.0.0.0/0 as initiator when no Split-Include received

When having the unity plugin enabled and both peers send the Unity Vendor ID,
we proposed 0.0.0.0/0 as traffic selector, even if no Split-Include has been
received on the SA. This can break compatibility with some responders, as
they don't narrow the TS themselves, but expect the configured TS.

5 years agounity: Handle narrowing according to roles in the IKE_SA
Tobias Brunner [Thu, 17 Jul 2014 15:24:43 +0000 (17:24 +0200)]
unity: Handle narrowing according to roles in the IKE_SA

Since the narrow hook types reflect the roles in the Quick Mode exchange
the plugin behaved incorrectly if the server initiated the CHILD_SA
rekeying.

5 years agoMerge branch 'push-mode-reauth'
Martin Willi [Mon, 25 Aug 2014 07:57:05 +0000 (09:57 +0200)]
Merge branch 'push-mode-reauth'

Fixes IKEv1 re-authentication when using push mode by reassigning the same
IP lease to the client.

5 years agoikev1: Defer Mode Config push after CHILD adoption when using XAuth
Martin Willi [Mon, 7 Jul 2014 09:10:43 +0000 (11:10 +0200)]
ikev1: Defer Mode Config push after CHILD adoption when using XAuth

5 years agoikev1: Defer Mode Config push after CHILD adoption and reauth detection
Martin Willi [Mon, 7 Jul 2014 08:42:11 +0000 (10:42 +0200)]
ikev1: Defer Mode Config push after CHILD adoption and reauth detection

When an initiator starts reauthentication on a connection that uses push
mode to assign a virtual IP, we can't execute the Mode Config before releasing
the virtual IP. Otherwise we would request a new and different lease, which
the client probably can't handle. Defer Mode Config execution, so the same IP
gets first released then reassigned during reauthentication.

5 years agoikev1: Extend adopt_children_job by task queuing, executed after adoption
Martin Willi [Mon, 7 Jul 2014 08:36:35 +0000 (10:36 +0200)]
ikev1: Extend adopt_children_job by task queuing, executed after adoption

5 years agoikev1: Accept Quick Mode DELETES while Quick Mode rekeying is active
Martin Willi [Fri, 11 Jul 2014 09:59:01 +0000 (11:59 +0200)]
ikev1: Accept Quick Mode DELETES while Quick Mode rekeying is active

If a peer immediately sends DELETE messages when completing Quick Mode rekeying,
the third Quick Mode message and the DELETE are sent simultaneously. This
implies that DELETE messages may arrive before the completing third Quick Mode
message.

Handle this case by ignoring the DELETE INFORMATIONAL in Quick Mode and let
the delete task handle it.

5 years agoutils: Check if the parameter passed to countof() is actually an array type
Martin Willi [Fri, 4 Jul 2014 12:37:58 +0000 (14:37 +0200)]
utils: Check if the parameter passed to countof() is actually an array type

This should avoid errors such as the one fixed with 118b2879.

5 years agoutils: Add some initial build time assertion macros
Martin Willi [Fri, 4 Jul 2014 12:35:27 +0000 (14:35 +0200)]
utils: Add some initial build time assertion macros

These are useful to assert constants during build time. We evaluate the
expression to 0 when valid, so we can safely use the evaluated value.

5 years agostarter: Do not close all file descriptors after fork()
Martin Willi [Fri, 11 Jul 2014 12:40:56 +0000 (14:40 +0200)]
starter: Do not close all file descriptors after fork()

As we use libstrongswan and expect that it still works after the fork, we
can't just closefrom() all file descriptors. Watcher, for example, uses
a pipe to notify FDSET changes, which must be kept open.

Reverts 652ddf5ce2fad08f6569096dd56a821500cc5ba4.

5 years agoike-sa-manager: Use transient hasher for IKE_SA_INIT hash calculation
Christophe Gouault [Fri, 11 Jul 2014 11:40:25 +0000 (13:40 +0200)]
ike-sa-manager: Use transient hasher for IKE_SA_INIT hash calculation

To check if a received IKE_SA_INIT request is a new request or a
retransmit, charon maintains hashes of the pending IKE_SA_INIT
exchanges.

However, the hash calculation is not reentrant because a single hasher
is used for the whole IKE SA manager. It leads to bogus calculations
under high load and hence dropped messages on responder
(IkeInInvalidSpi incremented).

Don't share a single hasher in the IKE SA manager, create a transient
one whenever a message must be hashed.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
5 years agodiffie-hellman: Explicitly initialize DH exponent sizes during initialization
Martin Willi [Wed, 16 Jul 2014 14:44:24 +0000 (16:44 +0200)]
diffie-hellman: Explicitly initialize DH exponent sizes during initialization

To avoid any race conditions when multiple threads call and initialize
diffie_hellman_get_params(), explicitly examine the optimum DH exponent size
during library initialization.

Fixes #655.

5 years agokernel-pfroute: Fix kernel response handling
Tobias Brunner [Tue, 19 Aug 2014 09:08:33 +0000 (11:08 +0200)]
kernel-pfroute: Fix kernel response handling

The condvar is signaled for every handled message received from the
kernel not only for replies (this changed with 2a2d7a4dc8).  This may
cause segfaults because this->reply is not set when the waiting thread is
woken due to an IP address change.

Since this->reply is only set when it is actually the expected reply (and
only one request is sent at a time, thanks to c9a323c1d9) we only have
to make sure the reply is there (and clear it once we handled it).

Using separate condvars could also be an option in the future.

5 years agoconfigure: Add additional includes when checking for linux/fib_rules.h
Tobias Brunner [Mon, 11 Aug 2014 16:38:20 +0000 (18:38 +0200)]
configure: Add additional includes when checking for linux/fib_rules.h

This seems to be required on Cent OS 6.5.

5 years agostarter: Wait indefinitely for charon when using --attach-gdb
Martin Willi [Fri, 8 Aug 2014 08:28:58 +0000 (10:28 +0200)]
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.

5 years agostarter: Don't monitor child if debugger is attached
Thomas Egerer [Thu, 7 Aug 2014 16:05:46 +0000 (18:05 +0200)]
starter: Don't monitor child if debugger is attached

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
5 years agoAdded Debian 7.6 to IMV database
Andreas Steffen [Wed, 6 Aug 2014 06:04:42 +0000 (08:04 +0200)]
Added Debian 7.6 to IMV database

5 years agounused os_info_t object removed
Andreas Steffen [Wed, 6 Aug 2014 05:55:54 +0000 (07:55 +0200)]
unused os_info_t object removed

5 years agoUpdated build-database.sh to 3.13.0-32-generic Ubuntu kernel
Andreas Steffen [Wed, 6 Aug 2014 05:54:57 +0000 (07:54 +0200)]
Updated build-database.sh to 3.13.0-32-generic Ubuntu kernel

5 years agoimv-swid: Use pkg-config to check for libjson-c
Tobias Brunner [Wed, 30 Jul 2014 14:01:41 +0000 (16:01 +0200)]
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.

5 years agodns-proxy: Don't use proxy socket if we fail to bypass it
Tobias Brunner [Wed, 30 Jul 2014 07:48:08 +0000 (09:48 +0200)]
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.

5 years agoswanctl: Fix documentation of options for send_cert setting
Tobias Brunner [Mon, 28 Jul 2014 08:37:09 +0000 (10:37 +0200)]
swanctl: Fix documentation of options for send_cert setting

5 years agoandroid: New release after adding certificate import, DNS proxy and GUI changes
Tobias Brunner [Tue, 22 Jul 2014 09:34:09 +0000 (11:34 +0200)]
android: New release after adding certificate import, DNS proxy and GUI changes

5 years agoMerge branch 'android-dns-proxy'
Tobias Brunner [Tue, 22 Jul 2014 09:10:59 +0000 (11:10 +0200)]
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.

5 years agoandroid: For keyingtries > 0 notify the GUI if the limit is reached when reestablishing
Tobias Brunner [Thu, 17 Jul 2014 13:39:29 +0000 (15:39 +0200)]
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.

5 years agoandroid: Terminate IKE_SA if initial IKE_SA_INIT fails
Tobias Brunner [Thu, 17 Jul 2014 13:22:29 +0000 (15:22 +0200)]
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).

5 years agoandroid: Only allow DNS queries for the configured hostname
Tobias Brunner [Wed, 16 Jul 2014 14:20:00 +0000 (16:20 +0200)]
android: Only allow DNS queries for the configured hostname

5 years agoandroid: Add optional filter functionality to DNS proxy
Tobias Brunner [Wed, 16 Jul 2014 14:17:28 +0000 (16:17 +0200)]
android: Add optional filter functionality to DNS proxy

If specified only queries for a list of allowed host names will be
proxied.

5 years agoandroid: Recreate the TUN device without DNS when reestablishing IKE_SAs
Tobias Brunner [Wed, 16 Jul 2014 12:01:12 +0000 (14:01 +0200)]
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.

5 years agoandroid: Add method to BuilderAdapter to re-establish without DNS-related data
Tobias Brunner [Wed, 16 Jul 2014 11:54:57 +0000 (13:54 +0200)]
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).

5 years agoandroid: Use DNS proxy when reestablishing IKE_SAs
Tobias Brunner [Wed, 16 Jul 2014 11:11:10 +0000 (13:11 +0200)]
android: Use DNS proxy when reestablishing IKE_SAs

5 years agobus: Add ike_reestablish_pre hook, called before DNS resolution
Tobias Brunner [Wed, 16 Jul 2014 10:38:44 +0000 (12:38 +0200)]
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.

5 years agoandroid: Add DNS proxy implementation
Tobias Brunner [Tue, 15 Jul 2014 15:52:43 +0000 (17:52 +0200)]
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).

5 years agoip_packet: Add function to easily encode UDP packets
Tobias Brunner [Tue, 15 Jul 2014 15:32:25 +0000 (17:32 +0200)]
ip_packet: Add function to easily encode UDP packets

5 years agoip_packet: Apply transport protocol ports when encoding IP packet
Tobias Brunner [Tue, 15 Jul 2014 15:19:48 +0000 (17:19 +0200)]
ip_packet: Apply transport protocol ports when encoding IP packet

5 years agoip_packet: Add getter for IP payload
Tobias Brunner [Tue, 15 Jul 2014 11:51:49 +0000 (13:51 +0200)]
ip_packet: Add getter for IP payload

5 years agoip_packet: Allow creation of IP packets from data
Tobias Brunner [Tue, 15 Jul 2014 16:02:06 +0000 (18:02 +0200)]
ip_packet: Allow creation of IP packets from data

5 years agochunk: Add function to calculate Internet Checksums according to RFC 1071
Tobias Brunner [Tue, 15 Jul 2014 11:14:46 +0000 (13:14 +0200)]
chunk: Add function to calculate Internet Checksums according to RFC 1071

5 years agoip_packet: Parse ports from TCP and UDP headers
Tobias Brunner [Mon, 14 Jul 2014 15:33:17 +0000 (17:33 +0200)]
ip_packet: Parse ports from TCP and UDP headers

5 years agoMerge branch 'android-state-updates'
Tobias Brunner [Tue, 22 Jul 2014 08:57:57 +0000 (10:57 +0200)]
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.

5 years agoandroid: Delay disconnecting on errors until user dismisses them
Tobias Brunner [Mon, 14 Jul 2014 13:43:06 +0000 (15:43 +0200)]
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.

5 years agoandroid: Set CHILD_STATE_DOWN when the IKE_SA gets reestablished
Tobias Brunner [Mon, 14 Jul 2014 13:10:49 +0000 (15:10 +0200)]
android: Set CHILD_STATE_DOWN when the IKE_SA gets reestablished

5 years agoandroid: Set CHILD_STATE_DOWN whenever the CHILD_SA goes down
Tobias Brunner [Mon, 14 Jul 2014 13:08:24 +0000 (15:08 +0200)]
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.

5 years agoandroid: Change to CONNECTING state if CHILD_SA goes down
Tobias Brunner [Mon, 14 Jul 2014 13:06:40 +0000 (15:06 +0200)]
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).

5 years agoMerge branch 'android-cert-import'
Tobias Brunner [Tue, 22 Jul 2014 08:51:32 +0000 (10:51 +0200)]
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.

5 years agoandroid: Do not use deprecated TwoLineListItem
Tobias Brunner [Mon, 14 Jul 2014 12:24:31 +0000 (14:24 +0200)]
android: Do not use deprecated TwoLineListItem

5 years agoandroid: Add support for ECDSA private keys
Tobias Brunner [Tue, 8 Jul 2014 11:56:54 +0000 (13:56 +0200)]
android: Add support for ECDSA private keys

With 4.4.4 these work fine now.

5 years agoandroid: Show a confirmation dialog before importing certificates
Tobias Brunner [Thu, 5 Jun 2014 17:06:34 +0000 (19:06 +0200)]
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.

5 years agoandroid: Use Storage Access Framework to import certificates
Tobias Brunner [Sat, 31 May 2014 14:49:01 +0000 (16:49 +0200)]
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.

5 years agoandroid: Add activity to import certificate files
Tobias Brunner [Fri, 30 May 2014 18:16:57 +0000 (20:16 +0200)]
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.

5 years agoandroid: Imported certificates may be clicked to delete them
Tobias Brunner [Fri, 30 May 2014 17:52:40 +0000 (19:52 +0200)]
android: Imported certificates may be clicked to delete them

5 years agoandroid: Reload CA certificates without AsyncTask
Tobias Brunner [Fri, 30 May 2014 16:44:08 +0000 (18:44 +0200)]
android: Reload CA certificates without AsyncTask

We already use loaders in the GUI that can handle this asynchronously.

5 years agoandroid: Change how CA certificate reloads are initiated
Tobias Brunner [Fri, 30 May 2014 16:21:11 +0000 (18:21 +0200)]
android: Change how CA certificate reloads are initiated

5 years agoandroid: Add option to reload CA certificates to TrustedCertificatesActivity
Tobias Brunner [Fri, 30 May 2014 15:50:46 +0000 (17:50 +0200)]
android: Add option to reload CA certificates to TrustedCertificatesActivity

5 years agoandroid: Replace option to reload CA certificates with CA certificate view
Tobias Brunner [Fri, 30 May 2014 15:46:15 +0000 (17:46 +0200)]
android: Replace option to reload CA certificates with CA certificate view

The reload option will be added there.

5 years agoandroid: Only close TrustedCertificatesActivity on click when selecting a certificate
Tobias Brunner [Fri, 30 May 2014 15:40:24 +0000 (17:40 +0200)]
android: Only close TrustedCertificatesActivity on click when selecting a certificate

5 years agoandroid: Set action when using TrustedCertificatesActivity to select a certificate
Tobias Brunner [Fri, 30 May 2014 15:34:49 +0000 (17:34 +0200)]
android: Set action when using TrustedCertificatesActivity to select a certificate

5 years agoandroid: Allow selection of local certificates
Tobias Brunner [Fri, 30 May 2014 14:15:25 +0000 (16:15 +0200)]
android: Allow selection of local certificates

5 years agoandroid: Change how CA certificates from different sources are accessed
Tobias Brunner [Wed, 11 Jun 2014 12:48:08 +0000 (14:48 +0200)]
android: Change how CA certificates from different sources are accessed

5 years agoandroid: Cache certificates from multiple KeyStores
Tobias Brunner [Fri, 30 May 2014 13:13:50 +0000 (15:13 +0200)]
android: Cache certificates from multiple KeyStores

Including the new local one.

5 years agoandroid: Register local certificate store provider when the app is initialized
Tobias Brunner [Fri, 30 May 2014 11:45:31 +0000 (13:45 +0200)]
android: Register local certificate store provider when the app is initialized

5 years agoandroid: Add Provider for the local certificate store
Tobias Brunner [Fri, 30 May 2014 11:45:02 +0000 (13:45 +0200)]
android: Add Provider for the local certificate store

5 years agoandroid: Add KeyStoreSpi implementation that uses LocalCertificateStore
Tobias Brunner [Fri, 30 May 2014 11:30:35 +0000 (13:30 +0200)]
android: Add KeyStoreSpi implementation that uses LocalCertificateStore

5 years agoandroid: Add local certificate store
Tobias Brunner [Fri, 30 May 2014 11:28:16 +0000 (13:28 +0200)]
android: Add local certificate store

The class manages certificates stored in files within the app's
private data directory.

5 years agoandroid: Move TrustedCertificateEntry to a new package
Tobias Brunner [Fri, 30 May 2014 10:40:53 +0000 (12:40 +0200)]
android: Move TrustedCertificateEntry to a new package

5 years agoandroid: Subclass Application to provide static access to the application context
Tobias Brunner [Fri, 30 May 2014 10:35:54 +0000 (12:35 +0200)]
android: Subclass Application to provide static access to the application context

5 years agoandroid: Target latest SDK version
Tobias Brunner [Fri, 30 May 2014 10:34:46 +0000 (12:34 +0200)]
android: Target latest SDK version

5 years agoandroid: Add utility method to convert a byte array to a hex string
Tobias Brunner [Fri, 30 May 2014 09:08:35 +0000 (11:08 +0200)]
android: Add utility method to convert a byte array to a hex string

5 years agoandroid: Remove unused hash argument from getTrustedCertificates()
Tobias Brunner [Fri, 30 May 2014 09:22:19 +0000 (11:22 +0200)]
android: Remove unused hash argument from getTrustedCertificates()

5 years agoandroid: Use correct tag to define category for CREATE_SHORTCUT intent-filter
Tobias Brunner [Fri, 30 May 2014 09:03:25 +0000 (11:03 +0200)]
android: Use correct tag to define category for CREATE_SHORTCUT intent-filter

5 years agostarter: Fix memory leaks and warn if conn/ca sections are ignored due to parse errors
Tobias Brunner [Fri, 18 Jul 2014 15:12:09 +0000 (17:12 +0200)]
starter: Fix memory leaks and warn if conn/ca sections are ignored due to parse errors

5 years agoreceiver: Send a single INVALID_MAJOR_VERSION notify for IKE version > 2
Martin Willi [Thu, 17 Jul 2014 07:32:22 +0000 (09:32 +0200)]
receiver: Send a single INVALID_MAJOR_VERSION notify for IKE version > 2

We sent both a notify using IKEv1 and IKEv2. This is a little more aggressive
than required, RFC 5996 says we "SHOULD send an unauthenticated Notify
message of type INVALID_MAJOR_VERSION containing the highest (closest) version
number it supports".

Fixes #657.