Commit Graph

405 Commits

Author SHA1 Message Date
Alex Konradi
72ccec8cdd Fix java tests
- use int instead of promoting to long
- add missing return type to fix compilation
 - run auto-formatter

Also add the check that would have caught all of these to CI
2024-01-10 14:48:13 -05:00
Jonathan Klabunde Tomer
c3cb6ed0bf expose non-copying method on SealedSenderMultiRecipientMessage to get message size for a recipient 2024-01-09 11:28:12 -08:00
Jordan Rose
4a69727457 Bump to version v0.38.0 2024-01-05 11:04:43 -08:00
Jordan Rose
31babcbd68 Bump to version v0.37.0 2023-12-13 15:57:14 -08:00
Jordan Rose
88a25e889e Collect acknowledgments for libsignal's Cargo dependencies 2023-12-11 16:39:33 -08:00
Jordan Rose
0d09a8352c Add GroupSendCredential
This credential is issued by the group server and presented to the
chat server to prove that the holder is a member of *some* group with
a known list of people. This can be used to replace the access key
requirement for multi-recipient sealed sender sends.
2023-12-11 13:45:12 -08:00
Jordan Rose
16653ffea1 SSv2: Add send support for excluded recipients 2023-12-11 12:36:54 -08:00
Jordan Rose
6a2ebfdabf java: Fix SenderKeyDistributionMessage.getDistributionId()
...which was using the wrong untyped Native function!
2023-12-08 12:11:25 -08:00
Jordan Rose
1229846d06 java: Convert GroupCipherTest to JUnit 4 2023-12-08 12:11:25 -08:00
Max Moiseev
126f87b73c Bump to version 0.36.1 2023-12-06 15:20:54 -08:00
Clark
7bf7b5e261 Java: Take in session list for sealed sender multiRecipientEncrypt 2023-12-06 10:03:32 -08:00
Jordan Rose
b7bbabd228 Bump to version v0.36.0 2023-12-05 13:00:53 -08:00
Alex Konradi
1f2d761889 Allow returning handle types from Swift invokeAsyncFunction
Implement the Completable protocol for OpaquePointer and add a test that runs
futures that return handle types to prove that it works.
2023-12-04 16:39:32 -05:00
Alex Konradi
f06faef7a4 Split CDSI lookup to allow token retrieval
Split the libsignal-net implementation of CDSI lookup into two parts: one that
does the initial handshake and token acquisition, and the other to acknowledge
the token and then parse results. Expose the token in Java via the same Consumer
type used in the Android codebase.
2023-12-01 16:05:10 -05:00
Alex Konradi
2c985f3d84 Add CompletableFuture.thenCompose
This is needed for splitting up the CDSI lookup function. The signature mirrors
the Java standard library version.
2023-11-30 16:13:05 -05:00
Alex Konradi
1c6e8e512d Fix CompletableFuture error handling
Fix the behavior of CompletableFuture.thenApply so that if the applied function
throws an exception, the pending future receives the exception (instead of never
completing). Add tests.
2023-11-30 15:38:22 -05:00
Alex Konradi
7f023e7d46 Fix exclude for libsignal-net tests on Android
Use the path within the directory specified by srcDir without the common
prefix. Verified with ./gradlew test :android:connectedDebugAndroidTest
locally.
2023-11-16 14:47:17 -05:00
Jordan Rose
75b78438d5 Enable full LTO for Android, *disable* it for non-iOS Swift
And make sure CFLAGS has a matching flag, for maximum LTO.
2023-11-15 10:18:43 -08:00
Jordan Rose
caf3dade92 Java: Add -Xcheck:jni to host testing
This can give better error messages for JNI mistakes that might
otherwise crash or go unnoticed. Tested by introducing such a mistake.
(Though it's hard to do with the jni crate's safe interfaces, which is
a good thing!)

The Android Emulator always has its equivalent checks on, so the Slow
Tests are also giving us some confidence about our JNI usage.
2023-11-15 10:17:26 -08:00
Alex Konradi
4c78373114 Expose libsignal-net function for CDSI via JNI
Expose the existing CDSI lookup async function to Java clients. Provide a small
library that can be easily integrated into the existing codebase.
2023-11-15 10:00:46 -05:00
akonradi-signal
3d8933ec96 Add CompletableFuture.thenApply method
Add the ability to chain futures by applying arbitrary functions. Mirrors
CompletableFuture.thenApply in the Java standard library.
2023-11-13 15:06:40 -05:00
Jordan Rose
4acd05bd5d Automatically release builds on Sonatype 2023-11-13 11:31:42 -08:00
Jordan Rose
3b6100eb1d Bump to version v0.35.0 2023-11-13 10:39:59 -08:00
Jordan Rose
9839a5be79 Always use the original SSv2 version byte, 0x22, for ReceivedMessages
The format hasn't changed, so we don't need to bump the version number
for the messages the server sends to recipients.

This is implemented in two places: the Rust side for round-trip
testing, and the Java side for what the server actually does. (Both
are implemented to avoid unnecessary copies and unfortunately the two
aren't conveniently compatible with one another, but it's a simple
implementation anyway.)
2023-11-10 09:30:39 -08:00
Jordan Rose
0c13580240 SSv2: Add receive support for excluded recipients
These are encoded as having a device ID of zero. Rust-level tests will
come with the send support, so we can do round-trip tests.
2023-11-07 16:25:22 -08:00
Jordan Rose
b618fd58e7 SSv2: Require known versions in SealedSenderV2SentMessage::parse
And if we're not trying to be open to future versions, we can validate
that there's enough bytes for the ephemeral public key as well.
2023-11-07 16:25:22 -08:00
Jordan Rose
418886c599 SSv2: Add server receive support for compact device lists
This takes advantage of the fact that multiple devices for the same
user will have the same identity key and therefore will use the same
per-recipient SSv2 data anyway.

This commit also enforces (on the server side) that device IDs are in
the range 1..=127 for destinations of a SSv2 message; previously they
were varint-encoded.

When send support is added, the round-trip Rust tests will
automatically start testing this as well.
2023-11-07 16:25:22 -08:00
Jordan Rose
64d5996825 Expose SSv2 message parsing in libsignal-server 2023-11-07 12:19:14 -08:00
Jordan Rose
90e23336e0 java: Improve Pair's equals, hashCode, and toString 2023-11-06 12:19:56 -08:00
Max Moiseev
611deac10d Bump to version 0.34.0 2023-11-03 11:46:38 -07:00
Jordan Rose
d768f47020 usernames: Allow generating a new link buffer with existing entropy
This allows updating the encrypted username associated with a link
without rotating the link itself.
2023-11-02 15:02:36 -07:00
Jordan Rose
44261bb623 Use the 64-bit curve25519-dalek backend even on 32-bit Android 2023-11-01 10:11:30 -07:00
Jordan Rose
37c7b482ca Bump to version v0.33.0 2023-10-26 14:03:22 -07:00
Jordan Rose
3ac14b17a7 Fix Android tests for 9c79bc97c 2023-10-26 13:25:43 -07:00
Jessa
7af14c6b06 Add WebP sanitizer
This adds integration bits for the new webpsan, a WebP image sanitizer -- which
currently simply checks the validity of a WebP file input, so that passing a
malformed file to an unsafe parser can be avoided. The integration pretty much
just leverages the integration work that was already done for mp4san.
2023-10-26 15:16:59 -04:00
ravi-signal
9c79bc97cb zkgroup: move java BackupAuthTest to server lib
This test does base64 decoding which differs between android 21 and
non-android platforms.
2023-10-26 13:15:25 -05:00
ravi-signal
790db2383e zkgroup: add backup auth credential
Allows a client to request a credential for a backup-id without
revealing the backup-id to the issuing server. Later, the client may use
this to make requests for the backup-id without identifying themselves
to the server.
2023-10-25 17:26:58 -05:00
Jordan Rose
55a1958a15 Test various error and panic scenarios for bridge_fn and bridge_io 2023-10-12 12:23:22 -07:00
Jordan Rose
63efc8bf4d bridge_io: Add an explicit parameter for the async runtime
This will let us (a) avoid hardcoding any particular async runtime in
the libsignal-bridge macros, and (b) separate the platform-specific
stuff from the async runtime. libsignal_bridge now has an AsyncRuntime
trait whose only requirement is "run a self-contained Future".
2023-10-05 09:37:55 -07:00
Jordan Rose
e8c82fe4b7 build_jni.sh: Allow building just one Android slice at a time 2023-10-04 16:02:45 -07:00
Jordan Rose
ae47f039fa bridge: Add a bridge_io macro that expects a runtime
For now, the "runtime" is spawning a thread that then uses
now_or_never, but eventually this will be a persistent tokio runtime
of some kind.

Also for now, this is only implemented for Java. Swift and Node
support coming soon.
2023-10-02 14:08:10 -07:00
Jordan Rose
5fde77a631 Don't include the Future testing APIs when building for Android 2023-09-27 06:48:21 -07:00
Jordan Rose
a15fffd058 Java: Teach gen_java_decl about Futures for type-safety. 2023-09-27 06:48:21 -07:00
Jordan Rose
2c295f68c9 Java: Implement completing Java Futures from Rust 2023-09-27 06:48:21 -07:00
Jordan Rose
dab8a18959 Java: Add a StderrLogger for testing 2023-09-27 06:48:21 -07:00
Jordan Rose
a563c9b93d Java: Add a bare-bones Future implementation for upcoming async APIs 2023-09-27 06:48:21 -07:00
moiseev-signal
840a1906c7 Update prost to version 0.12 2023-09-20 14:00:54 -07:00
Alex Konradi
d1f9dff273 Bump to version v0.32.1 2023-09-20 14:26:31 -04:00
moiseev-signal
36363750a2 Reimplement IncrementalMacInputStream backed by directly allocated ByteBuffer 2023-09-15 11:00:50 -07:00
Max Moiseev
72f046fe19 Bump to version v0.32.0 2023-09-01 13:43:06 -07:00