Commit Graph

106 Commits

Author SHA1 Message Date
Jordan Rose
417673dab8 jni: When exception conversion fails, make an AssertionError instead
This can fail too, but we should at least try.
2025-10-15 17:46:44 -07:00
gram-signal
ba59aa0055 SVRB - allow multiple current SVRBs. 2025-10-15 15:54:34 -07:00
Jordan Rose
388e294acf bridge: Eliminate FakeChatSentRequest in favor of pairs 2025-10-10 16:56:15 -07:00
andrew-signal
b6db49f457 TypeScript: Provide BackupsJsonExporter for takeout flow 2025-10-09 20:27:00 -04:00
Jordan Rose
fb570d7c99 bridge: Add support for returning pairs from bridge_fns 2025-10-09 11:31:20 -07:00
moiseev-signal
ba6102f74d keytrans: Verify all available auditor signatures 2025-10-07 16:48:10 -07:00
andrew-signal
2bc167b5a2 Add BuildVariant parsing/overload support to libsignal's Remote Config 2025-09-30 22:35:21 -04:00
moiseev-signal
0e9c85c354 keytrans: Unify errors with other typed APIs 2025-09-26 11:47:40 -07:00
Jordan Rose
be7926a17a bridge: Thread a label into each bridge_io future execution 2025-09-26 09:45:03 -07:00
Alex Bakon
49d300ba66 Revert "Add Noise Direct connection shadowing via remote config" 2025-09-18 13:50:34 -04:00
Alex Bakon
4ea5b762ba Format Rust using 2024 edition rules 2025-09-03 14:22:08 -04:00
Jordan Rose
e81f0b6f62 net: Check current interface when a chat request fails to complete in time
This includes adjustments to TransportInfo and more use of
chat::ws::Config. The new check is disabled by default (by having the
timeout be Duration::MAX).
2025-08-25 13:29:59 -07:00
Jordan Rose
c905320dea bridge: Add IllegalArgumentError
...mostly so we can stop using SignalProtocolError::InvalidArgument
for functions that wouldn't otherwise traffic in SignalProtocolErrors.
2025-08-18 10:47:34 -07:00
Jordan Rose
549d91aba3 net: Fold cdsi::LookupError::Parse into CdsiProtocol
Both of these indicate the server sending something unexpected, and
all clients already treat them the same at the app level anyway.
2025-08-18 10:00:42 -07:00
Jordan Rose
ddb8f340ca Remove unused cdsi::LookupError::InvalidResponse 2025-08-18 10:00:42 -07:00
Jordan Rose
8fdb2778bc protocol: Split FingerprintError out from SignalProtocolError
The "fingerprint" / safety number operations *are* tied to the
"protocol" in that they provide a way to verify identity keys, but
they are also completely distinct from the message handling that the
rest of SignalProtocolError is used for.
2025-08-15 12:21:25 -07:00
Alex Bakon
30335603b9 Add Noise Direct connection shadowing via remote config 2025-08-14 13:54:40 -04:00
Jordan Rose
01e24be3e5 net: Rename WebSocketServiceError -> WebSocketError
Now we have
- WebSocketError: a stripped-down tungstenite::Error,
  with one extra case ChannelIdleTooLong
- WebSocketConnectError: a WebSocketError or a TransportConnectError
- WebSocketServiceConnectError: an explicit rejection from a service,
  or a WebSocketConnectError
2025-08-14 09:54:05 -07:00
Jordan Rose
b4cd040474 Add SvrB.remove(), use it for app-level integration tests 2025-08-13 12:35:52 -07:00
Jordan Rose
996f6bb250 jni: explicitly clean up local refs on background threads
- Use a local frame for bridge_io when completing futures
- Use a local frame for ChatListener callbacks
- Use AutoLocal for exception formatting callbacks
2025-08-12 10:49:30 -07:00
Alex Bakon
1f923dcd88 Remove unused TransportConnectError::DnsError 2025-08-11 09:45:02 -04:00
Jordan Rose
62957cc523 net: Finish merging ws2 into ws
ws2.rs -> ws/connection.rs
ws2/attested.rs -> ws/attested.rs
ws2::Config -> ws::Config
ws2::Connection -> ws::Connection
ws::WebSocketConfig -> (gone)

There's probably more harmonization that can be done with the types
inside and outside the new connection.rs, but at least now we don't
have a confusable config struct and a weird "2" lying around.
2025-08-05 12:44:11 -07:00
Jordan Rose
9feb3de9d2 net: SvrError::ConnectionTimeout -> AllConnectionAttemptsFailed
The same error is being used both for timeouts and for "all attempts
failed"; if we're going to coalesce them (reasonable, given that the
only option in either case is "retry" or "don't"), "all attempts
failed" is a less misleading choice.

This changes the particular enum case in Swift from connectionTimedOut
to connectionFailed. Java continues to use NetworkException and
TypeScript the IoError code.
2025-08-01 14:02:54 -07:00
gram-signal
2e8d87d009 Handle calling previous SVRB instances as necessary. 2025-07-31 16:21:09 -07:00
Jordan Rose
495957f83a net: Push websocket configs into Env / EnclaveEndpoint
Con: These don't usually differ by environment, so specifying them in
each environment is a bit redundant

Pro: The websocket config is always used alongside the domain config,
so it makes sense to provide them together

Pro: They're no longer stored inside a Mutex for no reason. (In fact,
they'll be static data in practice, which is the best possible place
to store data.)
2025-07-25 12:49:31 -07:00
gram-signal
cf2573c0bd Add prod SVRB configs into net. 2025-07-24 13:24:41 -07:00
gram-signal
841e39ad01 Working client to talk with current staging SVRB. 2025-07-18 10:14:21 -07:00
moiseev-signal
cd06fba71c keytrans: Make BadData error message more informative 2025-07-16 12:03:11 -07:00
gram-signal
ee149c5982 Remove masking from SVR3 API. 2025-07-09 13:03:14 -07:00
gram-signal
19ca6d7e03 Resurrect necessary SVR3 protocol. 2025-07-09 10:56:16 -07:00
Jordan Rose
2f6e1cca98 jni: Explicitly keep bridge_handle objects alive while using them
As a bonus, we get a partial check for misuse of mutating APIs.
2025-06-30 15:54:24 -07:00
Jordan Rose
eade867168 Move net::keytrans to libsignal-net-chat 2025-06-25 17:22:30 -07:00
moiseev-signal
d0425f2d3f swift: Make FingerprintMismatch error more useful 2025-06-25 15:20:04 -07:00
Alex Bakon
77cd1983e1 Refactor registration as typed API trait 2025-06-25 14:08:58 -04:00
Jordan Rose
841f57c30f Move (RegistrationSessionState)RequestedInformation -> ChallengeOption 2025-06-23 10:37:55 -07:00
Alex Bakon
56c63a4838 Refactor registration errors on existing types 2025-06-20 17:14:52 -04:00
Alex Bakon
b7828f54be Move registration client into libsignal-net-chat 2025-06-17 14:28:47 -04:00
Jordan Rose
2879220e93 Require Kyber keys/ciphertexts throughout all XDH APIs 2025-06-13 16:06:07 -07:00
Alex Bakon
669e682e6c Remove more no-longer-used networking code 2025-06-05 09:25:31 -04:00
gram-signal
b7b8040e3a Integrate post-quantum ratchet SPQR.
This PR integrates a post-quantum ratchet (SPQR) into libsignal, using an API that maintains its own internal chain and provides per-message keys.  In doing so, it also aims to be fully backwards-compatible with current clients and stored session state.

## Backwards compatibility with current clients

Remote clients that connect to us or that we connect to may not have this integration.  If they don't, their SignalMessage wire format should still deserialize, and in doing so we'll receive an empty pq_ratchet field.  SQPR handles this internally, by downgrading the protocol version to "version 0" or "don't do anything".  Note that should we eventually want to disallow this, we can do so via increasing the `min_version` field passed into the SQPR init functions to V1.  This is also the method by which we would upgrade SQPR from v1 to a future v2, etc.

## Opt-in

The publicly facing API calls for this now expose an explicit opt-in via a passed-in `use_pq_ratchet` bool (and associated enums in language-specific APIs).  If false, they default to SQPR `v0`, IE: none.  If true, they try to set up SPQR on new sessions, but will downgrade if the remote party cannot or will not do the same.
2025-06-04 11:18:12 -07:00
Alex Bakon
8a9e18b6c6 Remove unused #[allow], replace with #[expect] 2025-06-03 16:07:06 -04:00
moiseev-signal
cdd36eb2d1 keytrans: Add production configuration 2025-06-03 12:23:24 -07:00
Alex Bakon
8782d0a406 Add bridging tests for optional UUID return 2025-06-03 13:50:26 -04:00
moiseev-signal
bf096c449d keytrans: Improve errors 2025-05-30 16:00:06 -07:00
Alex Bakon
bf1e08b427 Check for cancellation of Rust task in test 2025-05-20 14:15:23 -04:00
moiseev-signal
a823fd4a14 keytrans: Remove SearchResult type 2025-05-16 11:33:31 -07:00
andrew-signal
eaa32e1b4c Bridge CompletableFuture Cancellation to Android 2025-05-16 11:23:37 -04:00
Alex Bakon
2ef1da756e Use bytes::Bytes in Chat websocket protobufs 2025-05-14 13:31:46 -04:00
Alex Bakon
840f14d2b3 Bridge register account method to Swift 2025-05-14 12:29:24 -04:00
Alex Bakon
eec9b04996 Port registration fake chat test to Swift 2025-05-14 09:54:11 -04:00