Commit Graph

1808 Commits

Author SHA1 Message Date
Torsten Grote
9aa1bbd1ed Do not show messages as unread when the conversation is open
* Only show them as unread when they arrive out of order
* Mark all messages as read when sending a message
2016-01-14 11:49:34 -02:00
akwizgran
36a850d83e Merge branch '215-remove-db-pass-when-panic' into 'master'
Delete database as panic response even when signed out

The method `runOnDbThread()` depends on an executor
that's created by roboguice at startup.
It requires to be signed in, so use a different thread instead.

Closes #215

See merge request !60
2016-01-14 08:59:55 +00:00
Torsten Grote
c8d0e64542 Delete database as panic response even when signed out
The method `runOnDbThread()` depends on an executor
that's created by roboguice at startup.
It requires to be signed in, so use a different thread instead.
2016-01-13 16:49:44 -02:00
akwizgran
d66677e097 Updated Ant build file for briar-tests. 2016-01-13 17:27:58 +00:00
akwizgran
4af522009d Merge branch 'metadata-encoder-parser-tests' into 'master'
Add tests for metadata encoder and parser as well as UTF-8 tests for BDF reader and writer

This also includes a commit to fix issues found in the metadata encoder and parser.

See merge request !58
2016-01-13 17:25:34 +00:00
akwizgran
42d1f6ded0 Use verbs instead of yes/no for lost password dialog. 2016-01-13 17:17:45 +00:00
akwizgran
1a01fc4631 Merge branch '213-use-test-annotation' into 'master'
Use @Test annotation to test for exceptions being thrown (#213)

Please note that this commit only uses the @Test annotation
where exceptions are thrown at the end of the test,
because otherwise the test would not be executed completely.

Examples for this are in DatabaseComponentImplTest where many exceptions
are thrown in close succession or in ConnectionRegistryImplTest where an
exception is thrown in the middle of the test.

Closes #213

See merge request !57
2016-01-13 16:59:36 +00:00
akwizgran
0d2e12e7ff Merge branch '210-support-panic-kit-purge' into 'master'
Support for Destructive Panic Actions

This MR is based on and requires !52.

More details are available in the commit message.

All known issues have now been fixed by new upstream releases.

See merge request !54
2016-01-13 15:37:38 +00:00
akwizgran
d8c65d0029 Capitalise panic button header, tweak wording. 2016-01-13 15:32:11 +00:00
akwizgran
04473d2018 Merge branch '204-support-panic-kit' into 'master'
Initial Support For PanicKit

This MR adds support for the PanicKit libary. It supports the basic default panic response (signing out) which does not require user interaction to work. For destructive panic responses, the user needs to "connect" the panic trigger app (e.g. Ripple) with Briar first. To secure this connection further, TrustedIntents have been added. Gradle Witness is being used to guarantee the integrity of external libraries.

Otherwise, this MR is pretty isolated and should not interfere with other parts of Briar. So merging it should be safe. However, the panic functionality still has rough edges and should not be relied on just now. It will mature along the the PanicKit library and the Ripple app.

Closes #204 


See merge request !52
2016-01-13 10:45:32 +00:00
Torsten Grote
0dfa1b5254 Add UTF-8 tests for BDF Reader and Writer 2016-01-12 17:04:59 -02:00
Torsten Grote
27cb64e936 Properly test values as expected and actual, not the other way around 2016-01-12 17:04:02 -02:00
akwizgran
4c23ceca82 Fixed stupid bugs in metadata encoder and parser. 2016-01-12 17:55:38 +00:00
Torsten Grote
b837e8b035 Use @Test annotation to test for exceptions being thrown
Please note that this commit only uses the @Test annotation
where exceptions are thrown at the end of the test,
because otherwise the test would not be executed completely.

Examples for this are in DatabaseComponentImplTest where many exceptions
are thrown in close succession or in ConnectionRegistryImplTest where an
exception is thrown in the middle of the test.
2016-01-12 15:16:34 -02:00
Torsten Grote
06ce20dba2 add common tests for MetadataParserImpl and MetadataEncoderImpl 2016-01-12 14:34:52 -02:00
Torsten Grote
63d87ae085 Support for Destructive Panic Actions
PanicKit does distinguish between two kinds of panic responses:

* default responses such as logging out which are non-destructive and
  do not require user interaction, so that the basics work without
  configuration
* destructive responses such as deleting user data. These require
  some sort of authentication to make sure they are not triggered
  by malicious apps

The second type of responses is implemented with this commit.

Authentication is done by comparing the package name
which is very weak. It requires the user to opt-in to
destructive responses and to configure from which app
to receive those (since there might be many different panic
trigger apps).

While possible to uninstall an app and install one with the same
package name afterwards, this always triggers notifications to
the user (if the attacker does not have root access).

Still that is no sufficient security for Briar's requirements,
so that TrustedIntents are used as well to make sure that the
app sending the destructive trigger is signed by a signing key
that we specified before. Currently, that is the one from the
GuardianProject and from IilabEngineering who does the Amnesty
International Panic App.

The responsibility of checking that the panic TRIGGER is
legitimate lies with the app responding to the trigger, so Briar
in this case. This commit checks whether the TRIGGER comes from
a trusted app before performing destructive actions,
but does perform the default action even when triggered from
untrusted apps.

Closes #210
2016-01-12 11:05:14 -02:00
Torsten Grote
e603b4f60e Implemented Sign Out as a first PanicKit Response
This closes #204
2016-01-12 10:49:14 -02:00
akwizgran
aa1b9328c4 Merge branch '112-metadata' into 'master'
Structured metadata. #112

Task #112 involves defining an interface between the sync protocol and its clients. To avoid the need for clients to keep their own databases, which could get out of step with the sync protocol's database, we're giving clients that ability to store metadata in the sync protocol's database.

Metadata can be associated with any message, channel, or client. Each metadata object is a simple map from strings to byte arrays. We'll provide a simple query interface to retrieve metadata and/or data by specifying a set of metadata keys. Basically we're building a shitty NoSQL database... erm, I mean, an enterprise-grade key-value store.

The basic metadata object is kind of Spartan, so this patch provides an encoder and parser for storing structured metadata. This gives clients an easy way to associate structured data with messages and channels, while leaving them the option of using their own encoding if they prefer.

This MR depends on !49.

See merge request !50
2016-01-12 12:03:39 +00:00
akwizgran
a847b30ed3 Code cleanup, complain about lack of unit tests. 2016-01-12 11:35:44 +00:00
akwizgran
ed23bd6c11 Allow nulls in BdfList, BdfDictionary.
BdfList and BdfDictionary are no longer thread-safe, they require external locking. Metadata (which is the class that will be passed across API boundaries) is still thread-safe.
2016-01-12 11:35:44 +00:00
akwizgran
d1611180fe Encoder for structured metadata. 2016-01-12 11:35:44 +00:00
akwizgran
a419948147 Parser for structured metadata. 2016-01-12 11:35:44 +00:00
akwizgran
7be7ce8eda Update data format to match BDF spec. 2016-01-12 11:35:30 +00:00
akwizgran
25c9cff8d6 Merge branch '112-transport-properties-manager' into 'master'
Transport properties manager facade, key manager refactoring. #112

Refactoring for #112: decouple the invitation and plugin code from the database with a TransportPropertiesManager facade (which will become a BSP client), and move some key management logic from the invitation code to the KeyManager. Update the integration tests to use the new FooManager facades.

See merge request !49
2016-01-12 11:35:18 +00:00
akwizgran
1bcfbc9088 Merge branch 'btp-final-crypto-changes' into 'master'
Final crypto changes for BTPv2. #111

This patch brings the implementation into line with the BTPv2 spec. Changes:

* Use BLAKE2s to generate tags
* KDF arguments for key rotation
* Frame IV format

Closes #111.

See merge request !48
2016-01-12 11:17:15 +00:00
akwizgran
3c6ead0603 Code clarity, more unit tests for ByteUtils.
Addresses comments for !48.
2016-01-12 11:10:22 +00:00
Ernir Erlingsson
68b333491a Merge branch '208-remove-private-message-activities' into 'master'
Remove Read/WritePrivateMessageActivity. #208

Removed obsolete activities and cleaned up some code.

See merge request !55
2016-01-11 22:18:33 +00:00
akwizgran
7e48267f92 Consistent styling for setup and password activities.
Also removed some unused code from BaseActivity.
2016-01-08 13:22:33 +00:00
akwizgran
90214c7f93 Removed Read/WritePrivateMessageActivity. #208 2016-01-08 13:21:42 +00:00
akwizgran
2a83cdba04 Merge branch 'password-activity-improvements' into 'master'
Improve PasswordActivity

* removing screen border visible on small screens
* showing noticeable error message on wrong password input
* showing keyboard again after entering wrong password
* making lost password link easier to recognize as link
* renaming keyboard toggle method from 'hide' to 'toggle'

See merge request !53
2016-01-08 10:07:03 +00:00
Torsten Grote
0a11c0632f introduce a hideSoftKeyboard() method and use it 2016-01-07 19:31:06 -02:00
Torsten Grote
4460d69a06 Improve PasswordActivity by
* removing screen border visible on small screens
* showing noticeable error message on wrong password input
* showing keyboard again after entering wrong password
* making lost password link easier to recognize as link
* renaming keyboard toggle method from 'hide' to 'toggle'
2016-01-07 14:15:57 -02:00
akwizgran
6e26391e03 Bumped expiry date to 1 Feb 2016. 2016-01-06 12:40:11 +00:00
akwizgran
b7860ba46c Merge branch 'use-briarrecyclerview-in-conversation-view' into 'master'
Use new BriarRecyclerView in ConversationView

This now handles progress bar and empty view itself.
With this commit, it also scrolls down on layout changes like when
keyboard is opened.

See merge request !46
2016-01-04 14:17:10 +00:00
akwizgran
033c937640 Merge branch '200-duplicate-entries-in-contactlist' into 'master'
Fix contacts duplicating itself when pressing back button in conversation view.

Normally, this should be handled by the `SortedList` in the `RecyclerView`, but it isn't for some reason. Instead of spending way too much time on finding out why, I am clearing the adapter instead (on each `activity.onResume()`) as it was done before.

Closes #200

See merge request !42
2016-01-04 14:11:59 +00:00
akwizgran
805bf39ec8 Created TransportPropertyManager facade. 2016-01-04 12:56:06 +00:00
akwizgran
7c869a6ebd Cleaned up some javadocs. 2016-01-04 12:56:06 +00:00
akwizgran
99f8d21eea Fixed a typo. 2016-01-04 12:47:49 +00:00
akwizgran
6a4aea77fb Final crypto changes for BTPv2. #111
Use BLAKE2s to generate tags.
KDF arguments for key rotation.
Frame IV format.
2016-01-04 12:42:30 +00:00
akwizgran
19bfe71f18 Merge branch 'use-blake2s' into 'master'
Use BLAKE2s for hashing, key derivation and signatures

SHA-256 is still used for password-based key derivation (will be replaced with Argon2) and Fortuna.

See merge request !47
2016-01-01 14:30:44 +00:00
akwizgran
7e115fed6d Allow output shorter than getDigestSize(). 2016-01-01 14:28:38 +00:00
akwizgran
7c1ee9ce87 Restored accidentally deleted javadoc. 2015-12-31 17:46:18 +00:00
akwizgran
90af176810 Use BLAKE2s for hashing, key derivation and signatures.
SHA-256 is still used for password-based key derivation (will be replaced with Argon2) and Fortuna.
2015-12-31 17:42:11 +00:00
Torsten Grote
027b3cd33a Fix contacts duplicating itself when pressing back button in conversation view
This is done by update existing items rather than just adding them,
because different timestamps in added items change the sorting criteria
and cause duplicates in the SortedList.

Closes #200
2015-12-31 14:17:14 -02:00
akwizgran
6d2ef508d3 Merge branch '189-blake2s' into 'master'
BLAKE2s implementation

Implementation is based on the BLAKE2b implementation from BouncyCastle, and is
therefore licensed under the BouncyCastle license (which will make future
upstreaming of the code easier).

Closes #189.

See merge request !39
2015-12-31 16:06:53 +00:00
akwizgran
affba07baa Added BLAKE2s test to Ant build file. 2015-12-31 16:04:58 +00:00
str4d
d5b347e6c9 BLAKE2s implementation
Implementation is based on the BLAKE2b implementation from BouncyCastle, and is
therefore licensed under the BouncyCastle license (which will make future
upstreaming of the code easier).
2015-12-31 16:01:33 +00:00
Torsten Grote
a4437a729a Use new BriarRecyclerView in ConversationView
This now handles progress bar and empty view itself.
With this commit, it also scrolls down on layout changes like when
keyboard is opened.
2015-12-31 13:14:33 -02:00
akwizgran
2dee821f3c Updated Ant build file for automated tests. 2015-12-31 12:05:12 +00:00
akwizgran
01dc4fb996 Merge branch '176-setupactivity-warnings-api10' into 'master'
Fix SetupActivity warnings for API 10

Closes #176.

The manual setting of the error message color also (strangely) stops the message from disappearing every second character. I'm not complaining ^_^

I guessed that the text color problem probably stopped occurring from API 14 (at the big 4.0 overhaul), but it would be great if someone could confirm.

See merge request !40
2015-12-31 12:03:44 +00:00