Commit Graph

31 Commits

Author SHA1 Message Date
Florian Schmaus 4120b42761 [omemo] Add OmemoManager.purgeEveryting()
This is basically the already existing method from
OmemoManagerSetupHelper.cleanUpPubSub() moved over into OmemoManager
as purgeEverything().
2021-07-06 12:31:47 +02:00
Florian Schmaus ccc785062e [extensions] Deprecate old-style PepManager PEP listeners 2020-05-25 20:32:47 +02:00
Florian Schmaus d65f2c932e Bump Error Prone version to 2.3.4 and fix new bug patterns 2020-05-24 21:10:01 +02:00
Florian Schmaus ab2d3a2b79 [core] Deprecate AbstractConnectionListener 2020-05-13 22:14:43 +02:00
Paul Schaub 48d5ef9522 Improve readability by fixing wrong indentation levels 2020-04-08 22:32:39 +02:00
Paul Schaub 6d0bf04c1e Improve Javadoc readability by adding separating lines 2020-04-08 22:32:39 +02:00
Paul Schaub a8b2446042 Fix javadoc issues 2020-04-08 22:32:39 +02:00
Florian Schmaus eb4c2c5572 s/occured/occurred/ 2019-10-30 12:02:36 +01:00
Florian Schmaus 5db6191110 Introduce StanzaBuilder
As first step to immutable Stanza types.
2019-10-25 21:41:55 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus 4249c1a845 Improve PepManager.publish()
by using PubSubManager.tryToPublishAndPossibleAutoCreate().

This also swaps the parameters of the method.

Thanks to Guus der Kinderen for suggesting this.
2019-08-28 22:59:30 +02:00
Florian Schmaus 9923268391 Remove LOCK in OmemoManager and use Manager instance instead 2019-08-06 12:48:31 +02:00
Florian Schmaus 1bce378e6d smack-omemo*: Do not swallow IOException deep within the library
Those exception are caused by I/O operations in the OmemoStore, which
is now declaring that it throws those (since it is not uncommon for
I/O operations to cause IOExceptions). After all, this is nicely
demonstrated as this change is caused by switching with this commit to
the Android API 19 compatible methods in FileBasedOmemoStore, which
throw.

The library can not decide what to do in case of those exceptions,
hence it is sensible to expose them to the user.
2019-08-05 09:31:48 +02:00
Florian Schmaus f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
Florian Schmaus 4d4f92ba86 Rename PEP to Pep 2018-08-15 20:15:57 +02:00
Paul Schaub 1f731f6318
Rework support for XEP-0384: OMEMO Encryption
Changes:

    Rework integration tests
    New structure of base integration test classes
    bump dependency on signal-protocol-java from 2.4.0 to 2.6.2
    Introduced CachingOmemoStore implementations
    Use CachingOmemoStore classes in integration tests
    Removed OmemoSession classes (replaced with more logical OmemoRatchet classes)
    Consequently also removed load/storeOmemoSession methods from OmemoStore
    Removed some clutter from KeyUtil classes
    Moved trust decision related code from OmemoStore to TrustCallback
    Require authenticated connection for many functions
    Add async initialization function in OmemoStore
    Refactor omemo test package (/java/org/jivesoftware/smack/omemo -> /java/org/jivesoftware/smackx)
    Remove OmemoStore method isFreshInstallation() as well as defaultDeviceId related stuff
    FileBasedOmemoStore: Add cleaner methods to store/load base data types (Using tryWithResource, only for future releases, once Android API gets bumped)
    Attempt to make OmemoManager thread safe
    new logic for getInstanceFor() deviceId determination
    OmemoManagers encrypt methods now don't throw exceptions when encryption for some devices fails. Instead message gets encrypted when possible and more information about failures gets returned alongside the message itself
    Added OmemoMessage class for that purpose
    Reworked entire OmemoService class
    Use safer logic for creating trust-ignoring messages (like ratchet-update messages)
    Restructure elements/provider in order to prepare for OMEMO namespace bumps
    Remove OmemoManager.regenerate() methods in favor of getInstanceFor(connection, randomDeviceId)
    Removed some unnecessary configuration options
    Prepare for support of more AES message key types
    Simplify session creation
    Where possible, avoid side effects in methods
    Add UntrustedOmemoIdentityException
    Add TrustState enum
    More improved tests
2018-06-13 12:29:16 +02:00
Florian Schmaus 9161ba9e7d Improve MamManager API 2018-06-12 08:53:18 +02:00
Florian Schmaus 31244ae982 Make PubSub elements namespace aware
Also fixes SMACK-814.
2018-04-23 20:36:41 +02:00
Florian Schmaus 74f14484e6 Smack 4.2.4
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlrTPy5fFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFI5aAf/Rb6Y+hqxiHRbsmww74rt7HfgQnOjOjz3bPhgbVH2emzBHzxsU2pBBY87
 iTfCXjXA3qQ9FzluBchLrd9EciDEXq1A/ZblYnR+kch1DK7wvVipTPWIzOHt6ahD
 q7vfS9EmmFBCRjNM4tW8zwaajWWeJAWimXoZFxuy/n+2FORnx0x5NrnIHwYvyUtf
 nY432BOiCg7l6J9sgfcoYDgP0Ot4SkdfUIgGOYonv0lzKW8HkU/OZZwEMbFhlCHU
 s0inbU5ldDDP7xXIinDqHVSKpRlSIkaOJ0zbAQLjFz8h2fCnqDGhpnNbun8Xb7l2
 agsATloOl91tlUV5D+qRWjzkx7pDxA==
 =YqLS
 -----END PGP SIGNATURE-----

Merge tag '4.2.4'

Smack 4.2.4
2018-04-15 14:48:22 +02:00
Paul Schaub e200f2ddf8
Add OMEMO to EME 2018-04-15 13:39:27 +02:00
Florian Schmaus a9ca1a0989 Enable ModifierOrder checkstyle check
Fixes SMACK-812
2018-03-29 12:35:11 +02:00
Florian Schmaus 9e11b68144 Add comment style checkstyle rule requiring a space 2017-11-20 08:53:19 +01:00
Florian Schmaus c70a1921db Use Async.go() in OMEMO PEPListener
to avoid a deadlock, since the PEP listener is synchronous.
2017-09-29 16:32:32 +02:00
Florian Schmaus 58181bab08 OMEMO: Unspaghetti PEP listener code
While I like Spaghetti, I don't like them in my code.

4 insertions, 24 deletions, *kaboom*. :)
2017-09-29 16:32:32 +02:00
Florian Schmaus 2050b2f8b9 Remove OmemoManager.resourceSupportsOmemo()
since there is currently no way to determine if a full JID supports
OMEMO.
2017-07-23 10:58:55 +02:00
Florian Schmaus 7b5eecb821 Use AbstractConnectionListener in OmemoManager
and manually inline the setConnectionListener() method.
2017-07-23 10:58:55 +02:00
Florian Schmaus 2e61e0a4d3 Use Async.go() in OmemoManager's connection listener
to prevent a timeout exception since those are executed synchronously.
2017-07-23 10:58:55 +02:00
Florian Schmaus 3a79566f1c OmemoManager: Fix typo s/defaulDeviceId/defaultDeviceId/ 2017-07-03 11:07:26 +02:00
Florian Schmaus 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
vanitasvitae e86700b040 Add OMEMO support
This commit adds the modules smack-omemo and smack-omemo-signal.
smack-omemo is licensed under the Apache license like the rest of the smack project.
smack-omemo-signal on the other hand is licensed under the GPLv3.
Due to the fact, that smack-omemo is not of much use without smack-omemo-signal,
the OMEMO feature can currently only be used by GPLv3 compatible software.
This may change in the future, when a more permissively licensed module becomes available.

Fixes SMACK-743.
2017-06-02 13:40:10 +02:00