Commit Graph

494 Commits

Author SHA1 Message Date
Sergey Skrobotov
ab733bf00a libsignal-net: support for User-Agent header 2024-05-01 20:02:08 -07:00
Alex Konradi
32dc8c27d8 Revert "Remove ProfileKeyCredentialPresentationV1" 2024-05-01 17:12:48 -04:00
Sergey Skrobotov
ccf4b8106e ServiceIdTest refactoring 2024-05-01 11:41:42 -07:00
Jordan Rose
cc12c6f3c8 Make ServiceId Ord/Comparable
ACIs are sorted before PNIs, then the UUIDs are sorted by their
(unsigned) bytes. This provides a total order, if a relatively
arbitrary one.
2024-05-01 10:34:21 -07:00
Jordan Rose
e55349e193 java: Update ServiceIdTest to JUnit 4 2024-05-01 10:34:21 -07:00
Alex Konradi
53699f11db java: save the class loader on initialization
Instead of using a hardcoded list of class definitions to attempt to preload, 
save the ClassLoader instance when libsignal is loaded and use that to do class 
lookups by name.
2024-04-30 13:04:49 -04:00
Alex Konradi
6edd0540fb java: add async class load method
Add a method to allow Java code to attempt to load a class on a Tokio worker 
thread like libsignal does internally. This will be used for testing both in 
libsignal and in dependents.

Fix a bug where exceptions raised during conversion from Rust result values to 
Java values weren't being correctly propagated to the Java Future that would 
report the result.
2024-04-29 13:08:10 -04:00
Max Moiseev
46780fb8c5 Bump to version 0.45.1 2024-04-26 13:47:42 -07:00
Jordan Rose
9d622d9bcb android: Add rustls-platform-verifier support 2024-04-24 14:13:30 -07:00
Jordan Rose
ada822434e Bump to version v0.45.0 2024-04-19 15:15:20 -07:00
Jordan Rose
9f53f3d1e7 BackupAuthCredential: verify the redemption time on receive
This is passed both within the credential response and outside it, so
it's important to make sure the two times match.
2024-04-19 13:41:59 -07:00
ravi-signal
9204831745 Use an enum for BackupAuthCredential's level 2024-04-19 11:46:49 -07:00
Jordan Rose
3d2471cc8b Make LIBSIGNAL_TESTING_ env vars available to Android and iOS tests
And adjust the existing ENCLAVE_SECRET tests and examples to use this
(including Rust and Node's).

This also requires adding an AndroidManifest.xml that notes the tests
might use the network.
2024-04-17 16:06:46 -07:00
Jordan Rose
4b87577969 java: Print all test outcomes as they run (not just passes)
Failures would still have been caught in the aggregate test results;
but if we're going to print successes we should print skips and
failures too. (This was just an oversight.)
2024-04-17 10:21:41 -07:00
Max Moiseev
aeb15fffae jni: Implement CompletableFuture.whenComplete 2024-04-16 11:55:46 -07:00
Sergey Skrobotov
3864f33b4d libsignal-net: dropping DebugInfo.connectionReused field 2024-04-16 10:20:00 -07:00
Alex Konradi
6114bb7962 Use the first bytes of a backup as the AES IV
Treat the first 16 bytes of the stream as the IV for the AES block cipher. This 
is incompatible with the previous scheme, where the IV was derived from the 
master key.
2024-04-15 16:37:46 -04:00
Alex Konradi
f72f33d3ee Remove code that handles auth cred with ACI as PNI
These functions are unused in client and server code.
2024-04-11 17:08:18 -04:00
Alex Konradi
06c1780a14 Hold server zkparams as pointers 2024-04-09 16:13:22 -04:00
Sergey Skrobotov
02e03ee057 Bump to version v0.44.0 2024-04-02 17:27:23 -07:00
Alex Konradi
79bab1ce78 Expose TLS proxy in app libraries
Co-authored-by: Sergey Skrobotov <sergey@signal.org>
2024-04-02 16:22:18 -04:00
Alex Konradi
3ace227578 Bump to version v0.43.0 2024-04-01 15:05:31 -04:00
Jordan Rose
96fce497db Bridge unauthenticated connection to Swift
- Remove From<http::header::ToStrError> for ChatServiceError
- bridge: Response -> ChatResponse, DebugInfo -> ChatServiceDebugInfo
2024-04-01 09:24:46 -07:00
Alex Konradi
10a6d8b744 Remove enclave operation timeout arguments
The enclave interactions have internal progress monitoring in the form of 
websocket PING/PONG frames, so the timeout parameters aren't necessary for 
broken connection detection.
2024-03-29 18:13:40 -04:00
Sergey Skrobotov
8c1eadc0e7 libsignal-net: refining ServiceWithReconnect activity states logic 2024-03-29 13:33:19 -07:00
Sergey Skrobotov
aca995d745 libsignal-net: additional API and debug info 2024-03-27 12:39:24 -07:00
Max Moiseev
50c9ec1be1 CI: Set environment for SVR3 integration tests in Slow Tests 2024-03-26 14:09:10 -07:00
Alex Konradi
94432e2e32 Handle all CDSI server error codes
Match against all the error codes the documentation says the server can 
produce. Map these to error types in the app languages.
2024-03-26 16:41:12 -04:00
Jordan Rose
5d95051dcc java: Accept Collection instead of List if order doesn't matter
This only affects GroupSendEndorsement APIs at this time; everywhere
else List is used, order is significant (or at least must be stable),
or the type is part of an interface or return value.
2024-03-26 10:35:29 -07:00
Alex Konradi
e87a1cba14 Handle "invalid token" response to CDSI request 2024-03-25 14:13:14 -04:00
Alex Konradi
ed19489470 Improve CDSI errors
Add bridging tests for all the CDSI error types, and diversify the types of 
exceptions that can be thrown from Java code.
2024-03-25 13:39:06 -04:00
Sergey Skrobotov
d7a4b8c817 libsignal-net: ChatService jni bridge 2024-03-21 13:19:27 -07:00
Alex Konradi
23764a50e8 Use @CalledFromNative to prevent stripping
Add an annotation, CalledFromNative, and directives in the proguard file that 
recognize it and prevent items it's attached to from being stripped during code 
minification. Use it in place of some existing rules, and add it to methods 
that were already being called from native code.
2024-03-21 14:10:23 -04:00
Alex Konradi
41897ff45e Remove ProfileKeyCredentialPresentationV1
This is no longer constructed in clients, and the last usage of the "structurally
valid" entry points was recently removed.
2024-03-20 17:32:00 -04:00
Jordan Rose
d9f6c0ee3c Bump to version v0.42.0 2024-03-19 16:47:08 -07:00
Jordan Rose
5a05c936a7 GroupSendEndorsementsResponse: Weaken performance claims in docs
Right now the benefits of receiving GroupSendEndorsementsResponse
using member ciphertexts are balanced by the increased cost of
deserializing the full ciphertexts instead of just the part we need.
We can improve things here if needed, but for now let's just not claim
that the ciphertext approach is "significantly" better than the
alternative.
2024-03-18 09:59:16 -07:00
Jordan Rose
fca9196201 GroupSendEndorsements: don't fall over in the face of 1-person groups
Previously we'd attempt to create a combination of zero endorsements
for the everybody-but-me credential, and panic (throw an error). Now
we correctly create an endorsement that represents zero people, which
is better than returning some dummy value because it behaves
reasonably if endorsements from multiple groups are combined wholesale
(not something we plan to do, but something that shouldn't have weird
edge cases if we end up needing to).
2024-03-18 09:59:16 -07:00
Jordan Rose
37e68943d6 Add GroupSendEndorsement.toFullToken(...) convenience method
If apps want to cache these tokens, they should prefer to cache the
non-"full" version because it won't redundantly contain the
expiration, but if they don't, dealing with two token types is
unnecessary complexity.
2024-03-18 09:59:16 -07:00
Jordan Rose
8ed2dc1195 Remove GroupSendCredential
Long live GroupSendEndorsements!
2024-03-14 12:31:30 -07:00
Jordan Rose
0c940626fb Java: Use strong types for array-of-bytestrings
The choice between byte[] and ByteBuffer is non-obvious, so it's worth
generating Native.java with a little more fidelity.
2024-03-13 12:22:46 -07:00
Jordan Rose
256f4742c7 bridge: Add tests for bridging arrays of bytestrings 2024-03-13 12:22:46 -07:00
Alex Konradi
6b253b5ddb Continue the size check if GH response is invalid
Continue the rest of the check_code_size.py script if the GH tool invoked by the
script fails or produces unexpected results.
2024-03-13 12:52:42 -04:00
Jordan Rose
8fb6cc31cf bridge: Make a combined endorsement for GroupSendEndorsementsResponse
Specifically, make this on the Rust side bridge layer, and tack it on
to the end of per-member endorsements for the app side to peel off
later, rather than the app layer calling back down to Rust to compute
it. This saves a fair amount of marshalling work.
2024-03-12 14:54:04 -07:00
Jordan Rose
bd23dfe195 Java: Add an UNCHECKED_AND_UNCLONED mode for GroupSendEndorsements
...since we sometimes create them in bulk from data coming right out
of libsignal_jni, and for a large enough group the cost of that can be
significant. If data coming from libsignal_jni is wrong, we have
bigger problems! (And we'll also get AssertionErrors when the bad
endorsements used, saying they should have been validated ahead of
time. So it won't go completely unnoticed.)
2024-03-12 14:54:04 -07:00
Jordan Rose
17d8737fac Java: Regression test a 1000-person GroupSendEndorsementsResponse 2024-03-12 14:54:04 -07:00
Jordan Rose
93237adc56 Android: Add benchmarks for GroupSendEndorsement
These show quite a bit of overhead over running the Rust benchmarks
directly. Something to look into!
2024-03-12 14:54:04 -07:00
Jordan Rose
54727562fc Android: mark benchmark tests as profilable 2024-03-12 14:54:04 -07:00
Alex Konradi
60f066dbac Remove AuthCredential
This hasn't been used in client code for some time.
2024-03-11 16:43:23 -04:00
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