Commit Graph
9542 Commits
Author SHA1 Message Date
Tobias Brunner 2483f6a4e0 Job added which handles plain text packets read from TUN device 2012-08-13 11:09:34 +02:00
Tobias Brunner d9531100fa Added a handler that writes inbound plain text packets to the TUN device 2012-08-13 11:09:34 +02:00
Tobias Brunner 3b3cf0c87a Add simple callbacks to receive/send ESP packets via libipsec/receiver. 2012-08-13 11:09:34 +02:00
Tobias Brunner 30ba2ff777 Add routes based on the installed IPsec policies to the TUN device builder 2012-08-13 11:09:34 +02:00
Tobias Brunner 62e6630b24 Add virtual IP to the TUN device builder
After the CHILD_SA is established we can easily get this address from
the IKE_SA.
2012-08-13 11:09:34 +02:00
Tobias Brunner a2993d7243 Create a TUN device via VpnService.Builder once the CHILD_SA is established 2012-08-13 11:09:34 +02:00
Tobias Brunner 3a05756b42 An Android specific attribute handler installs DNS servers via Builder 2012-08-13 11:09:33 +02:00
Tobias Brunner ae4f1ea180 Native counterpart of VpnService.Builder added, exposed by charonservice 2012-08-13 11:09:33 +02:00
Tobias Brunner 5215d512bf Adapter class added around VpnService.Builder which allows to access it via JNI 2012-08-13 11:00:29 +02:00
Tobias Brunner f12b3ad2c9 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.
2012-08-13 11:00:29 +02:00
Tobias Brunner 495e12aead Add support for '+' in custom format specifiers 2012-08-13 11:00:28 +02:00
Tobias Brunner c6c39c783b Initiate an SA via native JNI method 2012-08-13 11:00:28 +02:00
Tobias Brunner dffee9e2b0 Helper function added that retrieves a local IP address 2012-08-13 11:00:28 +02:00
Tobias Brunner 66211196a7 android_service_t handles initiation of an SA and tracks its progress
Status updates are delivered via charonservice (JNI).
2012-08-13 11:00:28 +02:00
Tobias Brunner 3aa5c609c3 Android specific credential set also provides user credentials 2012-08-13 11:00:28 +02:00
Tobias Brunner 8430e54d83 Added an Android specific credential set that provides CA certificates via JNI 2012-08-13 11:00:28 +02:00
Tobias Brunner 2bec193a1b CharonVpnService provides a function to get trusted certificates via JNI 2012-08-13 11:00:28 +02:00
Tobias Brunner 8c2af60ceb Function added that allows to update VPN state via JNI 2012-08-13 11:00:28 +02:00
Tobias Brunner 1b8877727c Add a function to disconnect any current VPN connection 2012-08-13 11:00:27 +02:00
Tobias Brunner d4f7675199 Implement kernel_ipsec_t.bypass_socket() via JNI and VpnService.protect() 2012-08-13 11:00:27 +02:00
Tobias Brunner 03de55ad98 CharonVpnService binds to VpnStateService and does basic state updates 2012-08-13 11:00:27 +02:00
Tobias Brunner a4f9028e08 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.
2012-08-13 11:00:27 +02:00
Tobias Brunner d1220566ef 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.
2012-08-13 11:00:27 +02:00
Tobias Brunner 175088517f Add an Android specific kernel_ipsec_t implementation
This is pretty much a proxy class that delegates everything (that is
currently supported) to libipsec.
2012-08-13 11:00:27 +02:00
Tobias Brunner 24447cf49f 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.
2012-08-13 11:00:27 +02:00
Tobias Brunner 6e04147743 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.
2012-08-13 11:00:26 +02:00
Tobias Brunner 8d4eea5325 Allow VpnProfile objects to be cloned 2012-08-13 11:00:26 +02:00
Tobias Brunner b1340aa129 Prompt the user for a password if none is configured in the VPN profile 2012-08-13 11:00:26 +02:00
Tobias Brunner fcb5448017 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.
2012-08-13 11:00:26 +02:00
Tobias Brunner 8db37772f5 Simplified asynchronous loading of CA certificates in MainActivity 2012-08-13 11:00:26 +02:00
Tobias Brunner b21979f12f Added simple adapter for trusted certificates (to be used with a Spinner widget) 2012-08-13 11:00:26 +02:00
Tobias Brunner 529c8c88a3 Keep a global reference to the CharonVpnService object in charonservice 2012-08-13 11:00:26 +02:00
Tobias Brunner a304874319 Add signal handler for fatal signals to libandroidbridge 2012-08-13 11:00:26 +02:00
Tobias Brunner d200749424 Set default log level in libandroidbridge 2012-08-13 11:00:25 +02:00
Tobias Brunner 6316b50280 Renamed main Activity (shorter name in Launcher) 2012-08-13 11:00:25 +02:00
Tobias Brunner 0b362ed837 MainActivity starts CharonVpnService if a VpnProfile is clicked in the list
This is done by implementing the OnVpnProfileSelectedListener interface
provided by VpnProfileListFragment.
2012-08-13 11:00:25 +02:00
Tobias Brunner c8b942a1e2 Menu option added to reload cached CA certificates
This might be required if the user installs a new CA certificate.
2012-08-13 11:00:25 +02:00
Tobias Brunner 9756cf22f2 Show progress bar in ActionBar while loading cached CA certificates 2012-08-13 11:00:25 +02:00
Tobias Brunner 19567a5e3a Helper function added to handle Java exceptions in native code 2012-08-13 11:00:25 +02:00
Tobias Brunner 95e9a12c28 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.
2012-08-13 11:00:25 +02:00
Tobias Brunner 5afb1e3c45 Initially load CA certificates when the main Activity is created 2012-08-13 11:00:24 +02:00
Tobias Brunner a305419b40 Trusted CA certificates are loaded and cached by a static singleton 2012-08-13 11:00:24 +02:00
Tobias Brunner 40dfe8f1d8 Remove restriction to portrait orientation 2012-08-13 11:00:24 +02:00
Tobias Brunner 3a32ba7111 Use Holo as theme 2012-08-13 11:00:24 +02:00
Tobias Brunner da9bb5044f 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.
2012-08-13 11:00:09 +02:00
Tobias Brunner c6b736b9f5 Use a contextual action bar to edit and delete selected VPN profiles 2012-08-11 15:10:35 +02:00
Tobias Brunner a3e2f127dc 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.
2012-08-11 15:10:35 +02:00
Tobias Brunner c2e427c287 The list fragment uses a menu to provide an option to add new VPN profiles 2012-08-11 15:10:34 +02:00
Tobias Brunner 56a922b2ed 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.
2012-08-11 15:10:34 +02:00
Tobias Brunner 0458ac7cbc Show list fragment in main activity 2012-08-11 15:10:34 +02:00