0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
Commit Graph

446 Commits

Author SHA1 Message Date
Jordan Rose
2aa3c34088 java: Implement GroupEndorsement APIs 2024-03-11 13:41:48 -07:00
Jordan Rose
cdef8228a2 bridge: Expose GroupSendEndorsement APIs 2024-03-11 13:41:48 -07:00
Alex Konradi
f4f478fd06
Add authentication credential implemented with zkc
Add a new version of the existing auth credential used for groups, but 
implemented with the zkcredential crate instead of hand-written proofs. Expose 
issuance point for the server, and extend existing client methods to support it 
and the existing formats transparently.
2024-03-08 15:38:23 -05:00
Jordan Rose
f896129db9 Java: Update to Gradle 8.4, Android Gradle Plugin 8.3, SDK 34, Java 17
Each of these updates is required for the following update, and the
final one allows us to use 'record'.

The target SDK version is set to 33, matching the Android app.
2024-03-08 10:34:18 -08:00
Sergey Skrobotov
dffb203cbe Bump to version v0.41.1 2024-03-07 14:29:14 -08:00
Jordan Rose
c80ceda985 Java: Allow limiting which archs are built for Android
And use this to cut down CI testing time: only build armv7 and aarch64
slices of the real library, and x86_64 for the testing library (which
we don't even run in the every-commit CI, but we want to make sure we
haven't broken something in that configuration).
2024-03-07 10:15:57 -08:00
Jordan Rose
635051bf63 Fix most recent tag in code_size.json 2024-03-05 10:07:07 -08:00
Sergey Skrobotov
ce37388552 Bump to version v0.41.0 2024-03-01 14:49:33 -08:00
Jon Chambers
1d2d9d9254
Retire old SVR2 enclaves
Co-authored-by: Alex Konradi <akonradi@signal.org>
2024-03-01 15:05:07 -05:00
Alex Konradi
274b680ef4
Expose message backup purpose as an argument
Add a flag to the CLI validation tool and an argument to the bridged validation 
functions so users can specify whether a provided message backup should be 
validated according to the rules for device-to-device transfers or backups 
intended for remote storage.
2024-03-01 09:53:00 -05:00
moiseev-signal
d7d2576ae6
SVR3: FFI bridge 2024-02-29 18:22:59 -08:00
Sergey Skrobotov
ec49a9774b libsignal-net: ChatService node bridge 2024-02-27 11:07:57 -08:00
Jordan Rose
4f4d21a8ca java: Mark all bridge_fns that return Result as throws Exception
Then, use FilterExceptions to filter out any exceptions that aren't
declared in the calling method's exception spec. Note that this isn't
perfect: Java's checks for typed exceptions prevents an *extra*
exception from being thrown this way, but it's still possible to
forget to *allow* an exception using FilterExceptions.

This is 99% a mechanical change; the interesting bit is in
gen_java_decl.py and one unusual pattern in NativeErrorsTest.java. No
exception specs were changed here.
2024-02-22 13:34:57 -08:00
Jordan Rose
8cd6f8c68c java: Add the FilterExceptions helper
These methods wrap any unexpected checked exceptions in AssertionError
after logging them. The next commit will use this to enforce our
exception specifications for methods that wrap JNI calls.
2024-02-22 13:34:57 -08:00
Jordan Rose
77606128c2 Use the default SecureRandom generator for registration IDs
SHA1PRNG may have been more reliable in earlier versions of Android,
but that shouldn't be true anymore.
2024-02-22 12:26:51 -08:00
moiseev-signal
6f783269db
SVR3: JNI bridge 2024-02-22 12:22:10 -08:00
Alex Konradi
f980fccd8a Bump to version v0.40.1 2024-02-20 09:48:25 -05:00
Alex Konradi
1359b67486
Cache classes during initial Java library load
Use the class loader from the main thread to cache java.lang.Class
instances for some libsignal classes.

This enables constructing instances of libsignal classes on threads
where the classes aren't accessible via the default class loader. This
can occur on Android, where threads spawned via the native API only get
access to the system class loader, not the application loader that has
access to the application's class files. Since Tokio worker threads are
spawned via the native API, and the completion process for async tasks
converts results to Java objects, application class instances can't be
used there unless they are preloaded.

Since classes used in client code are only included in the client .jar
file, failure to load classes is a normal occurrence. If there are ever
separate builds for server and client .so library files, this could be
changed to a fatal error.
2024-02-16 10:38:12 -05:00
Alex Konradi
8959e64ed1
Build TESTING_ functions for Android test
Run tests that call native TESTING_ functions on Android. This requires 
building a separate version of libsignal_jni.so with the testing functions 
included. The test code is still omitted from the published artifacts.
2024-02-15 16:53:05 -05:00
Max Moiseev
7ef4efdb85 Bump to version 0.40.0 2024-02-12 12:03:40 -08:00
Alex Konradi
100ce19945
Fix Java error handling for CDSI lookup
CDSI error handling code would attempt to instantiate a nonexistent Java class. 
Add the missing class and split up the handling for CDSI lookup errors to reuse 
existing error types.
2024-02-09 15:31:35 -05:00
Jordan Rose
1827eb7780 java: DecryptionErrorMessage deserialization can InvalidKeyException 2024-02-08 15:43:35 -08:00
Jordan Rose
09abe004cc java: HsmEnclaveClient can fail at any point during the protocol 2024-02-08 15:43:35 -08:00
Jordan Rose
204ce07c21 java: Aes256GcmSiv.encrypt can't fail
More specifically, it can't throw an InvalidMessageException, and
IllegalArgumentException is a RuntimeException already.
2024-02-08 15:43:35 -08:00
Alex Konradi
483d220aba Expose CDSI debugPermitsUsed in app libs 2024-02-08 15:25:33 -05:00
Alex Konradi
d08adf19bb
Return username candidates as string array
Use the string bridging code introduced previously to provide string arrays to 
client directly instead of joining and splitting. This eliminates the use of a 
magic ',' character as a delimiter.
2024-02-06 09:46:06 -05:00
Alex Konradi
580913d225
Re-throw input stream errors in Swift and Java
Re-raise errors produced by an input stream after bubbling them through Rust 
code. This makes the interface less magic and avoids unnecessary 
stringification of error values.
2024-02-02 15:14:27 -05:00
Alex Konradi
e95f00d849
Print size difference of a PR versus main
Use the GitHub CLI utility, if present, to fetch the size from the logs of the 
"Build and Test" workflow run for the merge-base of the current branch and 
upstream main. This represents the true "delta" attributable to the current 
branch, as opposed to the integral of changes since the last release.
2024-02-01 16:30:42 -05:00
Alex Konradi
c70b66dc8c
Bridge message backup validator to Java
Provide a simple API for validating message backups read from InputStream 
instances.
2024-01-26 13:33:36 -05:00
Jordan Rose
b92da3a15c Bump to version v0.39.3 2024-01-24 11:13:13 -08:00
Jordan Rose
1f8701213b
zkgroup: Add GroupSendCredentialResponse::receive_with_ciphertexts
If a client already has the members of a group as ciphertexts, it's
more efficient to receive a GroupSendCredential that way, because then
they get to skip the conversion from ServiceId to UidStruct. If they
don't, however, the existing entry point is going to be both more
convenient and faster.

For Swift and Java, this is an overload of the existing receive()
method; for TypeScript, it's receiveWithCiphertexts.
2024-01-22 12:34:34 -08:00
Jordan Rose
fa364bc625 Java: Expose sealed sender certificate classes to the server too 2024-01-22 09:57:38 -08:00
Jordan Rose
a028068efd Java: Expose ServerCertificate and SenderCertificate creation
These are already exposed for testing in TypeScript and Swift.
2024-01-22 09:57:38 -08:00
Jordan Rose
5436160313 Bump to version v0.39.2 2024-01-18 16:04:39 -08:00
Jordan Rose
b31ca0781c Remove length parameter for webpsan
The way images are displayed on Android makes it annoying to provide,
and the implementation of webpsan doesn't actually need it.
2024-01-18 12:36:31 -08:00
Dimitris Apostolou
be16e47d7f Fix typos 2024-01-18 12:09:47 -08:00
Jordan Rose
224646389a
java: Work around InputStreams that don't provide a good skip()
In particular, some streams seem to override skip() to always return
0, which means that even looping on skip() won't end up skipping the
full amount. Work around this by using a wrapper InputStream that
falls back to read() instead.

This removes a requirement for the streams passed to Mp4Sanitizer and
WebpSanitizer, but providing a good skip() is still recommended.
2024-01-18 11:23:05 -08:00
Jordan Rose
d0879d7150 Bump to version v0.39.1 (Node-only release) 2024-01-10 17:18:20 -08:00
Jordan Rose
455b3bf7a0 Bump to version v0.39.0 2024-01-10 13:17:40 -08:00
Jordan Rose
70a9662acd usernames: Expose Username.fromParts to app languages 2024-01-10 12:26:19 -08:00
Jordan Rose
0ef2c7cc54 usernames: Split up BadDiscriminator error into more specific errors
Rust: UsernameError now has more cases. ProofVerificationFailure is
also split off into its own error type, separate from structural
username errors.

Java: Subclasses of BadDiscriminatorException have been added.

Swift: Some error codes have been renamed and others have been added.

TypeScript: Some error codes have been renamed and others have been
added. Discriminator errors are now proper LibSignalErrors.
2024-01-10 12:26:19 -08:00
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