Commit Graph

395 Commits

Author SHA1 Message Date
akwizgran
9dbabdeceb Document the contract of DatabaseExecutor. 2014-11-08 16:40:22 +00:00
akwizgran
4009561996 Refactored PluginManager and Poller to remove non-open calls. Bug #15. 2014-11-08 15:40:51 +00:00
akwizgran
c2d6e9afde Some variables were still referring to TagRecogniser by its old name. 2014-11-06 20:51:10 +00:00
akwizgran
d321bc0a3e Renamed some inner classes to match the renamed outer class. 2014-11-06 13:53:59 +00:00
akwizgran
1d20761123 Messaging sessions aren't responsible for closing their streams.
The TransportReader/Writer's dispose() method should handle that, and
ConnectionManager is responsible for calling it.
2014-11-06 13:13:23 +00:00
akwizgran
b27a17db88 Erase temporary secrets after deriving keys. 2014-11-06 08:39:07 +00:00
akwizgran
1f4d801162 Interrupt all messaging sessions when the app starts shutting down.
This makes it more likely that connections will be closed cleanly.
However, the interrupt() method is currently ineffective for incoming
sessions as it won't interrupt a blocking read, e.g. when the packet
reader is waiting for a packet.
2014-11-06 08:24:08 +00:00
akwizgran
852a618cb3 Interrupt messaging session if contact or transport is removed. 2014-11-06 08:10:29 +00:00
akwizgran
c202b6f0ac Renamed ConnectionManager to ConnectionDispatcher.
Because that's what it does.
2014-11-05 19:47:54 +00:00
akwizgran
4ca83842d1 Moved ConnectionDispatcher and ConnectionRegistry to plugins package. 2014-11-05 19:40:07 +00:00
akwizgran
26d93b83b4 Factored out StreamReader/Writer from messaging layer. 2014-11-05 19:22:01 +00:00
akwizgran
dfa4860200 Cancel database queries if the messaging session has been interrupted. 2014-11-05 18:34:59 +00:00
akwizgran
5b8eab6035 Interrupt the other side of a duplex connection if an exception occurs. 2014-11-05 18:28:05 +00:00
akwizgran
33c3eb7308 PacketWriters aren't responsible for flushing their output streams. 2014-11-04 17:03:06 +00:00
akwizgran
7b8181e309 Massive refactoring to merge handling of simplex and duplex connections. 2014-11-04 16:51:25 +00:00
akwizgran
b24f153704 Renamed a load of things from 'connection' to 'stream'. 2014-10-08 16:21:55 +01:00
akwizgran
3dab4543e6 Combine the system's PRNG with Fortuna, in case either one is flawed. 2014-10-08 15:03:19 +01:00
akwizgran
bb38911dc8 SecureRandom impl that XORs the outputs of other impls (not yet used).
This can be used to combine e.g. the platform's SecureRandom
implementation with our own, so that a weakness in either source doesn't
harm security as long as the other source is strong.
2014-10-08 15:03:02 +01:00
akwizgran
4e028e217b Upgraded BouncyCastle to 1.51. 2014-10-03 13:28:45 +01:00
akwizgran
cdb5a12156 Use the event bus to observe contacts connecting and disconnecting. 2014-10-03 10:04:02 +01:00
akwizgran
8b8df435a5 Separated event infrastructure from DB. 2014-10-03 09:44:54 +01:00
akwizgran
f9a6c46efe Merged ReliabilityExecutor into IoExecutor. 2014-10-02 18:06:05 +01:00
akwizgran
941efb4bbe Merged IncomingConnectionExecutor and PluginExecutor into IoExecutor.
We don't need two separate executors for long-running IO threads.
2014-10-02 18:02:53 +01:00
akwizgran
458c0ca285 Don't broadcast MessageAddedEvent if message wasn't added.
Fixed a bug in SimplexMessagingIntegrationTest that should've caught
this.
2014-07-04 15:16:56 +01:00
akwizgran
96a9178b0b Use a single read-write lock for the DB - don't optimise prematurely. 2014-07-04 15:16:56 +01:00
akwizgran
f90f7c5e7b Use a single-threaded executor for the database.
This ensures that if two DatabaseExecutor tasks update the database and
broadcast events, the events are broadcast in the same order as the
updates occurred.
2014-07-04 15:16:55 +01:00
akwizgran
4c9296d286 Merged all licensing info into a single file to avoid APK build problems. 2014-07-02 23:01:13 +01:00
akwizgran
b4e02a7196 Release Briar code (but not bundled libraries) under Apache 2 license. 2014-06-23 10:26:16 +01:00
akwizgran
eaff042601 Don't try to close server sockets twice.
This may have been the cause of bug #69. Removed the wait-for-shutdown
code in DroidtoothPlugin that was added to attempt to avoid that bug.
2014-05-09 19:09:13 +01:00
akwizgran
4dcf9f632e Show which contacts subscribe to each forum. Dev task #79. 2014-05-02 16:24:49 +01:00
akwizgran
e1d099903d Don't allow LifecycleManager to start and stop concurrently. Bug #68. 2014-05-02 15:16:53 +01:00
akwizgran
97af24cb08 Fixed lint warning: case converstion without a locale. 2014-05-01 15:13:00 +01:00
akwizgran
a2f5f68f87 Refactored TCP plugins, moving common code into superclass. 2014-04-10 13:15:53 +01:00
akwizgran
839f67dd44 Replaced last connection time with time of last private message. 2014-04-05 18:14:36 +01:00
akwizgran
e74465dd41 Don't try to connect to unreachable IP addresses. 2014-04-05 00:00:58 +01:00
akwizgran
08b91d2483 Poll plugins when connectivity changes. Bug #66.
This should enable us to connect to contacts faster at startup and
whenever a new means of connecting becomes available.
2014-04-04 22:06:36 +01:00
akwizgran
75ce6cf1da LAN plugin should re-bind each time wifi becomes available. Bug #51. 2014-04-04 20:04:47 +01:00
akwizgran
e260aac3d2 All tryToClose() methods should check for null arguments. 2014-04-04 20:04:47 +01:00
akwizgran
75f13f53a0 Refactored address parsing code into superclass. Don't use DNS. 2014-04-04 20:04:47 +01:00
akwizgran
fe82591fdf Cleaned up address selection code for LAN and WAN plugins.
The LAN plugin only accepts IPv4 link-local or site-local addresses.
This rules out LANs that use globally routable addresses (such as UCL),
but also reduces the chances of the LAN plugin making observable
connections across the WAN, which could reveal the social graph.

Both plugins will attempt to reuse the previous address and port only if
there's currently an interface with that address; this will avoid
unnecessary attempts to bind to nonexistent addresses.
2014-04-04 20:04:47 +01:00
akwizgran
fbe1c799dd Added canary code to catch bugs #55 and #65. 2014-04-04 02:23:32 +01:00
akwizgran
79166e9b2f Reject subscription updates with duplicate entries. Bug #65. 2014-04-04 01:08:36 +01:00
akwizgran
1c282a8835 Show when private messages have been delivered. 2014-04-03 23:42:24 +01:00
akwizgran
2f9ef8fcaf Log the running time of ECDH shared secret derivation. 2014-03-22 17:06:42 +00:00
akwizgran
fc66f6ed8a Log the running time of key validation and message verification. 2014-03-22 00:30:29 +00:00
akwizgran
007ddac880 Use the Montgomery ladder multiplier to avoid side-channel attacks. 2014-03-19 22:52:53 +00:00
akwizgran
8c18773141 Write the tag immediately even if there are no packets to send. Bug #27. 2014-03-16 18:13:31 +00:00
akwizgran
b270f0e8b1 Call Thread.currentThread().interrupt() when handling interruption. 2014-03-12 21:11:11 +00:00
akwizgran
b99a503f24 Removed unnecessary conditionals from logging statements.
Very important stuff.
2014-03-12 21:00:14 +00:00
akwizgran
a2b3ef9e62 If Bluetooth is activated to add a contact, deactivate it afterwards.
Bug #47.
2014-03-10 19:06:14 +00:00