Commit Graph

231 Commits

Author SHA1 Message Date
Jordan Rose
8894050176 chat: Fix parsing of 409/410 responses to sendMultiRecipientMessage 2025-11-14 17:04:03 -08:00
andrew-signal
de881ddde4 backups: Exporter now returns [Result<String, Error>] instead of a serialized JSON array object
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-11-11 16:52:47 -05:00
moiseev-signal
78b0abf1e1 node: Implement a more friendly FakeChatRemote abstraction for tests 2025-10-20 14:23:09 -07:00
Jordan Rose
ad9fa70f7c node: Expose UnauthUsernamesService.lookUpUsernameLink 2025-10-17 12:14:40 -07:00
Jordan Rose
85686caa01 node: Combine Native.js and .d.ts into Native.ts
This allows the file to be checked by tsc, which would have caught
some of the missing type aliases sooner (now added to Native.ts.in).
Strictly speaking the behavior is slightly different: we have returned
to exporting many items individually instead of collecting them on a
single object.

Co-authored-by: Alex Bakon <akonradi@signal.org>
2025-10-15 17:50:37 -07:00
Jordan Rose
2b6c801fb6 bridge: Expose sendMultiRecipientMessage in UnauthMessagesService 2025-10-14 18:17:25 -07:00
Jordan Rose
279390b4f2 Incremental MAC: Check digest length when initializing ValidatingMac 2025-10-14 16:30:10 -07:00
Jordan Rose
388e294acf bridge: Eliminate FakeChatSentRequest in favor of pairs 2025-10-10 16:56:15 -07:00
andrew-signal
e8c2dabadc Add LIBSIGNAL_TESTING_IGNORE_KT_TESTS to skip key transparency tests while we await service recovery 2025-10-09 20:43:31 -04: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
gram-signal
533d11dd7c Remove usePqRatchet from client-facing code, defaulting to always use. 2025-10-02 11:32:36 -07:00
Jordan Rose
8b10397484 node: Explicitly import Buffer from node:buffer 2025-09-29 18:23:38 -07:00
moiseev-signal
0e9c85c354 keytrans: Unify errors with other typed APIs 2025-09-26 11:47:40 -07:00
Jordan Rose
42ff946228 node: Enforce @typescript-eslint/method-signature-style 2025-09-24 16:30:43 -07:00
Alex Bakon
e64bf1a319 Migrate eslint from deprecated v8 to supported v9 2025-09-22 15:38:53 -04:00
Alex Bakon
1f01c19e5f Convert libsignal-client node package to ESM 2025-09-22 14:20:16 -04:00
Jordan Rose
15af92c93d protocol: Record signed prekey and base key used with a Kyber prekey 2025-09-16 15:33:59 -07:00
moiseev-signal
1db21ca351 keytrans: Update the test account data 2025-09-16 11:07:10 -07:00
moiseev-signal
4675bb82a2 Desktop: add distinct type for incremental mac verification error 2025-09-03 16:40:58 -07:00
andrew-signal
bc0227873e Bridge look_up_username_hash to app languages
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-09-02 15:59:27 -07:00
andrew-signal
01d3d4ed30 Future-proof sealed sender trust root handling.
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-08-27 12:03:28 -04: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
b4cd040474 Add SvrB.remove(), use it for app-level integration tests 2025-08-13 12:35:52 -07:00
Jordan Rose
7cd112864c node: Add timestamps to the test logger 2025-08-13 11:43:12 -07:00
moiseev-signal
b53ed51263 keytrans: Stop falling back to search if _self_ monitor detects a new version 2025-08-11 15:34:01 -07:00
Alex Bakon
1f923dcd88 Remove unused TransportConnectError::DnsError 2025-08-11 09:45:02 -04: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
Jordan Rose
be9e9a3ab6 Expose SvrB.createNewBackupChain(), make secret data non-optional 2025-07-31 12:37:02 -07:00
gram-signal
72935510d4 Immediately after a restore, use the same enc_salt/pw_salt for the next backup.
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-07-30 20:14:26 -07:00
Jordan Rose
9e9c375db9 Expose BackupForwardSecrecyToken-aware MessageBackupKey derivation 2025-07-28 13:53:19 -07:00
Alex Bakon
348ea4ac03 Bridge SVR-B to TypeScript
Co-authored-by: Andrew <andrew@signal.org>
2025-07-28 16:02:02 -04:00
gram-signal
cf2573c0bd Add prod SVRB configs into net. 2025-07-24 13:24:41 -07:00
andrew-signal
47a4eeabb5 Bridge BackupForwardSecrecyToken to Swift/Kotlin/TypeScript 2025-07-23 19:57:16 -04:00
Jordan Rose
0dc81d3131 backup: Replace bespoke TooShort with io::ErrorKind::UnexpectedEof 2025-07-17 10:57:29 -07:00
Jordan Rose
a410849578 crypto: Add a stripped-down HPKE API for our Curve25519 keys 2025-07-15 16:17:23 -07:00
andrew-signal
a323900858 Refactor so tests generate legacy key format encrypted file; client tests can use that. 2025-07-15 13:16:06 -04:00
andrew-signal
36797e6eca Update MessageBackupKey derivation logic to use nonce if provided 2025-07-09 13:57:09 -04:00
moiseev-signal
4d187d2452 ci: Run proxy tests in Slow Tests workflow 2025-07-02 13:25:57 -07:00
Jordan Rose
eade867168 Move net::keytrans to libsignal-net-chat 2025-06-25 17:22:30 -07:00
Jordan Rose
8070d6a4e6 Send Accept-Language when connecting a chat socket 2025-06-25 13:16:37 -07:00
Alex Bakon
56c63a4838 Refactor registration errors on existing types 2025-06-20 17:14:52 -04:00
Alex Bakon
02b786b07e Limit device ID to the range 1-127
This is already required for sealed sender messages and enforced by the server.
2025-06-13 14:18:16 -04:00
Jordan Rose
97a2ded3f6 node: Replace Buffer with Uint8Array nearly everywhere
Exceptions:
- Buffers decoding from strings (usually for tests)
- Buffer.concat, if immediately fed into libsignal, which we know
  won't rely on the diverging behavior of slice()
- Encoding GroupIdentifier to base64

Everywhere else, Uint8Array was nearly a drop-in replacement. Places
where it wasn't:
- For tests, use assertArrayEquals more, which converts to hex first
  (better diffs anyway)
- Use TextEncoder and TextDecoder for going back and forth between
  strings and UTF-8 buffers *not* in the tests
2025-06-12 16:49:20 -07:00
Alex Bakon
37a834dbd4 Move some tests out of monolithic PublicAPITest.ts 2025-06-12 18:23:55 -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
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