Commit Graph

247 Commits

Author SHA1 Message Date
Jordan Rose
776cf0601e Remove deprecated overloads of KyberPreKeyStore.markKyberPreKeyUsed 2025-11-06 16:10:09 -08:00
Jordan Rose
2d48bf8441 swift: Expose UnauthUsernamesService.lookUpUsernameLink(_:entropy:) 2025-10-17 12:15:05 -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
f19815b938 swift: Add a low-level helper invokeFnReturningValueByPointer
...and use it to avoid having to name return types for bridge
functions, which return by out-parameter.
2025-10-14 11:22:22 -07:00
Jordan Rose
388e294acf bridge: Eliminate FakeChatSentRequest in favor of pairs 2025-10-10 16:56:15 -07:00
Jordan Rose
fed4bbb20f ffi: Use pair-returning bridge_fns for error accessors too 2025-10-09 11:31:20 -07:00
Jordan Rose
4503a19190 Unify IdentityKeyPair_Deserialize implementations
...in the process revealing that the Java declaration had a missing
exception spec.
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
andrew-signal
2bc167b5a2 Add BuildVariant parsing/overload support to libsignal's Remote Config 2025-09-30 22:35:21 -04:00
Jordan Rose
1e7d61cf2d swift: Get our comments DocC-clean 2025-09-29 09:48:14 -07:00
moiseev-signal
0e9c85c354 keytrans: Unify errors with other typed APIs 2025-09-26 11:47:40 -07:00
Jordan Rose
15af92c93d protocol: Record signed prekey and base key used with a Kyber prekey 2025-09-16 15:33:59 -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
446805bb62 ffi: Simplify hex_encode helper
Ever so slightly less efficient in how it will check the arguments,
but also reuses existing conversion logic.
2025-08-15 17:23:25 -07:00
Jordan Rose
9e2bcb2a74 SVRB: Distinguish "automatic retry" from "manual retry" errors
- Java: This distinction is already made, just reworded

- Node: We include "protocol errors" in IoError here, where retrying
  probably won't help, but it won't really be harmful either.

- Swift: Automatically retryable errors are now enumerated; other
  errors are still described as "manually retryable". (Also, fixed a
  redundant error message format call.)
2025-08-14 16:14:12 -07:00
Jordan Rose
dd5c2e2966 swift: Remove copy/pasted error descriptions for SvrB.store(...) 2025-08-13 16:02:58 -07:00
Jordan Rose
b4cd040474 Add SvrB.remove(), use it for app-level integration tests 2025-08-13 12:35:52 -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
Jordan Rose
fd8322b53e SVRB: Clarify what "chain" refers to in the doc comments 2025-08-07 17:28:02 -07:00
Jordan Rose
7cbdf26774 ffi: Align handling of svrb::Error::DecryptionError, document recovery
Java and Node treat DecryptionError like MetadataInvalid, since it's
more likely the metadata got corrupted than SVR did. Follow suit for
Swift, and then document the thrown errors like the other platforms.
2025-08-06 17:46:57 -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
Alex Bakon
bb05cc016e Streamline bridging of SVR-B function arguments 2025-07-29 14:18:16 -04:00
Jordan Rose
9e9c375db9 Expose BackupForwardSecrecyToken-aware MessageBackupKey derivation 2025-07-28 13:53:19 -07:00
Jordan Rose
7c9bc53358 Bridge SVR-B to Swift
Co-authored-by: Andrew <andrew@signal.org>
2025-07-28 13:21:18 -07:00
Alex Bakon
303b6313bd Expose SVR-B logic from Rust 2025-07-25 17:36:12 -04:00
andrew-signal
47a4eeabb5 Bridge BackupForwardSecrecyToken to Swift/Kotlin/TypeScript 2025-07-23 19:57:16 -04:00
andrew-signal
ec3c273219 Expose Rust API for SVR-B 2025-07-23 18:59:54 -04:00
Jordan Rose
a410849578 crypto: Add a stripped-down HPKE API for our Curve25519 keys 2025-07-15 16:17:23 -07:00
Jordan Rose
9ea06083f6 swift: Put back names for unused parameters
Even though the parameters are unused, the names are still useful
documentation and placeholders for code completion.
2025-07-14 17:35:25 -07:00
Jordan Rose
0d48e043d1 chat: Use LanguageList all the way up to the bridge layer
And save a few bytes with no spaces after commas.
2025-07-09 11:15:01 -07:00
Jordan Rose
3c1ee4aee2 ffi: Make &SignalFfiError a valid bridge_fn argument 2025-07-02 13:37:53 -07:00
Alex Bakon
a7f823771f Combine CreateSession push_token, push_token_type
These fields should always be present or absent together.
2025-06-26 17:19:05 -07:00
moiseev-signal
d0425f2d3f swift: Make FingerprintMismatch error more useful 2025-06-25 15:20:04 -07:00
Jordan Rose
8070d6a4e6 Send Accept-Language when connecting a chat socket 2025-06-25 13:16:37 -07:00
Jordan Rose
9e13263581 Switch to swift-format for formatting instead of swiftformat
swift-format is owned by the Swift project and is generally less
opinionated than swiftformat (but better at formatting to a limited
line length).
2025-06-25 11:24:57 -07:00
moiseev-signal
442a507168 swift: Make GroupIdentifier conform to Hashable 2025-06-25 11:22:16 -07: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
809f8d817c Swift: mark unused arguments with _ 2025-06-17 09:23:39 -04:00
Jordan Rose
02c03c3247 swift: Variadic withAllBorrowed, to break down the pyramids of doom 2025-06-13 17:49:56 -07:00
Alex Bakon
8e950c4691 Port Swift args, return types from [UInt8] to Data 2025-06-13 15:15:04 -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
7a257f0d36 swift: Remove conditionals for pre-6.0 Swift versions 2025-06-12 11:23:38 -07: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
moiseev-signal
bf096c449d keytrans: Improve errors 2025-05-30 16:00:06 -07:00
moiseev-signal
70c342bb5d keytrans: Bridge to ffi 2025-05-27 17:03:39 -07:00
Alex Bakon
e760168a51 Fixup registration service code and improve docs 2025-05-21 12:16:59 -04:00