Commit Graph

8 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 e8fef260e6 sinttest: migrate to JUnit5, drop JUnit4
The before/after class annotations are now no longer borrowed from
JUnit.

Also some integration tests used @After and/or @Before from JUnit,
which was never supported nor had any effected. Those methods got
deleted. But since there appears to be a desire for such a
functionality in sinttest, we should consider adding one.
2020-04-12 22:21:30 +02:00
Florian Schmaus cc636fff21 Introduce Smack's Modular Connection Architecture
This is a complete redesign of what was previously
XmppNioTcpConnection. The new architecture allows to extend an XMPP
client to server (c2s) connection with new transport bindings and
other extensions.
2020-04-04 13:03: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 e98d42790a SmackReactor/NIO, Java8/Android19, Pretty print XML, FSM connections
This commit adds
- SmackReactor / NIO
- a framework for finite state machine connections
- support for Java 8
- pretty printed XML debug output

It also
- reworks the integration test framework
- raises the minimum Android API level to 19
- introduces XmppNioTcpConnection

Furthermore fixes SMACK-801 (at least partly). Java 8 language
features are available, but not all runtime library methods. For that
we would need to raise the Android API level to 24 or higher.
2019-02-05 13:18:03 +01:00
Florian Schmaus b705355e3d Add IntegrationTestRosterUtil 2018-11-11 17:10:40 +01:00
Paul Schaub 22e3f463fa
Utilize RosterIntegrationTest methods
Use RosterIntegrationTest.ensureBothAccountsAreSubscribedToEachOther() to subscribe users to another.
2018-11-11 16:32:45 +01: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