Commit Graph

18 Commits

Author SHA1 Message Date
gram-signal
533d11dd7c Remove usePqRatchet from client-facing code, defaulting to always use. 2025-10-02 11:32:36 -07:00
Alex Bakon
fb33f261bf Upgrade crates to Rust 2024 edition
Co-authored-by: Andrew <andrew@signal.org>
2025-09-03 15:12:59 -04:00
Alex Bakon
4ea5b762ba Format Rust using 2024 edition rules 2025-09-03 14:22:08 -04:00
Jordan Rose
0760d3bc5d cross-version: Add a test for sealed sender messages 2025-06-17 11:17:30 -07:00
Jordan Rose
1ed212371e cross-version: Remove redundant work
- Current<->Current is already tested
- The versions in use are already logged
2025-06-17 11:17:30 -07:00
Jordan Rose
c2f99663a8 cross-version: Move some helpers into the library proper
...in preparation for more tests that are otherwise independent.
2025-06-17 11:17:30 -07:00
Jordan Rose
e15fb72146 cross-version: Fix some Clippy lints 2025-06-17 11:17:30 -07:00
Jordan Rose
2879220e93 Require Kyber keys/ciphertexts throughout all XDH APIs 2025-06-13 16:06:07 -07:00
Alex Bakon
3157a9be55 Fix device ID construction in cross-version tests 2025-06-13 17:24:01 -04:00
Jordan Rose
69bb363840 protocol: Reject X3DH PreKey messages
- Drop X3DH tests

- Drop cross-version tests with libsignal v0.12 and v0.21

- Change session benchmarks to use PQXDH, which is relevant if doing
  comparisons before/after this commit.
2025-06-13 12:19:04 -07:00
gram-signal
61827e1cfe Fix cross-version test compilation. 2025-06-04 12:50:11 -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
Alex Bakon
13b2b8aff4 Take RNG as a parameter when generating kyber keys 2025-04-29 10:54:21 -04:00
Alex Bakon
00ca3f4fd8 Replace pqclean crate usages with libcrux 2025-04-29 09:22:09 -04:00
Alex Bakon
aeb2f2a561 Bump rand dependency to 0.9 2025-04-24 13:12:56 -04:00
Alex Konradi
a54e6b5b33 Format with group_imports=StdExternalCrate 2024-08-28 14:52:47 -04:00
Jordan Rose
85e0de9207 Update Rust dependencies
`cargo update` performed with Cargo 1.72 to avoid advancing our MSRV. assert_cmd, clap, protobuf, and protobuf-json-mapping needed to be manually held back.

Plus, explicit bumps for
- env_logger 0.11
- heck 0.5
- itertools 0.13
- num_enum 0.7
- prost 0.13
- tungstenite 0.23

And disallowing downgrading curve25519-dalek below the security update in 4.1.3.
2024-07-25 13:33:09 -07:00
Jordan Rose
301a117384 Add a cross-version-testing crate for libsignal-protocol
By importing past tags of libsignal-protocol, we can check how the
current implementation behaves against previous versions. This initial
test only does v3 (pre-Kyber) 1:1 sessions, but we can add more tests
in the future.
2023-09-20 06:35:36 -07:00