Commit Graph

197 Commits

Author SHA1 Message Date
akwizgran
d4fa656dbb Application layer keepalives to detect dead TCP connections.
DuplexOutgoingSession flushes its output stream if it's idle for a
transport-defined interval, causing an empty frame to be sent. The TCP
and Tor plugins use a socket timeout equal to twice the idle interval to
detect dead connections.

See bugs #27, #46 and #60.
2014-12-13 12:00:40 +00:00
akwizgran
64d644d8b8 Clean up output streams in unit test.
This fixes some lint warnings and may also fix dev task #102.
2014-12-05 19:22:35 +00:00
akwizgran
d94637b5cf Removed polling from ModemPlugin. 2014-12-05 12:46:11 +00:00
akwizgran
33d36b6ec4 Skip platform-specific tests when testing on another platform. 2014-12-05 10:28:34 +00:00
akwizgran
6b4a72aea7 Added Gradle build files because Ant's too efficient for some people. 2014-11-25 14:54:34 +00:00
akwizgran
c280e213c8 Don't send tags for invitation connections. 2014-11-09 17:11:16 +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
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
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
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
39f79b55ef Ensure ciphertext is always modified in unit test. 2014-10-08 15:07:46 +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
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
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
e1d099903d Don't allow LifecycleManager to start and stop concurrently. Bug #68. 2014-05-02 15:16:53 +01:00
akwizgran
0eaf46209c Show more debugging info: system memory, VM memory and disk space. 2014-04-10 15:48:15 +01:00
akwizgran
ab76b4a9e3 Print stdout and stderr of unit tests to track down test failures. 2014-04-10 13:21:26 +01:00
akwizgran
7aa836c683 Skip tests that can't be run on the present machine. 2014-04-10 13:15:54 +01:00
akwizgran
839f67dd44 Replaced last connection time with time of last private message. 2014-04-05 18:14:36 +01:00
akwizgran
cc9e1ec300 Rigorous address validation broke a unit test. 2014-04-05 00:00:59 +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
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
1c282a8835 Show when private messages have been delivered. 2014-04-03 23:42:24 +01:00
akwizgran
0100d62a20 Test that our elliptic curve is equal to the named curve; benchmarks. 2014-03-27 10:32:49 +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
de5dac6ce3 Reset message status when contact unsubscribes from group. Dev task #68. 2014-02-27 14:24:52 +00:00
akwizgran
044c10e89f Bluetooth-only invitations: simpler and more reliable.
Of course, not all devices support Bluetooth...
2014-02-10 14:00:34 +00:00
akwizgran
71a31c2a7a Include creation time in LocalAuthor.
This allows the oldest LocalAuthor to be used as the default.
2014-02-10 12:14:09 +00:00
akwizgran
9e8bf5b1aa Set a flag in MessageHeader to indicate whether the message is local. 2014-02-09 16:02:11 +00:00
akwizgran
d53c07cb35 Don't halt on failure, run all tests. 2014-02-09 15:56:36 +00:00
akwizgran
f6360c09d4 Added utility methods for converting string to UTF-8 and vice versa. 2014-02-07 22:00:51 +00:00
akwizgran
92d5fb4f1d Compact encodings for integers, strings and byte arrays.
This adds complexity but will save a lot of bandwidth, as most of the
strings and byte arrays we want to send are less than 128 bytes.

The extra complexity isn't exposed outside of the serial component.
2014-02-07 18:50:28 +00:00
akwizgran
6296f0f790 Removed redundant call to checkEnabled() - it's called from start(). 2014-02-07 15:05:48 +00:00
akwizgran
52b29b16ba Merge branch 'jnotify-multiarch' into 'master'
Upgrade jnotify to 0.94 to support 64-bit

This upgrades to 0.94 and selects the correct native lib via ${os.arch}. The binaries are from the jnotify sourceforge download page, you can verify them. Also patched up build.xml to display stack trace when exceptions are thrown inside a test.
2014-02-07 13:03:08 +00:00
Ximin Luo
217ff30c54 update classpath for jnotify 2014-02-06 17:52:43 +00:00
akwizgran
a45d09ef5c Show whether identities are anonymous, unknown, or verified.
Dev task #52. Known but unverified identities are also supported, but
currently unused. These will be used in future for contacts who've been
introduced but not verified face to face.
2014-02-04 12:32:51 +00:00
Ximin Luo
2bdccef705 upgrade to jnotify 0.94 (patched) for 64-bit support, and improve error reporting in tests
- add a UnixRemovableDriveMonitor.checkEnabled to pre-emptively check if it's loaded
- os.arch is always x86,x86_64 on windows, i386,amd64 on linux
- source: http://www.java-gaming.org/index.php/topic,14110
- we'll deal with freebsd support when we come to it, jnotify doesn't even do this atm
2014-01-30 12:37:18 +00:00
akwizgran
d52139e99b Use JUnit's Assume to skip tests rather than returning from the tests.
This way the tests won't show up as having run if they didn't.
2014-01-28 21:55:57 +00:00