Commit Graph

81 Commits

Author SHA1 Message Date
akwizgran
3eb3f8be3d Code cleanup for the transport protocol. 2012-05-24 19:08:53 +01:00
akwizgran
d6b260ed61 Use AES/GCM instead of AES/CTR and HMAC.
This makes us Suite B compliant and saves 32 bytes per frame. The
AES/GCM implementation refuses to decrypt the frame header before
checking the MAC, so we have to use AES/CTR to peek at the header. The
header is still covered by the MAC, and we still check it after peeking!
2012-05-24 18:38:19 +01:00
akwizgran
c1133644e8 Debugging code to track down TorPuginTest failures. 2012-05-12 16:58:00 +02:00
akwizgran
c0eb71748c Removed an unnecessary allocation. 2012-02-10 16:44:18 +00:00
akwizgran
fbf5c78f91 Factory and unit test for the Tor plugin; moved slow tests into their
own ant target.
2012-02-06 23:18:35 +00:00
akwizgran
6da30ca486 Plan B: Remove error correction and reliability layers and the
consequent distinction between segments and frames.
2012-02-06 16:03:09 +00:00
akwizgran
ffe3bafce4 Tests and bugfixes for IncomingReliabilityLayerImpl. 2012-01-23 17:06:57 +00:00
akwizgran
48ceaaea2a Renamed a couple of classes. 2012-01-20 23:28:17 +00:00
akwizgran
337c1c8ac4 Unit tests for IncomingErrorCorrectionLayerImpl. 2012-01-20 19:56:18 +00:00
akwizgran
114ca203d8 Tests and bugfixes for XOR encoder and decoder. 2012-01-20 19:09:27 +00:00
akwizgran
74dd4e277f Tests and bugfixes for XorErasureDecoder. 2012-01-20 17:02:17 +00:00
akwizgran
2b737e7e53 Test and bugfixes for XorErasureEncoder. 2012-01-20 16:29:22 +00:00
akwizgran
e43ffe1ab4 Frame reordering window. 2012-01-19 23:26:26 +00:00
akwizgran
9bd0b60dec Renamed some classes. 2012-01-17 13:19:40 +00:00
akwizgran
ac136d3732 Pass segments rather than frames to/from segmented plugins. 2012-01-13 15:05:42 +00:00
akwizgran
d0e402062a Unit tests for segmented encrypter and decrypter. 2012-01-13 13:06:43 +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
f9f41acde9 Added a connection registry to avoid creating redundant connections. 2011-12-09 17:34:58 +00:00
akwizgran
0fdc69ff00 Unit tests for OutgoingBatchConnection. 2011-12-08 17:46:28 +00:00
akwizgran
caf5f34828 Refactoring: moved high-level connection classes to protocol package. 2011-12-08 15:06:50 +00:00
akwizgran
1886609bef Removed frame padding code (soon to be obsolete). 2011-12-08 14:35:52 +00:00
akwizgran
ae87100c8f Moved batch ID calculation off the IO thread. 2011-12-08 12:51:34 +00:00
akwizgran
1c41ffa7af Don't accept empty acks, batches or offers. 2011-12-07 13:32:17 +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
bb4c79322e Added WindowsShutdownManagerImplTest to ant buildfile. 2011-11-19 16:42:39 +01:00
akwizgran
046becd388 Shutdown manager (untested on Windows). 2011-11-18 17:13:55 +00:00
akwizgran
27a3f6e497 Erase known copies of keys (unit tests ensure we don't end up using
zeroed keys).
2011-11-17 09:54:24 +00:00
akwizgran
a13a1769e5 Unit test for key derivation. 2011-11-16 15:54:17 +00:00
akwizgran
6a15c03e81 Store the incoming and outgoing secrets separately. 2011-11-15 16:07:14 +00:00
akwizgran
55182528cf Q: What does the plugin manager do? A: It manages plugins. 2011-10-14 14:49:29 +01:00
akwizgran
a3a5ebc14f Removed unused exceptions. Also disabled output for ant tests. 2011-10-08 12:27:13 +01:00
akwizgran
1ee765a052 Resolve the address before binding. 2011-10-06 11:31:09 +01:00
akwizgran
3a321b0f0e Unit tests for PollingRemovableDriveMonitor. 2011-10-05 14:51:24 +01:00
akwizgran
2ce8d2a418 Fixed a race condition: start the monitor before creating files. 2011-10-05 14:09:43 +01:00
akwizgran
a773bbc320 Unit tests for UnixRemovableDriveMonitor. 2011-10-05 13:47:38 +02:00
akwizgran
d49ab73d81 Unit tests and bug fixes for removable drive finders. 2011-10-04 22:36:00 +01:00
akwizgran
18723a56ae Unit tests for the removable drive plugin. 2011-10-04 22:04:10 +01:00
akwizgran
5aa7da2048 ProtocolIntegrationTest (formerly FileReadWriteTest) doesn't need to
use a file.
2011-09-28 18:58:45 +01:00
akwizgran
9c2e3917bf Added an integration test for batch transports. 2011-09-28 14:43:23 +01:00
akwizgran
fadd95ae49 Added a test for MAX_PACKET_LENGTH. 2011-09-21 15:56:50 +01:00
akwizgran
bf01dd4f96 Folded ReadWriteLockDatabaseComponentTest into its parent. 2011-09-19 14:58:32 +01:00
akwizgran
22b8321376 Removed SynchronizedDatabaseComponent.
LockFairnessTest passes on Windows, Mac and Linux, so it's safe to use
ReadWriteLockDatabaseComponent on all those platforms. We can revisit
this issue for Android if necessary, but for now it's a waste of
effort to have two parallel implementations.
2011-09-19 14:54:29 +01:00
akwizgran
331e7e0547 Increased the maximum packet size to 1 MiB.
This should provide acceptable memory usage and database locking
granularity, while making subscription and transport updates large
enough for the incremental update issue to be kicked into the long
grass.

Removed awareness of the serialisation format from the protocol
component wherever possible, and added tests to ensure that the
constants defined in the protocol package's API are compatible with
the serialisation format.
2011-09-07 13:51:30 +01:00
akwizgran
7e4ff343ea Added PaddedConnectionWriterTest to the ant buildfile. 2011-08-19 19:48:48 +02:00
akwizgran
3084a6b058 Added optional padding to the frame format, so transports that are
vulnerable to traffic analysis can frame their data independently of
packet boundaries.
2011-08-19 14:47:16 +02:00
akwizgran
2411e2008b Frame the encrypted data independently of inter-packet boundaries and
authenticate each frame before parsing its contents. Each connection
starts with a tag, followed by any number of frames, each starting
with the frame number (32 bits) and payload length (16 bits), and
ending with a MAC (256 bits).

Tags have the following format: 32 bits reserved, 16 bits for the
transport ID, 32 bits for the connection number, 32 bits (set to zero
in the tag) for the frame number, and 16 bits (set to zero in the tag)
for the block number. The tag is encrypted with the tag key in
ECB mode.

Frame numbers for each connection must start from zero and must be
contiguous and strictly increasing. Each frame is encrypted with the
frame key in CTR mode, using the plaintext tag with the appropriate
frame number to initialise the counter.

The maximum frame size is 64 KiB, including header and footer. The
maximum amount of data that can be sent over a connection is 2^32
frames - roughly 2^48 bytes, or 8 terabytes, with the maximum frame
size of 64 KiB. If that isn't sufficient we can add another 16 bits to
the frame counter.
2011-08-19 01:46:51 +02:00
akwizgran
4497774311 Derive separate keys for each direction. 2011-08-14 12:18:16 +02:00
akwizgran
e1b9ee247c Integration test for the protocol component. 2011-08-13 16:56:00 +02:00
akwizgran
36fc34993d Lock fairness test: check that fair ReentrantReadWriteLocks don't
allow writers to starve. If this test passes on Java 5 and 6, we can
get rid of SynchronizedDatabaseComponent and merge
ReadWriteLockDatabaseComponent with DatabaseComponentImpl.
2011-08-13 15:39:09 +02:00
akwizgran
9d25a819d1 Decoupled ProtocolReader (which belongs in the protocol component)
from PacketReader (which belongs in the transport component).
2011-08-13 14:18:16 +02:00