Tobias Brunner
3a917ac77f
Validate netmask in mem_pool_create
2012-08-13 13:54:28 +02:00
Tobias Brunner
305d98b780
Validate netmask in traffic_selector_create_from_subnet
...
Fixes #216 .
2012-08-13 13:46:19 +02:00
Tobias Brunner
36a3981d47
Comment fixed
2012-08-13 13:17:53 +02:00
Tobias Brunner
09ae3d79ca
Merge branch 'android-app'
...
This branch introduces a userland IPsec implementation (libipsec) and an
Android App which targets the VpnService API that is provided by Android 4+.
The implementation is based on the bachelor thesis 'Userland IPsec for
Android 4' by Giuliano Grassi and Ralf Sager.
2012-08-13 12:07:52 +02:00
Tobias Brunner
efbb5e8c57
Ensure thread IDs always start with 1 even if the library is reused
...
Within the Android App the library stays loaded in memory and is just
initialized/deinitialized with each connection, the static thread
counter would continuously increase without this patch.
2012-08-13 11:28:08 +02:00
Tobias Brunner
1fcaa71291
Added a button to the error dialog that allows to view the log file
2012-08-13 11:28:08 +02:00
Tobias Brunner
fbacc6506c
Use major.minor.revision version numbers for Android application
2012-08-13 11:28:08 +02:00
Tobias Brunner
064f4f75c0
Only allow access to log file via explicitly created URIs
...
Since ContentProviders are public and permissions don't seem to work any
other application could access the log file. With this token system
only URIs we explicitly created can be accessed.
2012-08-13 11:27:55 +02:00
Tobias Brunner
6c54c10838
Menu option added that allows users to send the log file
2012-08-13 11:22:21 +02:00
Tobias Brunner
c3afe9d35b
Add ContentProvider to access log file from other applications
2012-08-13 11:22:21 +02:00
Tobias Brunner
ae10e8c458
Watch for changes to the log file so we can reopen it
...
If the log fragment is shown while the daemon starts (which is not the
case at the moment, but maybe later on tablets) the file reader would not
notice that the file got truncated. The same applies if the file is deleted
directly on the file system e.g. with adb shell.
2012-08-13 11:22:21 +02:00
Tobias Brunner
bad119c55a
Add an Activity that shows the log fragment
2012-08-13 11:22:20 +02:00
Tobias Brunner
f9a162a235
Add a fragment that can display charon's log file
...
It continuously reads from the log file in a separate thread while displayed.
2012-08-13 11:22:20 +02:00
Tobias Brunner
658ed96fce
Added special ScrollView with auto-scrolling feature
...
The ability to auto-scroll is disabled as soon as the user manually
scrolls around and re-enable when the user scrolls to the bottom.
2012-08-13 11:22:20 +02:00
Tobias Brunner
fe05f1f05c
Charon logs to a file in the App's data directory
2012-08-13 11:22:20 +02:00
Tobias Brunner
4308ce1cf7
Moved Java to C string conversion function to android_jni header file
2012-08-13 11:22:20 +02:00
Tobias Brunner
6db742e7e5
Log charon version and uname() output, split libcharon and charon initialization
2012-08-13 11:22:20 +02:00
Tobias Brunner
a7c8b166a1
Only call disconnect() from CharonVpnService if we are not already disconnecting
2012-08-13 11:22:20 +02:00
Tobias Brunner
496e096e7b
Load single certificates directly from the KeyStore if we cannot get the read lock
...
This helps when running in the emulator as loading the certificates
takes quite a while there. This way a configured CA certificates is loaded
directly without having to wait for all certificates being cached.
2012-08-13 11:22:19 +02:00
Tobias Brunner
c0fe43f002
Use colors from the Android color palette for the VPN status texts
2012-08-13 11:22:14 +02:00
Tobias Brunner
374f62535f
Localized title for contextual action bar
2012-08-13 11:18:52 +02:00
Tobias Brunner
05427857e2
German translation added
2012-08-13 11:18:52 +02:00
Tobias Brunner
9c0be3ac69
Show MainActiviy if the user clicks 'Configure' in Android's VPN dialog
2012-08-13 11:18:52 +02:00
Tobias Brunner
bebe2d397e
Keep reporting the error until the user dismisses it
...
Even when the Activity is closed and later reopened.
2012-08-13 11:18:52 +02:00
Tobias Brunner
264dd8d372
Show an error dialog when errors occur while establishing the VPN
2012-08-13 11:18:51 +02:00
Tobias Brunner
8062f973e1
Show a button to disconnect the VPN once it is established
2012-08-13 11:18:51 +02:00
Tobias Brunner
a43bdf9a37
Show current VPN state and profile name
...
Show modal dialogs while connecting and disconnecting the VPN.
2012-08-13 11:18:51 +02:00
Tobias Brunner
e7908526fd
Add a fragment to MainActivity which will display the current VPN state
...
The fragment is bound to the VpnStateService and registered as listener.
2012-08-13 11:18:51 +02:00
Tobias Brunner
9d0f8a3a95
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.
2012-08-13 11:18:23 +02:00
Tobias Brunner
a39a301a12
Don't set the source address on Android
2012-08-13 11:11:37 +02:00
Tobias Brunner
644db4d7c5
Close IKE_SA on Android immediately if setting up CHILD_SA fails
2012-08-13 11:11:20 +02:00
Tobias Brunner
76e55491eb
Reduce number of retransmits on Android
2012-08-13 11:09:34 +02:00
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