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
Tobias Brunner
7329618cc2
Fragment added to list the VPN profiles
2012-08-11 15:10:34 +02:00
Tobias Brunner
03a5a63c03
Added a custom adapter and layout to display VPN profiles in a ListView
2012-08-11 15:10:34 +02:00
Tobias Brunner
d799cbf676
Added class to simplify access to database of VPN profiles
2012-08-11 15:10:33 +02:00
Tobias Brunner
3d9127da61
Added class to move around VPN profiles in the Android App
2012-08-11 15:10:33 +02:00
Tobias Brunner
b17b495f2e
Replaced launcher icon with a more appropriate one
2012-08-11 15:10:33 +02:00
Tobias Brunner
441dde9ee9
Moved main Activity to ui sub-package
...
Also force portrait orientation.
2012-08-08 15:41:04 +02:00
Tobias Brunner
8bf3027643
Moved CharonVpnService to logic sub-package
2012-08-08 15:41:04 +02:00
Tobias Brunner
6f11e94134
Global charonservice_t object added to libandroidbridge
...
This is later used to call Java methods on CharonVpnService via JNI.
2012-08-08 15:41:04 +02:00
Tobias Brunner
f83f65be08
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.
2012-08-08 15:41:04 +02:00
Tobias Brunner
cb887af4cf
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.
2012-08-08 15:41:03 +02:00
Tobias Brunner
d62d5d7c2e
Use strongSwan logo as icon
...
Due to the transparency and black font this is probably not optimal yet.
2012-08-08 15:41:03 +02:00
Tobias Brunner
b6a071514a
Fixed ip_packet_t if IPv6 is not available
2012-08-08 15:41:03 +02:00
Tobias Brunner
34400edc37
Added utility class to create TUN devices
...
Currently works only on Linux.
2012-08-08 15:41:03 +02:00
Tobias Brunner
a113d7f29b
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.
2012-08-08 15:41:03 +02:00
Tobias Brunner
b37758c41e
Represent the payload of an ESP packet as ip_packet_t instead of a chunk_t
2012-08-08 15:41:03 +02:00
Tobias Brunner
2e1a19136d
IPsec policies can be looked up based on an IP packet
2012-08-08 15:41:03 +02:00
Tobias Brunner
2dd47c2442
ip_packet_t parses the header of IP packets
2012-08-08 15:41:03 +02:00
Tobias Brunner
ed1f0c234f
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.
2012-08-08 15:41:03 +02:00
Tobias Brunner
f1b4238311
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.
2012-08-08 15:41:03 +02:00
Tobias Brunner
7000cf11b1
IPsec policy manager added
...
This version only provides the very simplest management functions.
2012-08-08 15:41:03 +02:00
Tobias Brunner
3b8276b405
Method added to easily compare IPsec policies
2012-08-08 15:41:03 +02:00
Tobias Brunner
9a11bc09bd
Class representing an IPsec policy added
2012-08-08 15:41:03 +02:00
Tobias Brunner
e6cfd527df
Schedule and relay expiration events for created IPsec SAs
2012-08-08 15:41:03 +02:00
Tobias Brunner
b50f56f326
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.
2012-08-08 15:41:03 +02:00
Tobias Brunner
914479370e
Added IPsec SA manager
2012-08-08 15:41:03 +02:00
Tobias Brunner
9f7e1899a9
Add methods to easily compare IPsec SAs
2012-08-08 15:41:02 +02:00
Tobias Brunner
f9b0c05475
Class representing an IPsec SA added
...
The IPsec SA also manages the respective ESP context.
2012-08-08 15:41:02 +02:00
Tobias Brunner
156f7e9b85
Moved types used by kernel_ipsec_t interface (and libipsec) to libstrongswan
...
This avoids a dependency of libipsec to libhydra.
2012-08-08 15:41:02 +02:00
Tobias Brunner
053276e69a
Use a CALLBACK feature to create charon's sender and receiver
2012-08-08 15:41:02 +02:00
Tobias Brunner
2dde79aca6
Added a simple blocking queue around linked_list_t
2012-08-08 15:41:02 +02:00
Tobias Brunner
05a2a7950c
esp_packet_t implements packet_t interface
...
This should allow to avoid unnecessary cloning of packet data.
2012-08-08 15:41:02 +02:00
Tobias Brunner
ec486e9433
Extended constructor for packet_t added (takes src, dst and data)
2012-08-08 15:41:02 +02:00
Tobias Brunner
5764a9b355
Moved packet_t to libstrongswan
2012-08-08 15:41:02 +02:00
Tobias Brunner
3320b87a62
Headers from libhydra (kernel interface related) are required in libipsec
2012-08-08 15:41:02 +02:00
Tobias Brunner
47eb8943b2
ESP packet wrapper added, handles encryption/decryption/verification etc.
2012-08-08 15:41:02 +02:00
Tobias Brunner
64004973e3
Adding class to manage ESP context (crypto, sequence numbers)
2012-08-08 15:41:02 +02:00
Tobias Brunner
6dfdcf420f
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.
2012-08-08 15:41:02 +02:00
Tobias Brunner
59a15a7475
Added a method to bio_writer_t that allows to extract the internal buffer
2012-08-08 15:41:02 +02:00
Tobias Brunner
c1830d2670
Added methods to bio_reader_t to read data from end of buffer
2012-08-08 15:41:02 +02:00
Tobias Brunner
f3fefb1847
Increase log verbosity when sending NAT keep-alives
2012-08-08 15:41:02 +02:00
Tobias Brunner
6d11dd5770
Only log the sending of regular packets in sender_t
...
When sender_t is used to send ESP packets this would otherwise cause an extreme
amount of debug messages.
With this change all messages sent via sender_t.send_no_marker() cause no extra
DBG1 log message, but for debugging purposes the socket plugins do log the same
message again with DBG2 for all packets.
2012-08-08 15:41:02 +02:00
Tobias Brunner
6fbf4472ea
Added option to prevent socket-default from setting the source address on outbound packets
2012-08-08 15:39:07 +02:00
Tobias Brunner
95dacbbc70
Allocate UDP ports randomly in Android NDK build.
2012-08-08 15:30:28 +02:00
Tobias Brunner
224ab4c59b
socket-default plugin allocates random ports if configured to 0.
...
Also added strongswan.conf options to change the ports.
2012-08-08 15:30:27 +02:00
Tobias Brunner
b223d517c8
Replaced usages of CHARON_*_PORT with calls to get_port().
2012-08-08 15:12:25 +02:00
Tobias Brunner
a7babe25ee
Added get_port() method to socket_t to learn the listening port.
2012-08-08 15:12:25 +02:00
Tobias Brunner
56d07af3be
Added ESP log group for libipsec log messages.
2012-08-08 15:12:25 +02:00
Tobias Brunner
75f8316332
Use send_no_marker to send NAT keepalives.
2012-08-08 15:12:25 +02:00
Tobias Brunner
30dc7dff4d
Avoid double-free when prepending Non-ESP marker.
2012-08-08 15:12:25 +02:00
Tobias Brunner
fb6c52adcd
Function added to send packets without Non-ESP marker.
2012-08-08 15:12:25 +02:00
Tobias Brunner
fe4a152b85
Avoid unnecessary copy of packet data when removing Non-ESP marker.
2012-08-08 15:12:25 +02:00
Tobias Brunner
73470cfe57
Added packet_t.skip_bytes method to skip bytes at the start of a packet.
2012-08-08 15:12:25 +02:00
Tobias Brunner
896941d365
Improved how NAT-T keepalives are handled in sockets/receiver.
2012-08-08 15:12:24 +02:00
Tobias Brunner
e49abcede0
Let kernel interfaces decide how to enable UDP decapsulation of ESP packets.
2012-08-08 15:12:24 +02:00
Tobias Brunner
08b2ce7aa7
Callback for ESP packets added to receiver.
2012-08-08 15:12:24 +02:00
Tobias Brunner
064da8b96b
Add Non-ESP marker in sender and not individual socket plugins.
2012-08-08 15:12:24 +02:00
Tobias Brunner
65da43e2fc
Handle Non-ESP marker in receiver and not individual socket plugins.
2012-08-08 15:12:24 +02:00
Tobias Brunner
a405760395
Java code style fixed (analogous to C code).
2012-08-08 15:12:24 +02:00
Tobias Brunner
06ed785e5a
Load libipsec in Android app.
2012-08-08 15:12:24 +02:00
Tobias Brunner
b70139fbfd
Stub library for user space IPsec implementation added.
2012-08-08 15:09:31 +02:00
Tobias Brunner
48f2c4b69b
Some NDK build info updated.
2012-08-08 15:09:31 +02:00
Tobias Brunner
9ddc7cbfff
Changed minimal SDK/API level to 14.
2012-08-08 15:09:31 +02:00
Tobias Brunner
4a20814300
Added android.net.VpnService wrapper around charon (loaded via JNI).
2012-08-08 15:09:31 +02:00
Tobias Brunner
da848ab894
Added Android shell app created with Android SDK.
2012-08-08 15:09:30 +02:00
Tobias Brunner
2f203aee0e
Android.mk for NDK build added.
2012-08-08 15:09:30 +02:00
Tobias Brunner
3fa8d7738e
Extracted some parts from Android.mk.in which can be used for NDK builds.
2012-08-08 15:07:43 +02:00
Tobias Brunner
80b267f9e3
Use filter instead of findstring to check for enabled plugins in Android.mk.
...
findstring is not prefix-safe (i.e. android matches android-log). On
the other hand filter matches words separated by whitespace and if no
wildcard (%) is used the full word has to match.
2012-08-08 15:07:43 +02:00
Tobias Brunner
162621ed57
Moved Android specific logger to separate plugin.
...
This is mainly because the other parts of the existing android plugin
can not be built in the NDK (access to keystore and system properties are
not part of the stable NDK libraries).
2012-08-08 15:07:43 +02:00
Tobias Brunner
657a3ba609
Link android plugin against liblog in the NDK.
...
Doesn't seem to hurt the build within the source tree.
2012-08-08 15:07:43 +02:00
Tobias Brunner
e7ea057fd2
Make the UDP ports charon listens for packets on (and uses as source ports) configurable.
2012-08-08 15:07:43 +02:00
Tobias Brunner
73940eb712
Make path to Android OpenSSL headers configurable.
2012-08-08 15:07:43 +02:00
Tobias Brunner
4528e74a5c
Don't require STRONGSWAN_CONF to be defined.
2012-08-08 15:07:42 +02:00
Tobias Brunner
a9f169f699
Don't require PLUGINDIR to be defined.
...
If it is not available, we just load monolithically built plugins.
2012-08-08 15:07:42 +02:00
Tobias Brunner
6204c1182d
Include src address in hash of initial message for Main Mode
...
If two initiators use the same SPI and also use the same SA proposal the
hash for the initial message would be exactly the same. For IKEv2 and
Aggressive Mode that's not a problem as these messages include random
data (Ni, KEi payloads).
2012-08-08 14:47:36 +02:00
Tobias Brunner
decc467a4f
Implemented recursive mutex without thread-specific counter
2012-08-03 11:30:18 +02:00
Tobias Brunner
920f29e7d5
Use a single thread-specific value for our custom rwlock_t implementation
...
The pthread implementation on Android currently only supports 64
different thread-specific values per process, which we hit easily when
every rwlock_t requires one.
2012-08-03 11:30:18 +02:00
Tobias Brunner
63ac6d00b0
Proper fallback if capability dropping is not available
2012-07-27 14:46:42 +02:00
Tobias Brunner
8ff1094823
The use of $< in Makefiles is not portable
...
It requires GNU make which is not what most people use on e.g. FreeBSD.
Fixes #205 .
2012-07-27 13:47:59 +02:00
Tobias Brunner
d511a71daa
Include stdint.h for UINTxx_MAX defines
...
Fixes #205 .
2012-07-27 13:47:59 +02:00
Tobias Brunner
126eb2af59
Check rng return value when generating secrets and IVs in libtls
2012-07-16 14:53:37 +02:00
Tobias Brunner
e59f983160
Check rng return value when generating identity in eap-simaka-reauth plugin
2012-07-16 14:53:36 +02:00
Tobias Brunner
e37f9ac2c9
Check rng return value when generating pseudonym in eap-simaka-pseudonym plugin
2012-07-16 14:53:36 +02:00
Tobias Brunner
8beeb8e116
Check rng return value when generating nonces in eap-aka plugin
2012-07-16 14:53:36 +02:00
Tobias Brunner
18ce1bb721
Check rng return value when generating nonces in eap-sim plugin
2012-07-16 14:53:36 +02:00
Tobias Brunner
cfd824ccde
Check rng return value when generating nonces in libpts
2012-07-16 14:53:36 +02:00