Commit Graph

785 Commits

Author SHA1 Message Date
Jordan Rose
333d2be846 java: Fix CalledFromNative target annotations
"TYPE" is for type *uses*, not type *definitions*.
2025-06-23 10:37:55 -07:00
Alex Bakon
56c63a4838 Refactor registration errors on existing types 2025-06-20 17:14:52 -04:00
Jordan Rose
4e304bf167 javadoc-isms -> KDoc 2025-06-20 10:15:51 -07:00
Alex Bakon
8f671bd2d0 Make BackupLevel.value public 2025-06-18 14:22:14 -04:00
Jordan Rose
b2c2537277 java: Switch from javadoc to Dokka to include our Kotlin sources
The Maven publication will still contain a -javadoc jar for
consistency, but the -dokka jar is likely to have superior rendering
in practice, particularly for Kotlin-only APIs!
2025-06-18 10:57:50 -07:00
Andrew
c276f445f7 Reset for version v0.75.2 2025-06-18 12:27:34 -04:00
Alex Bakon
f59204538e Reset for version v0.75.1 2025-06-16 14:04:01 -04:00
Jordan Rose
2879220e93 Require Kyber keys/ciphertexts throughout all XDH APIs 2025-06-13 16:06:07 -07:00
Alex Bakon
2b01021d7e Add offset/length constructor for Java ECPublicKey and KEMPublicKey 2025-06-13 16:26:26 -04:00
Alex Bakon
02b786b07e Limit device ID to the range 1-127
This is already required for sealed sender messages and enforced by the server.
2025-06-13 14:18:16 -04:00
Jordan Rose
5001df1ee4 Kotlin: use explicitApi() mode 2025-06-13 10:27:37 -07:00
Jordan Rose
1b469bb6c7 Make acknowledgments platform-specific 2025-06-12 16:01:33 -07:00
Alex Bakon
881b3a4c8e Port some Java classes to Kotlin 2025-06-12 18:24:15 -04:00
Alex Bakon
a32aca9bce Remove Java Curve class 2025-06-12 17:24:31 -04:00
moiseev-signal
44c470f388 java: Synchronize close for incremental mac streams 2025-06-12 14:14:45 -07:00
Alex Bakon
3c89a5fa07 Colocate Kotlin sources with Java 2025-06-12 16:00:05 -04:00
moiseev-signal
beebd1cd20 keytrans: Add example usage for Java bridge 2025-06-11 16:35:42 -07:00
Jordan Rose
a280bc6555 Resolve an age-old X3DH test inconsistency
This known-answer test was originally ported over from
libsignal-protocol-java, but did not produce the same results. Why?
Because one of the private keys chosen by libsignal-protocol-java for
its test was unclamped, while libsignal-the-Rust-implementation always
clamps private keys as part of deserialization, not just generation.
Consequently, the public key didn't actually correspond to the private
key according to our modern libsignal.

Rather than try to line up exactly with what libsignal-protocol-java
was coincidentally doing, this commit clamps the private key, computes
the resulting public key, and verifies a new
consistent-between-both-sides outcome.
2025-06-10 16:20:08 -07:00
Andrew
82861a11e7 Reset for version v0.74.2 2025-06-10 16:59:56 -04:00
Jordan Rose
f40d20a72f Add CompletableFuture.await() helper for Kotlin clients
Test it by porting several tests from FutureTest.java to Kotlin and
using Kotlin idioms for awaiting and cancellation.
2025-06-05 12:34:15 -07:00
Max Moiseev
0410cb017a Reset for version v0.74.1 2025-06-04 14:39:48 -07:00
gram-signal
b7b8040e3a Integrate post-quantum ratchet SPQR.
This PR integrates a post-quantum ratchet (SPQR) into libsignal, using an API that maintains its own internal chain and provides per-message keys.  In doing so, it also aims to be fully backwards-compatible with current clients and stored session state.

## Backwards compatibility with current clients

Remote clients that connect to us or that we connect to may not have this integration.  If they don't, their SignalMessage wire format should still deserialize, and in doing so we'll receive an empty pq_ratchet field.  SQPR handles this internally, by downgrading the protocol version to "version 0" or "don't do anything".  Note that should we eventually want to disallow this, we can do so via increasing the `min_version` field passed into the SQPR init functions to V1.  This is also the method by which we would upgrade SQPR from v1 to a future v2, etc.

## Opt-in

The publicly facing API calls for this now expose an explicit opt-in via a passed-in `use_pq_ratchet` bool (and associated enums in language-specific APIs).  If false, they default to SQPR `v0`, IE: none.  If true, they try to set up SPQR on new sessions, but will downgrade if the remote party cannot or will not do the same.
2025-06-04 11:18:12 -07:00
Max Moiseev
40e9e89f1e Reset for version v0.73.4 2025-06-03 16:19:26 -07:00
Alex Bakon
d0c911c397 Remove proguard usage golden test 2025-06-03 15:10:05 -04:00
Alex Bakon
8782d0a406 Add bridging tests for optional UUID return 2025-06-03 13:50:26 -04:00
Alex Bakon
033abcf96f Support checking Java @CalledFromNative annotation 2025-06-02 13:02:41 -04:00
andrew-signal
6968a0b9ee Java: Fix CalledFromNative.kt compatibility with Android 5.0 2025-06-02 09:50:56 -04:00
moiseev-signal
bf096c449d keytrans: Improve errors 2025-05-30 16:00:06 -07:00
Alex Bakon
f09c862e7d Add CalledFromNative.Enforcement to check annotations 2025-05-30 13:23:35 -04:00
Jordan Rose
5444a2f949 Reset for version v0.73.3 2025-05-29 15:45:43 -07:00
Alex Bakon
eea11499fd Expand Java keep rule for exception constructors
Instead of fuzzy name matching, use inheritance from Exception as the
determiniant for whether an annotated type is a libsignal exception.
2025-05-28 17:12:00 -04:00
andrew-signal
73ba569f66 Java: Fix libsignal submodule build after refactor of Curve.java to Kotlin
Sets Kotlin compiler output to JDK_17 and makes the changes to the Curve object non-breaking
2025-05-27 09:36:32 -04:00
Alex Bakon
3181c25a23 Support building libsignal-jni with debug optimizations from Gradle 2025-05-23 14:35:46 -04:00
Alex Bakon
14adc1c74d Introduce Kotlin to the libsignal Java library 2025-05-23 09:57:41 -04:00
andrew-signal
65686e681c Java: Fix error that caused CompletableFuture to be stripped by apps using ProGuard/R8 2025-05-21 21:18:11 -04:00
Alex Bakon
e760168a51 Fixup registration service code and improve docs 2025-05-21 12:16:59 -04:00
Alex Bakon
19e85b08dc Mark chat Response as constructed from native code 2025-05-21 12:10:06 -04:00
Andrew
732d9397e9 Reset for version v0.73.2 2025-05-20 18:30:15 -04:00
Andrew
99c0c9d5c3 Reset for version v0.73.1 2025-05-20 16:32:17 -04:00
andrew-signal
1f92b82029 Add comment to testFutureFromRustCancel to explain if-statement in test 2025-05-20 16:29:54 -04:00
Andrew
a282afe43f Fix testFutureFromRustCancel 2025-05-20 15:11:19 -04:00
Alex Bakon
bf1e08b427 Check for cancellation of Rust task in test 2025-05-20 14:15:23 -04:00
Jordan Rose
0e1ec3909b bridge: Require that PreKeyBundles have Kyber pre-keys
Support for starting sessions with pre-quantum X3DH has been removed
from Swift, Java, and TypeScript. PQXDH will be required going
forward.
2025-05-19 12:25:53 -07:00
moiseev-signal
a823fd4a14 keytrans: Remove SearchResult type 2025-05-16 11:33:31 -07:00
andrew-signal
eaa32e1b4c Bridge CompletableFuture Cancellation to Android 2025-05-16 11:23:37 -04:00
Alex Bakon
5f56145e74 Bridge re-register account function 2025-05-15 16:00:29 -04:00
Jordan Rose
925fb84552 Reset for version v0.72.2 2025-05-14 17:47:03 -07:00
Alex Bakon
d51f764387 Reset for version v0.72.1 2025-05-14 11:04:33 -04:00
moiseev-signal
ef5356ba3b Java: avoid calling InputStream#readAllBytes in a test 2025-05-14 09:55:22 -04:00
moiseev-signal
15f398452b Java: fix the incremental mac test failure 2025-05-13 17:15:25 -07:00