0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-19 19:42:19 +02:00
Commit Graph

586 Commits

Author SHA1 Message Date
Alex Konradi
f7e0af4c30
java: read expected backup file as UTF-8 2024-07-17 15:42:19 -04:00
Alex Konradi
a6a8eae650
Fix expected canonical test case output 2024-07-16 15:40:43 -04:00
Alex Konradi
66cd3f0133
backup: bridge canonical serialization as ComparableBackup 2024-07-16 14:20:31 -04:00
Jordan Rose
a4a0663528 Bump to version v0.52.3 2024-07-11 14:10:27 -07:00
Jordan Rose
7261c37b46 Bump to version v0.52.2 2024-07-11 12:33:46 -07:00
moiseev-signal
f794998389
SVR3: implement migrate API 2024-07-10 11:40:56 -07:00
Jordan Rose
773530ecd1 Add type annotations to all our Python scripts
The main benefit of this is not our *own* type-checking; it's that
mypy will error out if you try to use a too-new Python API. And in
fact, we were already relying on Python 3.9 and didn't realize.

check_code_size.py works with JSON, so it still uses Any a fair bit.
2024-07-09 17:01:10 -07:00
Alex Konradi
0e4d420f69
Add libsignal-jni-testing crate with test-only functions for Java
This parallels the exiting libsignal-jni crate but exports functions from 
libsignal-bridge-testing instead of libsignal-bridge. The crate is compiled as 
a separate shared object that is included in the published libsignal package, 
but which can be excluded at Android packaging time.
2024-07-09 13:07:36 -04:00
Alex Konradi
c6857dd58e
Don't assume EOF on 0-length read for Node
Remove the special handling code that detects EOF now that the upstream crate 
has fixed the bug that was being worked around. This also fixes a bug where EOF 
was being incorrectly detected when the provided buffer was empty. Add a test 
case to prevent regression in the future.
2024-07-09 11:58:43 -04:00
Max Moiseev
2b48d18d23 Bump to version 0.52.1 2024-06-28 15:16:18 -07:00
Alex Konradi
e13e3de8b2 Bump to version v0.52.0 2024-06-28 14:55:58 -04:00
Chris Eager
f26fd13631 Add SealedSenderMultiRecipientMessage#serialized 2024-06-26 17:01:01 -05:00
Chris Eager
2b5b51c7b3 Fix error string whitespace 2024-06-21 16:34:27 -07:00
Jordan Rose
db18a102f2 Use Docker's ADD command for remote resources 2024-06-21 11:35:08 -07:00
Jordan Rose
2e2896fc23 Bump to version v0.51.1 2024-06-20 17:02:58 -07:00
Jordan Rose
95bf4e7715 Bump to version v0.51.0 2024-06-13 16:42:29 -07:00
Jordan Rose
4e2a7de574 Expose the 'Stopped' event to Swift and Node
Swift: ChatListener.chatServiceConnectionWasInterrupted(_:)
Node: ChatServiceListener.onConnectionInterrupted()
2024-06-13 15:54:21 -07:00
Jordan Rose
3cebfb0ec4 java: Build reproducible jars
The *contents* were already identical, but jars preserve timestamps by
default, and might not sort their inputs. Fortunately Gradle has
options for both of those.
2024-06-13 13:44:54 -07:00
Jordan Rose
4791773954 java: Add -P debugLevelLogs as a Gradle build option
Similar to the previous commits, but for Java/Android. If invoking
build_jni.sh directly, use `--debug-level-logs` like build_ffi.sh.

As a consequence, LOGGING IS NO LONGER AUTOMATICALLY ENABLED FOR
JAVA/ANDROID. Clients must call SignalProtocolLoggerProvider.
initializeLogging() in addition to setting a provider.
2024-06-13 12:08:31 -07:00
Jordan Rose
e968ab4b62 Bump to version v0.50.0 2024-06-07 09:32:25 -07:00
moiseev-signal
38a5f01f6f
net: Short circuit MultiRouteConnectionManager on fatal errors 2024-06-06 18:06:59 -07:00
Jordan Rose
44b6057bce java (mostly): audit for checked AttestationFailedException
The "mostly" is because there was one place in the Rust layer where
establishing attestation could *additionally* generate a Noise error
(theoretically, not in practice), which gets turned into an
SgxCommunicationFailureException (suboptimally named now that we have
non-SGX enclaves, but oh well). Change that to treat that as an
AttestationData error as well, since it *is* about the data that comes
from the attestation blob rather than the actual Noise handshake.
2024-06-05 15:59:21 -07:00
Jordan Rose
69ed266c0d java: Remove superfluous java_test Makefile target
Gradle's "build" action includes running tests; it's "assemble" that
doesn't. So we've been redundantly asking to run tests for a while,
and that currently does extra work due to the testing-fns variant
builds of the Android libraries. Just remove it.
2024-05-31 12:42:06 -07:00
Max Moiseev
347791c88c Bump to version 0.49.0 2024-05-31 12:27:59 -07:00
Jordan Rose
8313a2cfbd Remove app-layer tests that rely on connection timeouts
This was previously done for Node in 62f347e866, while the Java and
Swift tests *did* pass but...very...slowly. Make them all consistent.
2024-05-30 13:28:07 -07:00
Alex Konradi
31d6015522
backups: add shared message backup test cases 2024-05-24 15:59:44 -04:00
Alex Konradi
e925c5d9d9 Bump to version 0.48.0 2024-05-24 15:06:29 -04:00
Jordan Rose
9a8429da46 net: Add AppExpired and DeviceDeregistered errors for ChatService
And check bridging for every high-level ChatServiceError like we do
with CdsiLookupErrors.
2024-05-23 10:27:28 -07:00
Max Moiseev
1086531d79 Bump to version 0.47.0 2024-05-21 14:40:12 -07:00
Jordan Rose
a5fa231a1c bridge: Expose ChatService_InjectRawServerRequest for testing 2024-05-21 13:04:18 -07:00
Jordan Rose
a513d61a09 bridge: Expose ChatListener to Swift
(and lay groundwork for the other bridges)
2024-05-21 13:04:18 -07:00
moiseev-signal
70ba17491c
SVR3: Implement remove API 2024-05-21 10:33:33 -07:00
moiseev-signal
c55aa17a9f
SVR3: Propagate tries_remaining on restore failure 2024-05-20 15:49:59 -07:00
Jon Chambers
59addf10ec Make ECPrivateKey#<init>(byte[]) public 2024-05-20 18:09:50 -04:00
Jordan Rose
b9e021659b java: Check for invalid key sizes more thoroughly in ECPublicKey 2024-05-20 10:41:55 -07:00
moiseev-signal
bc5875b225
SVR3: Propagate tries_remaining upon successful restore 2024-05-20 08:54:46 -07:00
Jordan Rose
7dc63b99af ffi: Expose cancellation to Swift 2024-05-17 11:30:24 -07:00
Jordan Rose
1aedf124cd Bump version to v0.46.2 2024-05-16 16:02:06 -07:00
Jordan Rose
9b9bd7cead Bump to version v0.46.1 2024-05-15 16:23:07 -07:00
Jordan Rose
99e337f552 bridge: Expose authenticated sends on ChatService 2024-05-15 15:48:47 -07:00
Jordan Rose
a09eb567f0 net: "Poison" the TCP connector if an invalid proxy is set
This ensures that if there's an error setting a proxy, the previous
settings won't continue to be used for new connections.

This only applies to the Java, Swift, and TypeScript layers; the Rust
layer's set_proxy isn't a fallible API in the first place today. The
Java API now explicitly throws a checked IOException instead of
IllegalArgumentException.
2024-05-08 16:18:03 -07:00
Jordan Rose
0ac953032e Bump to version v0.46.0 2024-05-02 15:45:30 -07:00
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
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