strongswan.git
8 years agoUse colors from the Android color palette for the VPN status texts
Tobias Brunner [Thu, 9 Aug 2012 13:01:19 +0000 (15:01 +0200)]
Use colors from the Android color palette for the VPN status texts

8 years agoLocalized title for contextual action bar
Tobias Brunner [Thu, 9 Aug 2012 10:26:48 +0000 (12:26 +0200)]
Localized title for contextual action bar

8 years agoGerman translation added
Tobias Brunner [Thu, 9 Aug 2012 09:53:55 +0000 (11:53 +0200)]
German translation added

8 years agoShow MainActiviy if the user clicks 'Configure' in Android's VPN dialog
Tobias Brunner [Thu, 9 Aug 2012 09:38:18 +0000 (11:38 +0200)]
Show MainActiviy if the user clicks 'Configure' in Android's VPN dialog

8 years agoKeep reporting the error until the user dismisses it
Tobias Brunner [Thu, 9 Aug 2012 09:35:24 +0000 (11:35 +0200)]
Keep reporting the error until the user dismisses it

Even when the Activity is closed and later reopened.

8 years agoShow an error dialog when errors occur while establishing the VPN
Tobias Brunner [Thu, 9 Aug 2012 09:33:22 +0000 (11:33 +0200)]
Show an error dialog when errors occur while establishing the VPN

8 years agoShow a button to disconnect the VPN once it is established
Tobias Brunner [Thu, 9 Aug 2012 09:27:34 +0000 (11:27 +0200)]
Show a button to disconnect the VPN once it is established

8 years agoShow current VPN state and profile name
Tobias Brunner [Thu, 9 Aug 2012 09:22:12 +0000 (11:22 +0200)]
Show current VPN state and profile name

Show modal dialogs while connecting and disconnecting the VPN.

8 years agoAdd a fragment to MainActivity which will display the current VPN state
Tobias Brunner [Thu, 9 Aug 2012 09:11:32 +0000 (11:11 +0200)]
Add a fragment to MainActivity which will display the current VPN state

The fragment is bound to the VpnStateService and registered as listener.

8 years agoUse a separate (volatile) variable for certificate alias
Tobias Brunner [Wed, 8 Aug 2012 17:10:33 +0000 (19:10 +0200)]
Use a separate (volatile) variable for certificate alias

If a connection is started while certificates are still loading and the
initiation is then canceled a deadlock could result if the daemon is
trying to enumerate the certificates just then.

8 years agoDon't set the source address on Android
Tobias Brunner [Wed, 8 Aug 2012 13:50:36 +0000 (15:50 +0200)]
Don't set the source address on Android

8 years agoClose IKE_SA on Android immediately if setting up CHILD_SA fails
Tobias Brunner [Wed, 8 Aug 2012 13:03:00 +0000 (15:03 +0200)]
Close IKE_SA on Android immediately if setting up CHILD_SA fails

8 years agoReduce number of retransmits on Android
Tobias Brunner [Wed, 8 Aug 2012 13:02:34 +0000 (15:02 +0200)]
Reduce number of retransmits on Android

8 years agoJob added which handles plain text packets read from TUN device
Tobias Brunner [Wed, 8 Aug 2012 12:54:44 +0000 (14:54 +0200)]
Job added which handles plain text packets read from TUN device

8 years agoAdded a handler that writes inbound plain text packets to the TUN device
Tobias Brunner [Wed, 8 Aug 2012 12:51:59 +0000 (14:51 +0200)]
Added a handler that writes inbound plain text packets to the TUN device

8 years agoAdd simple callbacks to receive/send ESP packets via libipsec/receiver.
Tobias Brunner [Wed, 8 Aug 2012 12:49:52 +0000 (14:49 +0200)]
Add simple callbacks to receive/send ESP packets via libipsec/receiver.

8 years agoAdd routes based on the installed IPsec policies to the TUN device builder
Tobias Brunner [Wed, 8 Aug 2012 12:47:47 +0000 (14:47 +0200)]
Add routes based on the installed IPsec policies to the TUN device builder

8 years agoAdd virtual IP to the TUN device builder
Tobias Brunner [Wed, 8 Aug 2012 12:46:22 +0000 (14:46 +0200)]
Add virtual IP to the TUN device builder

After the CHILD_SA is established we can easily get this address from
the IKE_SA.

8 years agoCreate a TUN device via VpnService.Builder once the CHILD_SA is established
Tobias Brunner [Wed, 8 Aug 2012 12:43:39 +0000 (14:43 +0200)]
Create a TUN device via VpnService.Builder once the CHILD_SA is established

8 years agoAn Android specific attribute handler installs DNS servers via Builder
Tobias Brunner [Wed, 8 Aug 2012 12:04:14 +0000 (14:04 +0200)]
An Android specific attribute handler installs DNS servers via Builder

8 years agoNative counterpart of VpnService.Builder added, exposed by charonservice
Tobias Brunner [Wed, 8 Aug 2012 11:48:54 +0000 (13:48 +0200)]
Native counterpart of VpnService.Builder added, exposed by charonservice

8 years agoAdapter class added around VpnService.Builder which allows to access it via JNI
Tobias Brunner [Wed, 8 Aug 2012 11:45:49 +0000 (13:45 +0200)]
Adapter class added around VpnService.Builder which allows to access it via JNI

8 years agoDon't print hosts as %any if %+H is used
Tobias Brunner [Wed, 8 Aug 2012 12:06:59 +0000 (14:06 +0200)]
Don't print hosts as %any if %+H is used

That is, the plus sign can be used in the format string to force a numeric
string representation of all host_t objects even 0.0.0.0 and :: which
would otherwise be printed as %any and %any6.

8 years agoAdd support for '+' in custom format specifiers
Tobias Brunner [Wed, 8 Aug 2012 12:05:58 +0000 (14:05 +0200)]
Add support for '+' in custom format specifiers

8 years agoInitiate an SA via native JNI method
Tobias Brunner [Wed, 8 Aug 2012 11:23:41 +0000 (13:23 +0200)]
Initiate an SA via native JNI method

8 years agoHelper function added that retrieves a local IP address
Tobias Brunner [Wed, 8 Aug 2012 11:20:34 +0000 (13:20 +0200)]
Helper function added that retrieves a local IP address

8 years agoandroid_service_t handles initiation of an SA and tracks its progress
Tobias Brunner [Wed, 8 Aug 2012 11:15:53 +0000 (13:15 +0200)]
android_service_t handles initiation of an SA and tracks its progress

Status updates are delivered via charonservice (JNI).

8 years agoAndroid specific credential set also provides user credentials
Tobias Brunner [Wed, 8 Aug 2012 10:59:39 +0000 (12:59 +0200)]
Android specific credential set also provides user credentials

8 years agoAdded an Android specific credential set that provides CA certificates via JNI
Tobias Brunner [Wed, 8 Aug 2012 10:52:05 +0000 (12:52 +0200)]
Added an Android specific credential set that provides CA certificates via JNI

8 years agoCharonVpnService provides a function to get trusted certificates via JNI
Tobias Brunner [Wed, 8 Aug 2012 10:35:49 +0000 (12:35 +0200)]
CharonVpnService provides a function to get trusted certificates via JNI

8 years agoFunction added that allows to update VPN state via JNI
Tobias Brunner [Wed, 8 Aug 2012 10:31:58 +0000 (12:31 +0200)]
Function added that allows to update VPN state via JNI

8 years agoAdd a function to disconnect any current VPN connection
Tobias Brunner [Wed, 8 Aug 2012 10:25:17 +0000 (12:25 +0200)]
Add a function to disconnect any current VPN connection

8 years agoImplement kernel_ipsec_t.bypass_socket() via JNI and VpnService.protect()
Tobias Brunner [Wed, 8 Aug 2012 10:20:13 +0000 (12:20 +0200)]
Implement kernel_ipsec_t.bypass_socket() via JNI and VpnService.protect()

8 years agoCharonVpnService binds to VpnStateService and does basic state updates
Tobias Brunner [Wed, 8 Aug 2012 10:04:38 +0000 (12:04 +0200)]
CharonVpnService binds to VpnStateService and does basic state updates

8 years agoCharonVpnService reacts on Intents and properly inits/deinits charon
Tobias Brunner [Wed, 8 Aug 2012 09:54:36 +0000 (11:54 +0200)]
CharonVpnService reacts on Intents and properly inits/deinits charon

Charon is initialized with every new connection attempt and
deinitialized when the service is terminated or it receives an empty
Intent (or before starting a new connection).

A separate thread is used to handle the connection attempts, this thread
acts as main thread for charon.

8 years agoService added that keeps track of VPN state and notifies listeners about changes
Tobias Brunner [Wed, 8 Aug 2012 09:32:03 +0000 (11:32 +0200)]
Service added that keeps track of VPN state and notifies listeners about changes

It is ensured that listeners are notified only from the main thread.

8 years agoAdd an Android specific kernel_ipsec_t implementation
Tobias Brunner [Wed, 8 Aug 2012 09:12:55 +0000 (11:12 +0200)]
Add an Android specific kernel_ipsec_t implementation

This is pretty much a proxy class that delegates everything (that is
currently supported) to libipsec.

8 years agoAdd an Android specific kernel_net_t implementation
Tobias Brunner [Wed, 8 Aug 2012 09:05:07 +0000 (11:05 +0200)]
Add an Android specific kernel_net_t implementation

This currently provides only no-ops and is just added because a
kernel-net implementation is required and kernel-netlink can't be used
at the moment.

8 years agoClone the current VPN profile before updating the password
Tobias Brunner [Tue, 7 Aug 2012 16:45:03 +0000 (18:45 +0200)]
Clone the current VPN profile before updating the password

Storing the password on the original object would be problematic in case
the user mistypes the password (no prompt would be shown the second time).

An alternative would be to just return the ID of the selected profile
and then fetch it from the database.

8 years agoAllow VpnProfile objects to be cloned
Tobias Brunner [Tue, 7 Aug 2012 16:44:36 +0000 (18:44 +0200)]
Allow VpnProfile objects to be cloned

8 years agoPrompt the user for a password if none is configured in the VPN profile
Tobias Brunner [Tue, 7 Aug 2012 16:44:06 +0000 (18:44 +0200)]
Prompt the user for a password if none is configured in the VPN profile

8 years agoAllow selection of a CA certificate for a VPN profile
Tobias Brunner [Tue, 7 Aug 2012 16:03:51 +0000 (18:03 +0200)]
Allow selection of a CA certificate for a VPN profile

This solution is just temporary as it really is not that user-friendly
to select CA certificates with a Spinner widget.

8 years agoSimplified asynchronous loading of CA certificates in MainActivity
Tobias Brunner [Tue, 7 Aug 2012 15:52:10 +0000 (17:52 +0200)]
Simplified asynchronous loading of CA certificates in MainActivity

8 years agoAdded simple adapter for trusted certificates (to be used with a Spinner widget)
Tobias Brunner [Tue, 7 Aug 2012 15:07:44 +0000 (17:07 +0200)]
Added simple adapter for trusted certificates (to be used with a Spinner widget)

8 years agoKeep a global reference to the CharonVpnService object in charonservice
Tobias Brunner [Tue, 7 Aug 2012 13:51:00 +0000 (15:51 +0200)]
Keep a global reference to the CharonVpnService object in charonservice

8 years agoAdd signal handler for fatal signals to libandroidbridge
Tobias Brunner [Tue, 7 Aug 2012 13:30:49 +0000 (15:30 +0200)]
Add signal handler for fatal signals to libandroidbridge

8 years agoSet default log level in libandroidbridge
Tobias Brunner [Tue, 7 Aug 2012 13:25:06 +0000 (15:25 +0200)]
Set default log level in libandroidbridge

8 years agoRenamed main Activity (shorter name in Launcher)
Tobias Brunner [Tue, 7 Aug 2012 13:17:45 +0000 (15:17 +0200)]
Renamed main Activity (shorter name in Launcher)

8 years agoMainActivity starts CharonVpnService if a VpnProfile is clicked in the list
Tobias Brunner [Tue, 7 Aug 2012 12:11:27 +0000 (14:11 +0200)]
MainActivity starts CharonVpnService if a VpnProfile is clicked in the list

This is done by implementing the OnVpnProfileSelectedListener interface
provided by VpnProfileListFragment.

8 years agoMenu option added to reload cached CA certificates
Tobias Brunner [Tue, 7 Aug 2012 12:02:38 +0000 (14:02 +0200)]
Menu option added to reload cached CA certificates

This might be required if the user installs a new CA certificate.

8 years agoShow progress bar in ActionBar while loading cached CA certificates
Tobias Brunner [Tue, 7 Aug 2012 12:00:16 +0000 (14:00 +0200)]
Show progress bar in ActionBar while loading cached CA certificates

8 years agoHelper function added to handle Java exceptions in native code
Tobias Brunner [Tue, 7 Aug 2012 11:40:47 +0000 (13:40 +0200)]
Helper function added to handle Java exceptions in native code

8 years agoDon't attach to actual Java threads (or already attached ones)
Tobias Brunner [Tue, 7 Aug 2012 11:34:44 +0000 (13:34 +0200)]
Don't attach to actual Java threads (or already attached ones)

We check this by trying to retrieve a JNIEnv object from the JVM,
if one is returned the current thread is not native (created from Java)
or the thread is already attached.

8 years agoInitially load CA certificates when the main Activity is created
Tobias Brunner [Wed, 18 Jul 2012 11:43:34 +0000 (13:43 +0200)]
Initially load CA certificates when the main Activity is created

8 years agoTrusted CA certificates are loaded and cached by a static singleton
Tobias Brunner [Wed, 18 Jul 2012 11:40:29 +0000 (13:40 +0200)]
Trusted CA certificates are loaded and cached by a static singleton

8 years agoRemove restriction to portrait orientation
Tobias Brunner [Tue, 17 Jul 2012 18:03:40 +0000 (20:03 +0200)]
Remove restriction to portrait orientation

8 years agoUse Holo as theme
Tobias Brunner [Tue, 17 Jul 2012 18:03:23 +0000 (20:03 +0200)]
Use Holo as theme

8 years agoMake click events on the profile list available to the Activity
Tobias Brunner [Tue, 17 Jul 2012 17:57:51 +0000 (19:57 +0200)]
Make click events on the profile list available to the Activity

If the Activity this fragment is placed in implements the provided interface
it is notified about clicks on any of the profiles.

8 years agoUse a contextual action bar to edit and delete selected VPN profiles
Tobias Brunner [Tue, 17 Jul 2012 17:49:42 +0000 (19:49 +0200)]
Use a contextual action bar to edit and delete selected VPN profiles

8 years agoProvide a menu with options to save VPN profiles
Tobias Brunner [Tue, 17 Jul 2012 17:45:23 +0000 (19:45 +0200)]
Provide a menu with options to save VPN profiles

The ID of the updated/inserted profile is sent back to the activity that
started the detail view.

8 years agoThe list fragment uses a menu to provide an option to add new VPN profiles
Tobias Brunner [Tue, 17 Jul 2012 17:40:03 +0000 (19:40 +0200)]
The list fragment uses a menu to provide an option to add new VPN profiles

8 years agoAdded an activity to edit basic VPN profile details
Tobias Brunner [Tue, 17 Jul 2012 17:23:21 +0000 (19:23 +0200)]
Added an activity to edit basic VPN profile details

Already load existing data based on extra data delivered with the
Intent, no saving and CA certificate handling yet.

8 years agoShow list fragment in main activity
Tobias Brunner [Tue, 17 Jul 2012 17:12:56 +0000 (19:12 +0200)]
Show list fragment in main activity

8 years agoFragment added to list the VPN profiles
Tobias Brunner [Tue, 17 Jul 2012 17:08:08 +0000 (19:08 +0200)]
Fragment added to list the VPN profiles

8 years agoAdded a custom adapter and layout to display VPN profiles in a ListView
Tobias Brunner [Tue, 17 Jul 2012 17:02:50 +0000 (19:02 +0200)]
Added a custom adapter and layout to display VPN profiles in a ListView

8 years agoAdded class to simplify access to database of VPN profiles
Tobias Brunner [Tue, 17 Jul 2012 16:50:23 +0000 (18:50 +0200)]
Added class to simplify access to database of VPN profiles

8 years agoAdded class to move around VPN profiles in the Android App
Tobias Brunner [Tue, 17 Jul 2012 16:40:30 +0000 (18:40 +0200)]
Added class to move around VPN profiles in the Android App

8 years agoReplaced launcher icon with a more appropriate one
Tobias Brunner [Tue, 17 Jul 2012 16:39:42 +0000 (18:39 +0200)]
Replaced launcher icon with a more appropriate one

8 years agoMoved main Activity to ui sub-package
Tobias Brunner [Sat, 14 Jul 2012 15:12:07 +0000 (17:12 +0200)]
Moved main Activity to ui sub-package

Also force portrait orientation.

8 years agoMoved CharonVpnService to logic sub-package
Tobias Brunner [Sat, 14 Jul 2012 15:03:22 +0000 (17:03 +0200)]
Moved CharonVpnService to logic sub-package

8 years agoGlobal charonservice_t object added to libandroidbridge
Tobias Brunner [Sat, 14 Jul 2012 14:14:34 +0000 (16:14 +0200)]
Global charonservice_t object added to libandroidbridge

This is later used to call Java methods on CharonVpnService via JNI.

8 years agoAdded functions to attach/detach native threads to the JVM
Tobias Brunner [Sat, 14 Jul 2012 14:06:12 +0000 (16:06 +0200)]
Added functions to attach/detach native threads to the JVM

Even though native threads are automatically detached from the JVM with
help of a thread-local destructor it is recommended to detach as soon as
possible as local JNI references are not freed until a thread detaches.

8 years agoMoved JNI helper macros to a separate file
Tobias Brunner [Sat, 14 Jul 2012 14:00:01 +0000 (16:00 +0200)]
Moved JNI helper macros to a separate file

Also initialize a reference to the CharonVpnService class during
JNI_OnLoad, which allows us later to call methods from C to Java.

8 years agoUse strongSwan logo as icon
Tobias Brunner [Sat, 14 Jul 2012 13:31:36 +0000 (15:31 +0200)]
Use strongSwan logo as icon

Due to the transparency and black font this is probably not optimal yet.

8 years agoFixed ip_packet_t if IPv6 is not available
Tobias Brunner [Sat, 14 Jul 2012 09:47:06 +0000 (11:47 +0200)]
Fixed ip_packet_t if IPv6 is not available

8 years agoAdded utility class to create TUN devices
Tobias Brunner [Fri, 13 Jul 2012 14:12:29 +0000 (16:12 +0200)]
Added utility class to create TUN devices

Currently works only on Linux.

8 years agoAdded IPsec processor which is responsible for handling in- and outbound packets
Tobias Brunner [Fri, 13 Jul 2012 13:34:51 +0000 (15:34 +0200)]
Added IPsec processor which is responsible for handling in- and outbound packets

Two callbacks can be registered that get called when new inbound plaintext and
outbound ESP packets have been processed. Inbound ESP and outbound plaintext
packets can be queued for processing with two other methods.

8 years agoRepresent the payload of an ESP packet as ip_packet_t instead of a chunk_t
Tobias Brunner [Fri, 13 Jul 2012 13:23:00 +0000 (15:23 +0200)]
Represent the payload of an ESP packet as ip_packet_t instead of a chunk_t

8 years agoIPsec policies can be looked up based on an IP packet
Tobias Brunner [Fri, 13 Jul 2012 13:18:07 +0000 (15:18 +0200)]
IPsec policies can be looked up based on an IP packet

8 years agoip_packet_t parses the header of IP packets
Tobias Brunner [Fri, 13 Jul 2012 13:05:27 +0000 (15:05 +0200)]
ip_packet_t parses the header of IP packets

8 years agoOrder IPsec policies by a pseudo-priority based on the traffic selectors
Tobias Brunner [Fri, 13 Jul 2012 12:41:45 +0000 (14:41 +0200)]
Order IPsec policies by a pseudo-priority based on the traffic selectors

This allows a simple lookup, i.e. just use the first policy that matches
a given IP packet.

8 years agoImplemented a checkout/checkin mechanism for IPsec SAs
Tobias Brunner [Fri, 13 Jul 2012 12:32:03 +0000 (14:32 +0200)]
Implemented a checkout/checkin mechanism for IPsec SAs

SAs can only be checked out by a single thread and all other threads
block until the SA is checked in again.

8 years agoIPsec policy manager added
Tobias Brunner [Fri, 13 Jul 2012 12:27:41 +0000 (14:27 +0200)]
IPsec policy manager added

This version only provides the very simplest management functions.

8 years agoMethod added to easily compare IPsec policies
Tobias Brunner [Fri, 13 Jul 2012 12:17:03 +0000 (14:17 +0200)]
Method added to easily compare IPsec policies

8 years agoClass representing an IPsec policy added
Tobias Brunner [Fri, 13 Jul 2012 12:05:52 +0000 (14:05 +0200)]
Class representing an IPsec policy added

8 years agoSchedule and relay expiration events for created IPsec SAs
Tobias Brunner [Fri, 13 Jul 2012 11:54:29 +0000 (13:54 +0200)]
Schedule and relay expiration events for created IPsec SAs

8 years agoAdded class to relay IPsec events (like expiration) to listeners
Tobias Brunner [Fri, 13 Jul 2012 11:32:27 +0000 (13:32 +0200)]
Added class to relay IPsec events (like expiration) to listeners

Currently, only expiration of IPsec SAs is supported.  Later other events
for e.g. acquires or changed NAT endpoints could be added.

8 years agoAdded IPsec SA manager
Tobias Brunner [Fri, 13 Jul 2012 11:21:45 +0000 (13:21 +0200)]
Added IPsec SA manager

8 years agoAdd methods to easily compare IPsec SAs
Tobias Brunner [Fri, 13 Jul 2012 09:21:25 +0000 (11:21 +0200)]
Add methods to easily compare IPsec SAs

8 years agoClass representing an IPsec SA added
Tobias Brunner [Fri, 13 Jul 2012 09:06:35 +0000 (11:06 +0200)]
Class representing an IPsec SA added

The IPsec SA also manages the respective ESP context.

8 years agoMoved types used by kernel_ipsec_t interface (and libipsec) to libstrongswan
Tobias Brunner [Fri, 13 Jul 2012 09:02:08 +0000 (11:02 +0200)]
Moved types used by kernel_ipsec_t interface (and libipsec) to libstrongswan

This avoids a dependency of libipsec to libhydra.

8 years agoUse a CALLBACK feature to create charon's sender and receiver
Tobias Brunner [Thu, 12 Jul 2012 14:56:35 +0000 (16:56 +0200)]
Use a CALLBACK feature to create charon's sender and receiver

8 years agoAdded a simple blocking queue around linked_list_t
Tobias Brunner [Tue, 10 Jul 2012 08:17:21 +0000 (10:17 +0200)]
Added a simple blocking queue around linked_list_t

8 years agoesp_packet_t implements packet_t interface
Tobias Brunner [Sat, 7 Jul 2012 11:31:07 +0000 (13:31 +0200)]
esp_packet_t implements packet_t interface

This should allow to avoid unnecessary cloning of packet data.

8 years agoExtended constructor for packet_t added (takes src, dst and data)
Tobias Brunner [Sat, 7 Jul 2012 10:46:28 +0000 (12:46 +0200)]
Extended constructor for packet_t added (takes src, dst and data)

8 years agoMoved packet_t to libstrongswan
Tobias Brunner [Fri, 6 Jul 2012 14:40:46 +0000 (16:40 +0200)]
Moved packet_t to libstrongswan

8 years agoHeaders from libhydra (kernel interface related) are required in libipsec
Tobias Brunner [Thu, 5 Jul 2012 13:46:54 +0000 (15:46 +0200)]
Headers from libhydra (kernel interface related) are required in libipsec

8 years agoESP packet wrapper added, handles encryption/decryption/verification etc.
Tobias Brunner [Thu, 5 Jul 2012 11:56:24 +0000 (13:56 +0200)]
ESP packet wrapper added, handles encryption/decryption/verification etc.

8 years agoAdding class to manage ESP context (crypto, sequence numbers)
Tobias Brunner [Thu, 5 Jul 2012 11:44:57 +0000 (13:44 +0200)]
Adding class to manage ESP context (crypto, sequence numbers)

8 years agoAdded a method to bio_writer_t that allows to skip a number of bytes
Tobias Brunner [Fri, 29 Jun 2012 08:47:20 +0000 (10:47 +0200)]
Added a method to bio_writer_t that allows to skip a number of bytes

A chunk pointing to the skipped bytes is returned, allowing users of
bio_writer_t to write/copy data to the skipped bytes themselves.