Commit Graph

216 Commits

Author SHA1 Message Date
akwizgran d0e402062a Unit tests for segmented encrypter and decrypter. 2012-01-13 13:06:43 +00:00
akwizgran 90e54d94e6 Encrypter and decrypter for segmented transports (untested). 2012-01-13 11:54:55 +00:00
akwizgran ab9b05448d APIs for segmented transports. 2012-01-13 10:53:23 +00:00
akwizgran 99caec9448 Refactoring.
Unidirectional transports and connections are now called
simplex rather than batch. Bidirectional transports and connections
are now called duplex rather than stream.
2012-01-11 17:00:47 +00:00
akwizgran f2de23854e Added BoundedExecutor and documented executor policies. 2011-12-10 00:59:29 +00:00
akwizgran 5ba5887565 Debugging Bluetooth threading issues. 2011-12-09 22:20:32 +00:00
akwizgran 8af7e72943 Cancel outstanding tasks and shut down the executor. 2011-12-09 21:13:53 +00:00
akwizgran cd068e89c0 Converted plugin executor to ScheduledExecutorService.
No Thread.sleep() till Brooklyn.
2011-12-09 21:02:36 +00:00
akwizgran f9f41acde9 Added a connection registry to avoid creating redundant connections. 2011-12-09 17:34:58 +00:00
akwizgran 2494ff1a1e Let the plugin determine whether to flush the output stream after each
packet.
2011-12-08 22:13:35 +00:00
akwizgran 844ae8f0a7 Plugins may dispose of resources differently depending on whether a
connection was recognised.
2011-12-08 18:56:53 +00:00
akwizgran 6962814eec Log the exception class when logging exceptions. 2011-12-08 17:28:05 +00:00
akwizgran e3242ebb06 Read the tag on a connection recogniser thread, don't block the
plugin.
2011-12-08 16:33:48 +00:00
akwizgran 6e080bb35d Dedicated executors for plugins and the connection recogniser. 2011-12-08 16:11:24 +00:00
akwizgran caf5f34828 Refactoring: moved high-level connection classes to protocol package. 2011-12-08 15:06:50 +00:00
akwizgran e2cb1027af Moved message verification into a separate thread pool. 2011-12-07 21:33:14 +00:00
akwizgran 5099979b9d Encapsulate the database thread pool and task queue. 2011-12-07 14:34:16 +00:00
akwizgran 495baf8c70 BATCH_ID and MESSAGE_ID don't need to be structs. 2011-12-07 00:38:14 +00:00
akwizgran b7c3224618 Decouple the database from IO.
This will enable asynchronous access to the database for IO threads.
2011-12-07 00:23:35 +00:00
akwizgran 45a51b4926 ExceptionHandler interface. 2011-12-06 10:58:26 +00:00
akwizgran 0b749ca9e5 Javadoc. 2011-12-06 10:53:09 +00:00
akwizgran e24a3218ca Moved message verification and DB writes off the IO thread. 2011-12-05 22:52:00 +00:00
akwizgran c8338f9866 Connection readers and writers don't need the connection context. 2011-12-02 14:23:45 +00:00
akwizgran 51d58fadad Include the frame number in the header.
This ensures the frame number is covered by the MAC, cleanly
separating encryption from authentication (previously we depended on
the encryption layer to garble frames if they were reordered).
2011-12-02 13:37:44 +00:00
akwizgran f3fdd85996 Renamed "encrypted IVs" as "tags" (actual crypto changes to follow). 2011-12-02 12:02:55 +00:00
akwizgran f7360cddde Renamed "user-defined types" as "structs" in the serialisation format. 2011-12-02 11:36:45 +00:00
akwizgran e23f646181 Cache the return value of Arrays.hashCode(). 2011-11-28 15:44:19 +00:00
akwizgran ebd6ebf902 Made TransportConfig and TransportProperties thread-safe. 2011-11-28 15:36:36 +00:00
akwizgran 9345b5c71b Avoid DB lookups where possible. 2011-11-24 22:09:04 +00:00
akwizgran 046becd388 Shutdown manager (untested on Windows). 2011-11-18 17:13:55 +00:00
akwizgran 859ece6328 Erase connection windows before discarding them.
And I rewrote the locking in ConnectionRecogniserImpl again. I hate
that class so much.
2011-11-18 15:25:30 +00:00
akwizgran dacaa4566d Minor protocol refactoring. 2011-11-18 11:27:34 +00:00
akwizgran 2b45cf0dd1 Accept connections asynchronously. 2011-11-17 18:59:34 +00:00
akwizgran 66d973bcdd Ignore expected IVs that arrive by the wrong transport.
This prevents an attacker from replaying connections to test whether a
transport endpoint has the same owner as an endpoint on another
transport (eg probing a Bluetooth device to see whether it has the
same owner as a given internet host).
2011-11-17 09:24:28 +00:00
akwizgran 01dd658200 Keep the connection windows in memory. 2011-11-16 17:57:56 +00:00
akwizgran f10512d787 Erase keys after using them. (Copies created by ciphers, etc, may
still exist.)
2011-11-16 16:22:35 +00:00
akwizgran f6ae4734ce Forward secrecy.
Each connection's keys are derived from a secret that is erased after
deriving the keys and the secret for the next connection.
2011-11-16 15:35:16 +00:00
akwizgran d02a68edfc Return a connection context for outgoing connections (the secret will
be included in this context in the near future).
2011-11-15 17:47:30 +00:00
akwizgran fabdaf5957 Remove transport ID from connection context. 2011-11-15 17:32:31 +00:00
akwizgran 9220bb3426 Key derivation function based on NIST SP 800-108. 2011-11-15 17:19:11 +00:00
akwizgran 6a15c03e81 Store the incoming and outgoing secrets separately. 2011-11-15 16:07:14 +00:00
akwizgran f41d48eb9f Made secret keys erasable from memory. 2011-11-15 14:43:06 +00:00
akwizgran 23be7fd876 Removed double-encryption of shared secrets. 2011-11-15 14:09:28 +00:00
akwizgran df054b1743 Store each connection window slot as a database row.
This is less memory-efficient but necessary for the coming forward
secrecy changes.
2011-11-15 13:08:20 +00:00
akwizgran cf49a28c95 Replaced SHA-256 with SHAd-256 to prevent length extension attacks. 2011-11-15 11:11:31 +00:00
akwizgran 72be34768b Minor refactoring. 2011-11-14 22:14:52 +00:00
akwizgran 73aa7d14d7 Split transport identifiers into two: TransportId (globally unique)
and TransportIndex (locally unique).

This is the first step towards forward secrecy. Also removed the
Writable interface and unnecessary user-defined types, moved various
constants to ProtocolConstants and renamed some classes.
2011-11-14 21:40:05 +00:00
akwizgran 42ddfb444e Added a method to check which plugins support invitations. 2011-10-29 09:52:07 +01:00
akwizgran 48d638746c Invitation API and two (untested) implementations. 2011-10-27 17:52:03 +01:00
akwizgran 7d73f9604d Added a method for getting unread message counts for all groups. 2011-10-26 17:56:35 +01:00