Commit Graph

157 Commits

Author SHA1 Message Date
Jordan Rose
a328e3278c backup: Expose new ways of constructing MessageBackupKey
And switch the encrypted backup tests over to AccountEntropyPool.
2024-10-23 10:34:09 -07:00
Alex Konradi
01102bbab1 Provide additional information on CDSI errors 2024-10-22 13:57:50 -04:00
gram-signal
0ed3d49d20 Switch SVR3 testing environment. 2024-10-18 09:41:29 -07:00
andrew-signal
9fa6cf51f9 First iteration of JNI API for AccountEntropyPool 2024-10-03 14:59:27 -04:00
Jordan Rose
59cb7df6a3 bridge: Split Chat into AuthChat and UnauthChat
This matches the split that has already happened in the TypeScript and
Swift APIs. For now, both AuthChat and UnauthChat are wrappers around
the same type, a fully general chat::Chat, but we expect to eventually
split that into authenticated and unauthenticated variants as well. At
that point we can consider whether the common implementation here is
still pulling its weight.
2024-09-24 16:05:20 -07:00
moiseev-signal
88c2ab1dcc svr3: Bridge rotate API to mobile platforms 2024-09-13 09:59:56 -07:00
Jordan Rose
a8814d16f8 Move all "testing-fns" APIs into libsignal-bridge-testing
This means they'll be shipped to clients, but still filtered out of
the device builds on Android (via having two separate libraries on
disk) and iOS (by not being included in non-simulator builds). The
biggest benefit of this is dropping the :android:makeTestJniLibraries
step for running libsignal's Android tests.
2024-08-27 08:29:06 -07:00
Jordan Rose
5e81e01a38 java: {Signed,Kyber}PreKeyRecord.getKeyPair throws InvalidKeyException
Since the usual constructor is strongly typed, this can only happen
when the serialized data is corrupted. But that is a possibility.
2024-08-20 14:54:46 -07:00
Sergey Skrobotov
4b283b7b4f net: dropping reconnect count field 2024-08-07 19:11:43 -07:00
Jordan Rose
11544c6718 java: Omit native libraries from the sources jars
...at least partly to cut down on the space used during a build that
includes all supported architectures.
2024-08-02 09:54:43 -07:00
Jonathan Klabunde Tomer
3d1c45f15d build multiarch server jar from make targets by default 2024-07-31 10:07:54 -07:00
Jordan Rose
a561392cff Expose the "network changed" event to apps 2024-07-30 15:27:42 -07:00
Sergey Skrobotov
d694cff1a1 net: adding a parameter to opt in/out of receiving stories 2024-07-25 14:55:23 -07:00
Jordan Rose
e50ddd215b java: ChatServiceExtension now extends IOException
...for consistency with other network-related exceptions in the Java
ecosystem.
2024-07-18 13:08:59 -07:00
Alex Konradi
0b7d2856fe Use ResourceReader in test 2024-07-18 14:48:18 -04:00
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
moiseev-signal
f794998389 SVR3: implement migrate API 2024-07-10 11:40:56 -07: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
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
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
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
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
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
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
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
Jordan Rose
9d622d9bcb android: Add rustls-platform-verifier support 2024-04-24 14:13:30 -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
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
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
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