Commit Graph

62 Commits

Author SHA1 Message Date
Torsten Grote
e87c301e3a Add more introduction tests for fake MAC and modified timestamp 2016-09-26 13:31:00 -03:00
akwizgran
4be1c1bb7d Include stream number in stream header nonce. 2016-09-20 15:27:01 +01:00
akwizgran
8a3e5bfb50 Refactor ValidationManager and fix some bugs. #619 2016-09-09 18:03:14 +01:00
Torsten Grote
3e39ad8a68 Add one introduction test for modified response message 2016-09-02 11:49:10 -03:00
Torsten Grote
6d7e0aab07 Reblogging and Comment UI 2016-09-02 11:53:08 +01:00
akwizgran
d8a9d83caf Merge branch '494-implement-backend-for-reblogging-and-blog-comments' into 'master'
Add support for comments and reblogging to Blog Client

Comments and reblogs need to depend on the post they refer to.
Since message dependencies are limited to one group,
the post and also the comments need to be wrapped
when commented on or reblogged to another blog (and group).

For this reason, in addition to comments, two new wrapping message types
are introduced. They retain all data of the original messages and allow
for reconstruction and signature verification.

This MR breaks backwards compatibility with old blog posts.
It removes the content type, title and parent ID from the post.

Furthermore, it includes one commit that replaces the `Message` in `MessageSharedEvent` with a `MessageId`.

Closes #494

See merge request !285
2016-08-30 23:09:31 +00:00
Torsten Grote
fc5a7290e3 Calculate and verify signature and MAC for Introduction ACKs
Before the introducee sends her ACK,
she derives a master key from the ephemeral shared secret as before.

Two nonces and a MAC key are then derived from the master key.
The local introducee signs one of the nonces and calculates a MAC
over her own identity public key, ephemeral public key,
transport properties and timestamp.
The local introducee includes the signature and MAC in her ACK.

On receiving the remote introducee's ACK,
the local introducee verifies the signature and MAC.
Should the verification fail, an ABORT is sent to the introducer and
the remote introducee that was added as inactive is deleted again.
2016-08-30 19:58:54 -03:00
Torsten Grote
7db0e4472a Introduction Client: Add MAC and signature to ACK message
The MAC and signature are not yet generated and verified.
This will happen in a later commit.
2016-08-30 19:25:53 -03:00
Torsten Grote
3dd3a18694 Add support for comments and reblogging to Blog Client
Comments and reblogs need to depend on the post they refer to.
Since message dependencies are limited to one group,
the post and also the comments need to be wrapped
when commented on or reblogged to another blog.

For this reason, in addition to comments, two new wrapping message types
are introduced. They retain all data of the original messages and allow
for reconstruction and signature verification.

This commit breaks backwards compatibility with old blog posts.
It removes the content type, title and parent ID from the post
message structure.
2016-08-29 13:37:20 -03:00
akwizgran
c5f0272621 Merge branch '597-gradle-connectedcheck-fails-due-to-method-limit' into 'master'
Cleanup Gradle and Proguard to fix connectedCheck

Closes #597

See merge request !284
2016-08-24 17:22:30 +00:00
Torsten Grote
e690bcb3cc Add introduced contacts as UNVERIFIED
Closes #580
2016-08-19 12:31:00 -03:00
Torsten Grote
bcf7488afd Cleanup Gradle and Proguard to fix connectedCheck 2016-08-11 14:54:31 -03:00
akwizgran
44d13ef28e Merge branch '579-unsubscribe-from-shared-blogs' into 'master'
Allow unsubscribing from shared blogs

Only personal blogs from non-contacts can be removed.
This also adds integration tests that check the conditions under which blogs can actually be removed.

Closes #579

See merge request !268
2016-08-05 17:36:36 +00:00
Torsten Grote
1ec56fa3ef Allow unsubscribing from shared blogs
Only personal blogs from non-contacts can be removed.
This also adds integration tests that check if blogs can actually be removed.

Closes #579
2016-08-05 14:08:09 -03:00
Torsten Grote
17db03d40a Return proper Invitation objects in SharingManager
Fixes #470
2016-08-05 13:07:16 -03:00
akwizgran
adc85dab7e Merge branch '575-fix-sharerleavesbeforeresponse-test' into 'master'
Fix SharerLeavesBeforeResponse Integration Test

Closes #575

See merge request !266
2016-08-05 15:01:10 +00:00
Torsten Grote
16da3f2cab Fix SharerLeavesBeforeResponse Integration Test
Closes #575
2016-08-03 18:15:14 -03:00
Torsten Grote
a69a4028b0 Fix Blog Sharing Backend and Add Blog Sharing Integration Tests 2016-08-03 13:01:24 -03:00
Torsten Grote
64b596d0f9 Show Responses to Forum Invitations in Private Conversation
Closes #472
2016-08-01 12:13:51 +01:00
Torsten Grote
c577efacbe Show all Forum Invitations, not only the first 2016-07-07 14:48:28 -03:00
Torsten Grote
fa5304c145 Add tests to ensure Forum Posts are synchronized both ways
even after re-sharing an existing forum.
2016-07-07 14:48:06 -03:00
Torsten Grote
f7965edc71 Add Blog Manager Integration Test 2016-06-28 14:43:55 -03:00
Torsten Grote
59320f02b7 Remove MAX_GROUP_DESCRIPTOR_LENGTH
Closes #441
2016-06-22 11:47:38 -03:00
str4d
9ae64124d3 Factor out generic sharing code from ForumSharingManger 2016-06-18 19:02:48 +12:00
Torsten Grote
4acb59b22a Address Race-Condition when Two Contacts Share Same Forum
with each other at the same time.

Closes #388
2016-06-02 14:02:32 -03:00
str4d
7ac7fae30e Update comments 2016-05-28 00:16:24 +00:00
Torsten Grote
d3b83a50a6 Let the ForumValidator return parent posts as dependency
and add integration tests that make sure that dependencies are handled
properly.
2016-05-26 13:49:59 -03:00
Torsten Grote
5561532c5d Implement new message validation logic
that handles message dependencies reported from clients.

The MessageValidatedEvent has been renamed into a MessageDeliveredEvent
since there were no real use cases for the former any more.
2016-05-26 13:49:59 -03:00
Torsten Grote
b03d0a206b Add Message Dependencies to Database
This adds a new table to the database to hold message dependencies.
It introduces two more message states: pending and delivered
The valid column in the database was renamed to state to better reflect
its new extended meaning.

The DatabaseComponent was extended with three methods for:
* adding dependencies
* getting dependencies of a message
* getting messages that depend on a message (dependents)
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

In order to reflect the new states, things that were previously true for
VALID messages have been changed to now be true for DELIVERED messages.

Since pending messages should not be available to clients, many database
queries have been modified to only return results for delivered
messages.

All added methods and changes should come with updated unit tests.

Please note that the database version was bumped in this commit.
2016-05-26 13:49:03 -03:00
Ernir Erlingsson
21b237a629 ForumManager: Added parent id to metadata and a unit test 2016-05-24 15:12:37 -03:00
Torsten Grote
b13bf66165 Add a new activity that shows sharing status of forum
The new activity shows who you are sharing a forum with and who shares a
forum with you. It is accessible from the overflow menu when in a forum.

Closes #398
2016-05-19 11:42:05 -03:00
Torsten Grote
38a4f73cdc Handle invitations to the same forum by multiple contacts
Closes #391
2016-05-19 11:34:28 -03:00
Torsten Grote
aad9f5142b Extract ForumFactory from ForumManager
The code for creating forums in ForumManager was used by
ForumSharingManager and also needed by InviteeEngine.
This extracts it into its own class.

Closes #375
2016-05-16 16:56:44 -03:00
Torsten Grote
0b67ec9201 Merge branch '372-clean-up-introduction-session-states-when-removing-contact' into 'master'
Clean up Introduction Session States

...for introducer when both introducees have been deleted.

It can't be deleted when only one introducee is removed, because then all messages in the private conversation with the other introducee will disappear, because their corresponding session state can't be found anymore.

Closes #372

See merge request !189
2016-05-16 13:18:57 +00:00
Torsten Grote
db4b79fcae Clean up Introduction Session States
for introducer when both introducees have been deleted.

Closes #372
2016-05-12 18:21:18 -03:00
akwizgran
ec083d617e Upgraded Gradle to 2.13, added local Maven repo. 2016-05-12 13:36:34 +01:00
akwizgran
8ceaabddf4 Fixed dependencies of ForumSharingIntegrationTest. 2016-05-11 17:23:53 +01: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
d4abfe77a1 Merge branch '339-forum-sharing-integration-tests' into 'master'
Forum Sharing Integration Tests

This adds integration tests for these cases:
* normal invitation session where invitee accepts
* normal invitation session where invitee declines
* session where invitee leaves again after she joined
* session where sharer leaves after invitee has joined
* session where sharer leaves before invitee can respond
* sharer reuses the session ID of the previous session
* after accepting the invitation, the invitee invites the sharer to the same forum
* after session contacts delete each other and session states get cleaned up

Closes #339

See merge request !173
2016-05-10 14:46:02 +00:00
akwizgran
ff8301521c Replaced Timer with ScheduledExecutorService. #258 2016-05-06 12:11:34 +01:00
Torsten Grote
685e1422a5 Do not allow session ID reuse and clean up sessions for introducee
It was possible that a malicious introducer sends new request with the
same session ID that was used previously and thus causing introducees to
have multiple states for the same session ID.
This commits prevents that from happening and adds an integration test
for that scenario.

Also if an introducee removes an introducer, all past session states
will be deleted from the database. For this, a test was added as well.

Closes #371
Closes #372
2016-05-04 20:39:22 -03:00
Torsten Grote
49c9af27b9 Forum Sharing Integration Tests
This adds integration tests for these cases:
* normal invitation session where invitee accepts
* normal invitation session where invitee declines
* session where invitee leaves again after she joined
* session where sharer leaves after invitee has joined
* session where sharer leaves before invitee can respond
* sharer reuses the session ID of the previous session
* after accepting the invitation, the invitee invites the sharer to the same forum
* after session contacts delete each other and session states get cleaned up

Closes #339
2016-05-04 17:04:42 -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
9b060c74b6 Upgraded build tools. 2016-04-29 11:34:56 +01:00
akwizgran
3bfef877ec Upgraded support library. 2016-04-27 18:17:50 +01:00
akwizgran
efd9976ade Upgraded Gradle to 2.10, Android plugin to 2.1.0. 2016-04-27 18:03:00 +01:00
akwizgran
4464a66463 Upgrade to Java 1.7 where possible. 2016-04-27 13:18:55 +01:00
akwizgran
e9f77ecd37 Use assertEquals() for more informative failure messages. 2016-04-25 17:05:22 +01:00