Commit Graph

390 Commits

Author SHA1 Message Date
akwizgran
ec083d617e Upgraded Gradle to 2.13, added local Maven repo. 2016-05-12 13:36:34 +01:00
str4d
02ed01ead8 Add BQP support to LanTcpPlugin 2016-05-12 02:49:34 +00:00
akwizgran
3680cad9b8 Merge branch 'poller-refactoring' into 'master'
Poller refactoring, replace Timer with ScheduledExecutorService

* Replace Timer with ScheduledExecutorService (closes #258)
* Move automatic connection logic from PluginManager to Poller
* Reschedule polling when connections are opened or closed, making the poller more responsive to reductions in the polling interval


See merge request !180
2016-05-11 14:45:50 +00:00
akwizgran
1bd5c0b195 Merge branch 'aggressive-polling' into 'master'
Try harder to connect to contacts

* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)

Closes #262, #314. Hopefully helps with #361.

See merge request !177
2016-05-10 14:47:04 +00:00
akwizgran
f22ea85222 Merge branch '322-forum-sharing-client' into 'master'
Forum Sharing Client Backend

This MR replaces the old `ForumSharingManagerImpl` with a new one
which is based on state machines and the `ProtocolEngine`.

There is a `SharerEngine` and a `InviteeEngine` that take care of state
transitions, messages, events and trigger actions to be carried out by
the `ForumSharingManagerImpl`. This is all very similar to the
Introduction Client.

The general sharing paradigm has been changed from sharing as a state to
sharing as an action. Now the UI can allow users to invite contacts to
forums. The contacts can accept or decline the invitation. Also, the
Forum Sharing Manager is notified when users leave a forum.

Please note that you will need the UI to actually test this. It is coming up soon in another MR.

Closes #322

See merge request !170
2016-05-09 16:30:21 +00:00
str4d
0dfc735288 Store a limited number of recent LAN IP addresses 2016-05-06 16:44:52 +01:00
akwizgran
57be439f08 Code cleanup and logging. 2016-05-06 12:11:40 +01:00
akwizgran
e3bf20aed5 Reschedule polling when connections are opened or closed. 2016-05-06 12:11:40 +01:00
akwizgran
1bdd7ca761 Removed empty Poller interface. 2016-05-06 12:11:39 +01:00
akwizgran
5044f34ba9 Moved all automatic connection logic into poller. 2016-05-06 12:11:39 +01:00
akwizgran
ff8301521c Replaced Timer with ScheduledExecutorService. #258 2016-05-06 12:11:34 +01:00
akwizgran
036c5d6753 No need to poll plugins before they're enabled. 2016-05-06 12:09:30 +01:00
akwizgran
dd9bc74262 Try to reconnect on connection loss. #262 2016-05-06 12:07:56 +01:00
Torsten Grote
9bef114c35 Forum Sharing Client backend
This commit replaces the old ForumSharingManagerImpl with a new one
which is based on state machines and the ProtocolEngine.

There is a SharerEngine and a InviteeEngine that take care of state
transitions, messages, events and trigger actions to be carried out by
the ForumSharingManagerImpl. This is all very similar to the
Introduction Client.

The general sharing paradigm has been changed from sharing as a state to
sharing as an action. Now the UI can allow users to invite contacts to
forums. The contacts can accept or decline the invitiation. Also, the
Forum Sharing Manger is notified when users leave a forum.

Closes #322
2016-05-04 17:02:22 -03:00
Torsten Grote
db3226794d Remove unused clock from BdfIncomingMessageHook 2016-05-04 17:02:22 -03:00
Torsten Grote
9f9a216305 Prepare for new Forum Sharing Client
Methods for creating, adding and removing forums have been moved to the
`ForumManager`. In order to still handle removing forums properly, a
`RemoveForumHook` has been introduced.

Methods for sharing forums with all current and future contacts have
been removed along with the localGroup where this information was saved.

The `ShareForumActivity` now has the proper label.

The `SessionId` and the `ProtocolEngine` have been moved to the
`clients` package.

This addresses part of #322 and part of what has been discussed in #320.
2016-05-03 11:48:45 -03:00
akwizgran
237a89d5c2 Upgraded support library to 23.2.1. 2016-05-02 16:54:41 +01:00
akwizgran
860d06cefa Revert to support library 23.1.1. 2016-04-29 13:40:00 +01:00
akwizgran
4464a66463 Upgrade to Java 1.7 where possible. 2016-04-27 13:18:55 +01:00
akwizgran
d06a6e25cb Check that result of File#listFiles() is not null. 2016-04-27 22:22:21 +12:00
str4d
5c2f56549b Refactor MessageEncrypter interface to use PublicKey and PrivateKey 2016-04-21 01:08:39 +00:00
akwizgran
28086cd359 ECIES encryption for feedback and crash reports. 2016-04-21 11:38:46 +12:00
Torsten Grote
d0036deaf7 This addresses two types of introduction corner cases:
* force decline when two of our own identities are introduced to each
  other
* throw away introduction requests to the same identity
  (impossible to trigger from UI)

Closes #284
2016-04-20 11:31:54 -03:00
Torsten Grote
823b95f7d6 Add tests for IntroductionManager and Validator 2016-04-14 12:53:23 -03:00
akwizgran
40022b8326 Don't allow local identities to be added as contacts. 2016-04-11 13:24:25 +01:00
akwizgran
3c2378e024 Fixed indentation. 2016-04-06 17:12:27 +01:00
akwizgran
7de83b5624 Removed device ID from transport properties. 2016-04-06 17:12:20 +01:00
akwizgran
befd916eba Connect to newly activated contacts. 2016-04-06 17:10:54 +01:00
akwizgran
4e3835d2fe Merge branch 'tests-cleanup' into 'master'
Clean up tests

* Broke up ConstantsTest (#280) - the key encoding parts are now in KeyEncodingAndParsingTest, the message encoding parts are in MessageSizeIntegrationTest
* Renamed the other integration tests in briar-android-tests
* Moved the integration tests in briar-android-tests to the top-level package, as they all involve code from multiple packages
* Separated DatabaseExecutorModule from DatabaseModule so we can use a different @DatabaseExecutor in integration tests
* Merged AppModule with AndroidModule (@ernir, this touches code you're working on but I don't think there are any conflicts)
* Renamed some TestUtils methods for consistency
* Used TestUtils.getRandomBytes() where applicable

Fixes #280.

See merge request !133
2016-04-06 16:03:48 +00:00
akwizgran
f7dbfe2551 Renamed a couple of integration tests. 2016-04-06 15:56:34 +01:00
akwizgran
b480777548 Services should throw exceptions for startup errors. 2016-04-05 15:44:50 +01:00
akwizgran
205dc66572 Test cleanup. #280 2016-04-05 14:19:10 +01:00
akwizgran
bbd14f1af4 Merge branch '279-create-client-state' into 'master'
Create local state for clients at startup. #279

Most of the clients we've written so far use private groups shared with individual contacts and/or a local group that's not shared with anyone. To make it easier to ensure that the necessary groups exist when we need them, this patch allows clients to register startup hooks for creating their local state.

Fixes #279.

See merge request !131
2016-04-04 15:07:37 +00:00
akwizgran
8850a2ad61 Merge branch 'non-reentrant-db-lock' into 'master'
Don't allow reentrant transactions

The database's transaction lock is reentrant, meaning that a thread that's already holding the lock can acquire it again. This would allow a thread that already has a transaction in progress to start another transaction, which could cause transaction isolation issues and/or lock timeouts on the database's internal locks.

Check that the current thread isn't already holding the lock when starting a transaction.

See merge request !127
2016-04-04 15:06:22 +00:00
akwizgran
945b5eb1ac Create local state for clients at startup. #279 2016-04-01 17:15:35 +01:00
akwizgran
db6c813522 Merge branch '117-qr-contacts' into 'master'
BQP with QR codes

This MR implements BQP for key agreement over short-range transports. It also implements the Android UI for using BQP with QR codes.

Closes #117.

See merge request !84
2016-03-31 11:21:02 +00:00
akwizgran
7e3d3625aa Don't allow reentrant transactions.
The database's transaction lock is reentrant, meaning that a thread that's already holding the lock can acquire it again. This would allow a thread that already has a transaction in progress to start another transaction, which could cause transaction isolation issues and/or lock timeouts on the database's internal locks.

Check that the current thread isn't already holding the lock when starting a transaction.
2016-03-31 11:02:52 +01:00
akwizgran
89d25d35d2 Save queue state before delivering message. #272 2016-03-30 17:15:45 +01:00
akwizgran
e58ca00979 Don't start transactions while holding locks. #272 2016-03-29 15:21:46 +01:00
akwizgran
685a864b43 Unit tests for transaction isolation. #272 2016-03-28 13:52:54 +01:00
akwizgran
1855dbbd2d Use a lock to ensure transaction isolation. #272 2016-03-28 13:52:12 +01:00
akwizgran
9714713d73 Add transports to DB during startup. #269 2016-03-28 13:47:23 +01:00
akwizgran
0417639410 Merge duplex and simplex plugin config classes. 2016-03-28 11:28:46 +01:00
str4d
5ff7adcebf Test BQP implementation 2016-03-26 15:53:02 +13:00
akwizgran
f20a1e8dfe Fix merge problems in TransportPropertyValidatorTest. 2016-03-16 15:37:54 +00:00
akwizgran
89ca0e5a26 Merge branch 'property-validator-test' into 'master'
TransportPropertyValidatorTest

Tests for the TransportPropertyValidator ValidateMessage call.

See merge request !110
2016-03-16 14:53:00 +00:00
Ernir Erlingsson
11bfa212cc minor tweaks 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
10764d727b rebased with master 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
1be400eb84 Switched Roboguice/Guice out for Dagger 2 2016-03-14 21:01:21 +01:00
Torsten Grote
e8ad11210c Merge branch '266-message-queues' into 'master'
Message queues. #266

A message queue is a group shared by two devices that delivers messages from each device to the other in order. The first 64 bits of the message body contain a sequence number that's incremented for each message sent in a given direction. The incoming and outgoing sequence numbers and information about any messages received out of order and waiting to be delivered are stored in the group metadata.

See merge request !121
2016-03-14 14:56:43 +00:00