Commit Graph

347 Commits

Author SHA1 Message Date
akwizgran
7779319f9a Merge branch '295-show-declined-introductions' into 'master'
Show relevant introduction decline responses in the conversation

* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we now show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Please note that I do not have three devices at the moment to test this MR in its entirety in practice. I created another test which is hopefully sufficient to ensure that the modifications are correct.

Closes #295 

See merge request !149
2016-04-25 12:07:13 +00:00
akwizgran
9b5d3ecb7a Added public key and placeholder onion address. 2016-04-21 16:07:51 +01:00
Torsten Grote
11e6d64e4d Show relevant decline responses in the conversation
* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Messages an introducee receives in a `FINISHED` state are now being
ignored and deleted.

Closes #295
2016-04-21 11:08:15 -03:00
str4d
5c2f56549b Refactor MessageEncrypter interface to use PublicKey and PrivateKey 2016-04-21 01:08:39 +00:00
str4d
d545aaa892 Encrypt and save crash reports, send them the next time TorPlugin start
Will currently fail at runtime; requires a public key and a server onion.
2016-04-20 23:42:46 +00:00
Torsten Grote
36ef536e82 Integration Tests for Introduction Client
* normal session where both introducees accept
* normal session where the first introducee declines
* normal session where the second introducee declines
* one session where a contact is introduced to herself
* one session where two identities of the same contact
  are introduced to each other

This introduces a new IntroductionAbortedEvent to signal when the
protocol was aborted. It is not yet used in the UI.

It closes #276
2016-04-20 11:35:51 -03: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
d205f3b0d8 Refactor the Introduction Client to avoid circular dependencies
This injects the IntroducerManager and the IntroduceeManger for easier testing
2016-04-14 12:53:22 -03:00
Torsten Grote
c5bfea2155 address issues found in final review
(except refactoring of conversation item classes)
2016-04-12 17:04:52 -03:00
Torsten Grote
90d984ee52 Ensure responses shown after requests, clarify wording, reuse transactions
When devices' clocks are out of sync, it is possible that a response is
shown before the request. This commit makes sure that the timestamp of
responses is always later than the last message in the conversation.

Some wording could be misunderstood to thing introductions were
successful even though they were not. That has been clarified.

A new database transaction was created when getting contacts and local
transport properties. This has been changed to re-use the existing
transaction.

Also addresses minor issues found in review.
2016-04-12 17:04:52 -03:00
Torsten Grote
4b7a32a5ee Find correct session state in case the same one is used twice.
The code made the assumption that a session state can be identified by
the unique session ID. However, when multiple identities from the same
device are involved, there are two sessions with the same ID running on
the device.

Hence, a second identifying criteria has to be used to uniquely identify
the correct session. Here, the ID of the group was chosen.
Unfortunately, the session state can not be cached easily anymore
leading to a small performance penalty when getting all messages for the
UI.
2016-04-12 17:04:52 -03: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
Torsten Grote
21bb23ba67 Merge branch '273-service-exceptions' into 'master'
Services should throw exceptions for startup errors

Fixes #273

See merge request !134
2016-04-06 15:51:03 +00:00
akwizgran
b480777548 Services should throw exceptions for startup errors. 2016-04-05 15:44:50 +01:00
akwizgran
2b19e4c8db Close transport connection if tag isn't recognised. #281 2016-04-05 11:37:38 +01:00
akwizgran
945b5eb1ac Create local state for clients at startup. #279 2016-04-01 17:15:35 +01:00
akwizgran
4393517f31 Merge branch '118-contact-introductions' into 'master'
Contact Introduction Backend

This MR allows you to introduce two of your contacts to each other. They both will receive an introduction with an optional message and then can accept or refuse the introduction which is presented as a notification.

When reviewing, I propose to review the individual commits separately as I took great care to split functional independent parts into separate commits. You might also want to have a look at the [Introduction Client Wiki page](https://code.briarproject.org/akwizgran/briar/wikis/IntroductionClient) to better understand what is going on before looking into the actual code.

Protocol sessions and states are not yet deleted and the UI is still missing (#253). In order to practically test this feature, the UI from !122 is needed.

See merge request !116
2016-03-31 11:26:09 +00: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
Torsten Grote
54f320465f Add information about whether Contact is active to ContactAddedEvent 2016-03-30 13:36:14 -03:00
Torsten Grote
f44cb5ff94 Add an IntroductionManager and Validator
This Introduction BSP Client uses its own group to communicate with
existing contacts. It uses four types of messages to facilitate
introductions: the introduction, the response, the ack and the abort.

The protocol logic is encapsulated in two protocol engines, one for the
introducer and one for the introducee. The introduction client keeps the
local state for each engine, hands messages over to the engines and
processes the result and state changes they return.
2016-03-30 13:36:14 -03:00
Torsten Grote
e3459fb0a3 Use given transaction when adding remote properties in TransportPropertyManager. 2016-03-30 13:36:13 -03:00
Torsten Grote
5bde14c694 Add a contactExists() method to the contactManager
This requires exposing the `containsContact()` method to the `DatabaseComponent`
and is needed for finding out efficiently whether a contact already exists.
2016-03-30 13:36:13 -03:00
Torsten Grote
e2d64e0a8c allow adding contacts within an existing transactions 2016-03-30 13:36:13 -03:00
akwizgran
e78ba2e806 Key derivation fixes, renamed a key derivation method. 2016-03-30 12:02:49 +01:00
akwizgran
a8fa6339fb Don't disable Bluetooth, always reuse the connection. 2016-03-30 10:38:38 +01:00
akwizgran
1cdba02752 Updated javadocs for database methods. 2016-03-29 16:10:40 +01:00
akwizgran
e58ca00979 Don't start transactions while holding locks. #272 2016-03-29 15:21:46 +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
701cfdba48 Extract contact exchange protocol from BT introduction protocol 2016-03-26 15:53:02 +13:00
str4d
ce7c189923 Create BQP API 2016-03-26 15:53:02 +13:00
str4d
d2d8d9d46e Implement BQP transport descriptors 2016-03-26 15:52:58 +13:00
akwizgran
65316414ea Added toString() method to TransportId. 2016-03-22 16:07:20 +00:00
Ernir Erlingsson
4da63b3800 Modified the project structure, removed module extension and went instead for a non-complete core dependency graph 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
6f233070fe Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
5aba1d79f1 Fixes after comments, also removed the CryptoComoponent from the IdentIcons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
ac5d68df81 Added dependency verifications and removed Splash header 2016-03-14 21:01:21 +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
akwizgran
c615dd1ed1 Merge branch 'bluetooth-race' into 'master'
Fix race condition when closing redundant Bluetooth sockets

The Bluetooth invitation code has a race condition: if Alice and Bob connect to each other at roughly the same time, they each consider their outgoing socket to be redundant and close it, resulting in both sockets being closed. This can be triggered pretty reliably by using two phones of the same model and pressing 'Continue' at the same time on both phones.

When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks, which Bob can detect by trying to read from both sockets.

Hopefully the Bluetooth invitation code will be retired when #117 is merged, but I'm putting this up for review in case we need to keep Bluetooth as a fallback method.

See merge request !120
2016-03-09 10:12:05 +00:00
akwizgran
efa06527c9 Moved validation interfaces into respective managers. 2016-03-08 16:22:09 +00:00
akwizgran
a4d6de0340 Added message queue manager. 2016-03-08 16:07:29 +00:00
akwizgran
c9276de399 Renamed validation hooks to incoming message hooks. 2016-03-07 18:36:30 +00:00
akwizgran
0ac67239e3 Fixed race condition when closing redundant sockets.
When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks. This fixes a race condition where each party picked a different socket and closed the other.
2016-03-07 11:50:47 +00:00
akwizgran
5998412a8a Use ClientHelper in PrivateMessageFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
d342594313 Use ClientHelper in ForumPostFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
4ddc34ee01 Added new methods to ClientHelper. 2016-03-04 21:07:33 +00:00
akwizgran
418798b1f0 Added BdfList/Dictionary getters for optional values. 2016-03-04 21:00:05 +00:00