Commit graph

349 commits

Author SHA1 Message Date
Daniel Gultsch b135486bb4 prevent crash when deleting account on servers that don't support omemo 2019-12-02 13:21:18 +01:00
Daniel Gultsch e0b5010f24 don’t mark pgp encrypted files received from dino as deleted 2019-10-11 15:37:41 +02:00
Daniel Gultsch 9276eff1db delete omemo keys when deleting account 2019-09-28 21:52:07 +02:00
Daniel Gultsch abe01f18f2 improved logging for messages waiting for join 2019-09-19 10:00:50 +02:00
Daniel Gultsch 4cd652884c do not finish or repair sessions for untrusted senders
finishing (sending a key transport message in response to pre key message) as
well as reparing sessions will leak resource and availability and might in
certain situations in group chat leak the Jabber ID.

Therefor we disable that. Leaking resource might not be considered harmful by
a lot of people however we have always doing similar things with receipts.
2019-09-15 11:49:58 +02:00
Daniel Gultsch e395da18bf when parsing omemo messages ensure we only find one element 2019-09-12 12:43:11 +02:00
Daniel Gultsch 9bf5fb98ac show language in message bubble if multiple language variants were received
XML and by inheritence XMPP has the feature of transmitting multiple language
variants for the same content. This can be really useful if, for example, you
are talking to an automated system. A chat bot could greet you in your own
language.

On the wire this will usually look like this:

```xml
<message to="you">
  <body>Good morning</body>
  <body xml:lang="de">Guten Morgen</body>
</message>
```

However receiving such a message in a group chat can be very confusing and
potentially dangerous if the sender puts conflicting information in there and
different people get shown different strings.

Disabeling support for localization entirely isn’t an ideal solution as on
principle it is still a good feature; and other clients might still show a
localization even if Conversations would always show the default language.

So instead Conversations now shows the displayed language in a corner of the
message bubble if more than one translation has been received.

If multiple languages are received Conversations will attempt to find one in
the language the operating system is set to. If no such translation can be
found it will attempt to display the English string.

If English can not be found either (for example a message that only has ru and
fr on a phone that is set to de) it will display what ever language came first.

Furthermore Conversations will discard (not show at all) messages with with
multiple bodies of the same language. (This is considered an invalid message)

The lanuage tag will not be shown if Conversations received a single body in
a language not understood by the user. (For example operating system set to
'de' and message received with one body in 'ru' will just display that body as
usual.)

As a guide line to the user: If you are reading a message where it is important
that this message is not interpreted differently by different people (like a
vote (+1 / -1) in a chat room) make sure it has *no* language tag.
2019-09-12 10:12:51 +02:00
Daniel Gultsch a4665d4657 made domain verifier case insensitive. fixes #3495 2019-07-20 17:51:37 +02:00
Daniel Gultsch 49224335fc attempt to unregister when receiving push for channel no longer joined
when receiving a FCM push message for a channel the user is no longer in (this can happen when the disable command failed) an attempt will be made to explicitly unregister from the app server (which in turn will then send item-not-found on next push)
2019-06-26 17:40:12 +02:00
Daniel Gultsch b2ea91909b introduced type private_file_message to handle attachments in PMs. fixes #3372 2019-04-27 11:46:43 +02:00
Daniel Gultsch ad64058d25 hide lock icon in channels; modify muc user context 2019-02-07 13:18:42 +01:00
Daniel Gultsch e9bf2b464c explicitly set type=images for all media with an image mime type
this is in preperation to be able to query the database for all images
2019-01-12 09:01:35 +01:00
Daniel Gultsch 7cabb2c377 check if encrypted pgp file get deleted 2019-01-10 21:24:24 +01:00
Daniel Gultsch 52afcac230 mark deleted files in database and not query them when querying for media 2019-01-10 14:52:27 +01:00
Daniel Gultsch 96e3546904 put images into MessageStyle notifications 2019-01-09 12:47:09 +01:00
Daniel Gultsch dac088428c handle decrypting/encrypting of omemo messages with duplicate device ids 2019-01-05 15:34:19 +01:00
Daniel Gultsch acea062abc fixed dead lock when sending pgp messages from quick reply. fixes #3246 2018-12-13 19:29:16 +01:00
Daniel Gultsch bcfd3f20c2 postpone prekey removal and republish to after mam 2018-12-05 10:42:56 +01:00
Daniel Gultsch c02676ea4c implement self healing omemo
after receiving a SignalMessage that can’t be decrypted because of broken sessions
Conversations will attempt to grab a new pre key bundle and send a new PreKeySignalMessage
wrapped in a key transport message.
2018-12-02 14:41:29 +01:00
Daniel Gultsch 1de385dcb9 set access model to open when publishing avatar. fixes #3291 2018-11-25 20:58:48 +01:00
Daniel Gultsch 2e0b26a5ab revert 12 byte ivs that got commited by accident 2018-11-21 16:44:24 +01:00
Daniel Gultsch 03d5aa8aeb show 'show password' toggle for all magically created accounts. make quicksy accounts magically created 2018-11-20 21:33:43 +01:00
Daniel Gultsch 2fa629d113 create api calls 2018-10-31 13:33:55 +01:00
Daniel Gultsch a3744ce4f8 improve openkeychain error reporting 2018-10-25 18:16:02 +02:00
Daniel Gultsch 409bf3c0cb use bouncycastle provider up to api 27
apparently using conscrypt on Android below version 7? throws an exception when using 16 byte IVs.
so we now use BC when ever possible (excluding api 28)

we don’t know why Conscrypt behaves differently on various android versions
2018-10-11 04:36:37 +02:00
Daniel Gultsch ce46b36c33 go back to 16 byte IVs for OMEMO
clients like Dino can’t handle 12 byte IVs
2018-10-04 22:32:42 +02:00
Daniel Gultsch bfa63e13c5 added a few TODOs in regards to the handling of inactive devices 2018-10-04 18:48:45 +02:00
Daniel Gultsch 23282484d6 prevent race condition when fetching device ids 2018-10-03 22:03:47 +02:00
Daniel Gultsch 4c08ba8d03 use 12 byte IV for omemo and http upload 2018-10-03 17:44:48 +02:00
Daniel Gultsch 7fa8811f64 refresh ui after device list update only if list has changed 2018-10-03 11:53:02 +02:00
Daniel Gultsch d4b98c9aff made xmpp domain verifier verify wildcard domains where domain is a sub.sub domain 2018-10-01 17:08:23 +02:00
Daniel Gultsch 6121217df5 fixed auth 2018-09-26 10:39:36 +02:00
Sam Whited ef4cfacaf4 Fix auth when upgrading from SCRAM-SHA-1 to -256 (#3192) 2018-09-26 10:19:54 +02:00
Daniel Gultsch 67e7d2cf9e do not use BC provider on android 22+ 2018-09-17 17:47:36 +02:00
Daniel Gultsch a1f933924c open trust key screen when download is in progress 2018-07-07 08:53:11 +02:00
Daniel Gultsch e6532e739a do not include white listed domains in room list. fixes #3082 2018-06-22 20:25:50 +02:00
Daniel Gultsch c8a0bf7090 OMEMO: remove omemo device from own list if bundle is broken 2018-05-28 22:08:20 +02:00
Daniel Gultsch 5b41906328 do not include body in simple status updates to not trigger fts update 2018-05-10 10:47:28 +02:00
Daniel Gultsch 18a8a6e5ac make session completion work with untrusted devices as well 2018-05-09 09:24:31 +02:00
Daniel Gultsch 7b3d871f28 improved logging for node configuration change 2018-05-03 22:44:28 +02:00
Daniel Gultsch d3b20544c9 do not invoke onPushFailed() on timeout 2018-05-01 17:35:29 +02:00
Daniel Gultsch 35020702fb very much unoptimized search functionality 2018-04-26 13:22:31 +02:00
Daniel Gultsch 7fd25abea2 code cleanup in AxolotlService.fetchDeviceIds() 2018-04-12 08:55:50 +02:00
Daniel Gultsch aff2b33e27 load currently open conversation faster 2018-04-11 18:07:40 +02:00
Daniel Gultsch bda95bc571 make error message for 'not encrypted for this device' 2018-04-04 18:21:22 +02:00
Daniel Gultsch 85caaf084b create dedicated exception for not encrypted for this device 2018-04-04 09:11:53 +02:00
Daniel Gultsch a6539be52b introduced tri state omemo setting (off by default, on by default, always) 2018-03-27 15:35:53 +02:00
Daniel Gultsch dccd3f1c8e figure out fallbacks with omemo source id 2018-03-22 13:26:35 +01:00
Daniel Gultsch 64f040b631 offer a more convienient way to disable omemo from trust keys dialog 2018-03-15 13:37:08 +01:00
Daniel Gultsch 1accf9d961 migrate to xmpp-addr 2018-03-07 22:30:36 +01:00
Daniel Gultsch 78fd19195d finished 'Set Status Message' dialog 2018-03-07 22:30:36 +01:00
Daniel Gultsch 6b55f05e27 don't send messages in callback 2018-03-07 22:30:35 +01:00
Daniel Gultsch bf6b54a7aa get rid of OTR 2018-03-07 22:30:34 +01:00
Daniel Gultsch de0272fd1a integrate trust manager into conversations 2018-03-07 22:30:33 +01:00
Daniel Gultsch bcd00bb517 discover file extension in original filename from pgp 2018-01-29 01:40:02 +01:00
Daniel Gultsch a33984acc5 encrypt muc PM only to actual recipient 2018-01-27 20:55:43 +01:00
Daniel Gultsch be70eb5650 improvements for self messages
* fix omemo in group chats w/o participants
* don't create two axolotl messages when messaging self
* fix read marker for self messages
2018-01-27 10:45:05 +01:00
Daniel Gultsch 3e111e7f58 allow axolotl header to be empty in empty mucs 2018-01-27 09:15:47 +01:00
Daniel Gultsch eee5d885ba make chat markers opportunistic in private mucs 2018-01-22 23:21:24 +01:00
Daniel Gultsch 6009b8ebf0 disable offline messages. postpone prekey handling until after mam catchup 2018-01-19 18:17:13 +01:00
Daniel Gultsch 036dd82698 properly handle key transport messages. use prekeyparsing only when that attribute is set 2018-01-18 20:58:55 +01:00
Daniel Gultsch 127557df56 show pep as available if omemo_all_access has been installed on server 2017-12-18 13:47:53 +01:00
Daniel Gultsch e0ec6ad8b6 fixed omemo device list not getting annouced on empty list 2017-12-18 13:18:58 +01:00
Daniel Gultsch 782b8fb744 fixup for pep omemo notification dedup 2017-12-13 20:28:30 +01:00
Daniel Gultsch 328c6dea0f fixed workaround that allowed us to expire devices 2017-12-07 14:47:21 +01:00
Daniel Gultsch 97821f0633 possible fix for retry loop on pgp key annoucement 2017-12-05 19:16:53 +01:00
Daniel Gultsch 75b4926025 fixed publish-options migration 2017-12-01 18:54:39 +01:00
Daniel Gultsch 8696cf2235 PgpService: feed result intent back into decryption 2017-11-22 13:36:10 +01:00
Daniel Gultsch 013822fe82 excute db read and writes on different threads 2017-11-16 15:53:03 +01:00
Daniel Gultsch 57c11d42d5 create a new axolotl service when the account jid changes 2017-08-10 22:34:03 +02:00
Daniel Gultsch 0da2f1ed3f prevent users from editing their account jid after successful login 2017-08-10 22:34:03 +02:00
Daniel Gultsch 768eadde36 use random string generator instead of BigInteger in DigestMd5 2017-08-01 12:27:26 +02:00
Daniel Gultsch e11277c70f use base64 instead of base36 when creating random strings 2017-07-30 11:39:47 +02:00
Daniel Gultsch f5da4791ad avoid unnecessary roster sync in OMEMO code. fixed startup performance regression 2017-07-29 13:50:32 +02:00
Daniel Gultsch 837c212931 refresh omemo activity after failing to fetch keys due to lack of ids 2017-07-28 18:37:07 +02:00
Daniel Gultsch d6e51288c3 Merge pull request #2564 from yushijinhun/fix-decryption-blocked
Give up PGP decryption when intent is cancelled
2017-07-25 09:20:51 +02:00
yushijinhun 48147b7fd1
Give up PGP decryption when intent is cancelled
When receiving a PGP message which is not encrypted with YOUR key,
OpenKeychain shows a dialog, which tells you the private key to decrypt
the message is unavailable. However, Conversations won't give up
decrypting the message. So whether the subsequent messages are
decryptable or not, the decryption is blocked at the current message.
The commit fixes the bug in this way: Give up the current message when
the decryption intent is cancelled, so that subsequent messages can be
handled.
2017-07-25 15:09:18 +08:00
Daniel Gultsch 432598f896 Merge branch 'bugfixes' 2017-07-23 07:53:09 +02:00
Daniel Gultsch c8bd5bc1f5 made OF selfSigned() workaround only available >=kitkat
this undos 8a729061d5. as it turns out 4.1
and 4.0 only break when checking if a cert is self signed.
2017-07-23 07:47:39 +02:00
Daniel Gultsch 85dc0c284d made omemo always available but in public mucs 2017-07-18 12:51:15 +02:00
Daniel Gultsch da87eac48e provide upgrade path for accounts with publish-options 2017-07-18 12:51:15 +02:00
Daniel Gultsch 9a57673130 use publish-options instead of always pushing node configuration 2017-07-18 12:51:15 +02:00
Daniel Gultsch 8d6b2074cb let hasPendingFetches() return true when fetching device ids 2017-07-18 12:51:15 +02:00
Daniel Gultsch 7a2856ac86 fetch required device ids on demand 2017-07-18 12:51:15 +02:00
Daniel Gultsch f7258d16e1 explicitly fetch device ids before building sessions in single mode conversation 2017-07-18 12:51:15 +02:00
Daniel Gultsch 25e993693f change access model of omemo pep nodes after every publish 2017-07-18 12:51:15 +02:00
Daniel Gultsch 6c95897f09 fetch device ids for muc members w/o known devices 2017-07-18 12:51:15 +02:00
Daniel Gultsch 8a729061d5 use CN-workaround for pre-kitkat 2017-07-17 23:13:55 +02:00
Daniel Gultsch 217335703c fix regression introduces with OF fix. properly fall back to common name 2017-07-17 21:11:15 +02:00
Daniel Gultsch 8afe7efc2c workaround for OpenFire: check CN first in self signed certs
The self signed certificates created by OpenFire (Not sure if other
certs are affected as well) will crash the Java/Android TLS stack when
accessing getSubjectAlternativeNames() on the the peer certificate.

This usually goes unnoticed in other applications since the
DefaultHostnameVerifier checkes the CN first. That however is a
violation of RFC6125 section 6.4.4 which requires us to check for the
existence of SAN first.

This commit adds a work around where in self signed certificates we
check for the CN first as well. (Avoiding the call to
getSubjectAlternativeNames())
2017-07-16 11:05:25 +02:00
Daniel Gultsch cbce73c301 fixed fingerprint trust (was messed up after library upgrade) 2017-06-25 18:18:13 +02:00
Daniel Gultsch 2ed71df01a also check for hostname in in certs if hostname is from trusted source 2017-06-21 23:40:01 +02:00
Daniel Gultsch 24768d051d upgrade to signal-protocol-java. thanks @ysangkok
fixes #1384
closes #2509
2017-06-18 16:36:30 +02:00
Daniel Gultsch f98888d796 display open pgp key id in account details and allow to delete. fixes #2470 2017-05-04 13:02:46 +02:00
Daniel Gultsch cc1402442a don't load signed prekeys on startup 2017-05-04 11:03:58 +02:00
cijo-saju 3467a67e75 Removed unused imports from entire project. 2017-04-12 20:24:36 +05:30
Daniel Gultsch 99565a6876 treat URL as file if URL is in oob or contains key 2017-04-05 22:35:42 +02:00
Daniel Gultsch 0c0ff882a9 make x509 verification node world readable 2017-02-24 19:58:46 +01:00
Daniel Gultsch 53241f2ef1 add explicit encryption hints to outgoing messages 2017-01-26 19:19:08 +01:00
Sam Whited bfc2cffc2f Add SCRAM-SHA-2 support 2017-01-15 23:43:44 -06:00