0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 12:02:18 +02:00
Commit Graph

916 Commits

Author SHA1 Message Date
Jordan Rose
f5b8037498 zkgroup: Add benchmarks for GroupSendCredential handling 2024-01-19 16:38:51 -08:00
Jordan Rose
5436160313 Bump to version v0.39.2 2024-01-18 16:04:39 -08:00
Jordan Rose
bf6ef9063c Node: Expose SealedSenderMultiRecipientMessage parsing
...for testing purposes (@signalapp/mock-server).
2024-01-18 14:55:14 -08:00
Jordan Rose
f7e133b28e Node: Run prettier on the fixed part of Native.d.ts 2024-01-18 14:55:14 -08:00
moiseev-signal
16631a88ca
Use SVR3 staging domains and enclaves 2024-01-18 13:37:28 -08:00
Jordan Rose
b31ca0781c Remove length parameter for webpsan
The way images are displayed on Android makes it annoying to provide,
and the implementation of webpsan doesn't actually need it.
2024-01-18 12:36:31 -08:00
Dimitris Apostolou
be16e47d7f Fix typos 2024-01-18 12:09:47 -08:00
Alex Konradi
174919865d
Make ffi::CallbackError::check return a Result
Use Result to signal success or failure instead of Option::Some
signalling an error. This makes it easy to use combinators like
Result::map_err to more succinctly express the same operations.
Introduce a helper for SignalProtocolError to more succinctly construct
ApplicationCallbackError instances.
2024-01-18 09:46:29 -05:00
moiseev-signal
b2f6a791d3
Add Nitro support to SVR3 2024-01-17 16:59:54 -08:00
Alex Konradi
5451ca238a Add validation for reactions in message chat items 2024-01-16 15:34:49 -05:00
Alex Konradi
2868274003
Add validation for backup ChatItem frames
Check UUIDs and lengths of binary keys, and add some missing foreign key 
checks. The guiding principles for this approach are

a) using types that witness to correctness of the converted values
b) using a simple recursive structure for fallible conversion
c) exhaustively destructuring and matching to prevent missing checks

While this ends up producing verbose code, the code itself is simple and more 
likely to be obviously correct.
2024-01-16 15:13:03 -05:00
moiseev-signal
ca1e7d799d
Add format version to serialized OpaqueMaskedShareSet 2024-01-16 11:18:05 -08:00
Alex Konradi
810802e787
Move AWS Nitro root certificate into other file 2024-01-12 17:00:36 -05:00
Alex Konradi
83e3722783
Upgrade dependencies
Update to semver-compatible versions of all crates. Prevent duplicate
versions of crates by updating
- http to v1.0.0
- indexmap to v2.1.0

Run `yarn upgrade`
2024-01-12 14:52:28 -05:00
Alex Konradi
2a313f3b2a
Print to stderr when unknown fields are found in backup 2024-01-12 14:28:48 -05:00
Alex Konradi
551ed722b0
Update nightly rust to recent version
Fix a bunch of issues revealed by the upgraded clippy

- update UUID library for improved uuid! parser macro
- make #[cfg(test)] block the last thing in a file
- call .to_string() instead of format! without interpolation
- use infallible conversion instead of try_into().expect
- remove redundant "Error" suffix from enum variant names
- remove unused type
2024-01-12 13:58:55 -05:00
Jordan Rose
d0879d7150 Bump to version v0.39.1 (Node-only release) 2024-01-10 17:18:20 -08:00
Alex Konradi
3afe5bfe58
Implement protobuf unknown field detection using field descriptors
Implement protobuf unknown field search by walking the tree of field
descriptors.
2024-01-10 17:08:13 -05:00
Jordan Rose
897051d97c protocol: Disable mlkem1024 for slightly faster non-test compiles
Previously we had the feature off but listed the dependency on
pqcrypto-kyber as non-optional, which was wasted work.

Note that the two versions of pqcrypto-kyber don't actually coexist
today! This should be treated as an API proof-of-concept, much like
our Kyber768 wrapper.
2024-01-10 13:19:06 -08:00
Jordan Rose
455b3bf7a0 Bump to version v0.39.0 2024-01-10 13:17:40 -08:00
Alex Konradi
6e88a0169f
Check backup recipient frame values
Check that a Frame that contains a Recipient proto contains valid data.
This adds validation for the `destination` field, which was previously
ignored.
2024-01-10 15:51:51 -05:00
moiseev-signal
94292db235
Use external RNG for random scalar in OPRF client 2024-01-10 12:28:32 -08:00
Jordan Rose
70a9662acd usernames: Expose Username.fromParts to app languages 2024-01-10 12:26:19 -08:00
Jordan Rose
0ef2c7cc54 usernames: Split up BadDiscriminator error into more specific errors
Rust: UsernameError now has more cases. ProofVerificationFailure is
also split off into its own error type, separate from structural
username errors.

Java: Subclasses of BadDiscriminatorException have been added.

Swift: Some error codes have been renamed and others have been added.

TypeScript: Some error codes have been renamed and others have been
added. Discriminator errors are now proper LibSignalErrors.
2024-01-10 12:26:19 -08:00
Jordan Rose
c7e60b8e5b usernames: Add Username::from_parts method
This applies the NicknameLimits that were previously only checked in
Username::candidates_from, in addition to validating other aspects of
the username.
2024-01-10 12:26:19 -08:00
moiseev-signal
9bbb981756
Implement generic Svr3Connection::connect 2024-01-08 15:09:25 -08:00
Alex Konradi
fa166ecf8b Push Option down into argument groups
When groups of arguments are used together, it seems like it makes sense
to put them in a single struct and include the struct as a field wrapped
in an Option with a flatten annotation at the top level. Unfortunately,
there is a bug in clap that pevents this from working as intended. This
patch pushes the optionality down at the cost of making the handling
code more verbose.
2024-01-08 16:56:55 -05:00
Alex Konradi
e3289db3ba
Add message backup validator executable
Add an executable target that reads backup files from disk or from stdin (by 
buffering the contents in memory to allow seeking), decrypts the contents if 
keys are provided, validates, and prints the output if requested.
2024-01-08 14:52:27 -05:00
Jordan Rose
0ed36f62e0 usernames: Refuse to generate hashes for nicknames over 48 chars long
The scalars associated with these nicknames would be out of range of
the Ristretto group's prime order, meaning curve25519_dalek's Scalar
won't be able to hold them. Previously the value silently wrapped
around to the start of the group, but that would conflict with a
shorter nickname's scalar.
2024-01-08 09:49:36 -08:00
moiseev-signal
26e589fc4d
Add length checks to low-level PPSS operations 2024-01-05 16:26:38 -08:00
moiseev-signal
23a68fb021
Make it harder to forget to clear pending session state fields 2024-01-05 16:23:06 -08:00
Alex Konradi
60b7c42d71
Add basic message backup protobuf validation
Check for duplicate records and foreign keys. Checking for unknown fields is 
deferred for a future change.
2024-01-05 16:09:29 -05:00
Jordan Rose
4a69727457 Bump to version v0.38.0 2024-01-05 11:04:43 -08:00
Jordan Rose
62aacf553d Avoid using div_ceil to maintain compatibility with Rust 1.72 2024-01-05 10:46:48 -08:00
moiseev-signal
1657f09745
Implement SVR3 and its SGX connection using libsignal-net 2024-01-03 15:20:14 -08:00
Alex Konradi
b3a6a8884d
Add streaming decoder for encrypted gzipped files
Add a reader that wraps a seekable stream and decrypts and decompresses it after
checking that the trailing HMAC is correct.
2024-01-03 13:56:04 -05:00
moiseev-signal
c86c74c288
Generalize Handshake type for different enclaves 2023-12-22 13:10:24 -08:00
Jordan Rose
d394f30644 protocol: Add a 'kem' example that can run through KEM operations 2023-12-20 16:22:21 -08:00
moiseev-signal
931691ffcf
Allow specifying certificates when creating CdsiEndpointConnection 2023-12-20 15:16:19 -08:00
Alex Konradi
e7e9ae5860
Add length-delimited message parser
Add a parser for length-delimited messages read from a stream. For message 
backup, these will be decrypted protobufs.
2023-12-20 17:07:08 -05:00
Jordan Rose
54dfd7a395 Allow mixed comparisons between ServiceId and Aci/Pni 2023-12-20 12:44:00 -08:00
Jordan Rose
33aca3ad7b Expose ServiceId::kind method as pub 2023-12-20 12:44:00 -08:00
Jordan Rose
534df59163 usernames: Use hmac crate directly 2023-12-18 11:30:57 -08:00
Alex Konradi
4733aceef4
Start message-backup crate with protos and keys
Introduce the message-backup crate with protobuf definitions and code to derive 
keys used to encrypt, store, and decrypt backups.
2023-12-15 18:15:07 -05:00
moiseev-signal
3fb7048330
Add high level PPSS API 2023-12-14 16:27:22 -08:00
Jordan Rose
31babcbd68 Bump to version v0.37.0 2023-12-13 15:57:14 -08:00
Jordan Rose
75811b90dc Move ServiceId + ProtocolAddress to new libsignal-core crate
...as well as related types Aci, Pni, ServiceId,
ServiceIdFixedWidthBinaryBytes, ServiceIdKind, and DeviceId.

...so that zkgroup and libsignal-net don't have to depend on
libsignal-protocol (and indirectly on Kyber).

The types are still exported from libsignal-protocol, so this is not a
source-breaking change.

ProtocolAddress is still defined as a (String, DeviceId) pair; a
switch to (ServiceId, DeviceId) will probably still happen in the
future, but not in this commit.
2023-12-13 09:20:19 -08:00
Alex Konradi
55b304cc4b Use SimpleArgTypeInfo for E164s
Remove duplicated parsing dispatch code from bridged functions that take
E164s by using the existing argument conversion machinery.
2023-12-13 10:06:45 -05:00
Alex Konradi
776d11c37b Use panic in place of ServerExitStatus
Use completion of the websocket handler as an indication of success and
any error, e.g. from a panic, as a cause of failure.
2023-12-12 16:51:20 -05:00
Jordan Rose
0d09a8352c
Add GroupSendCredential
This credential is issued by the group server and presented to the
chat server to prove that the holder is a member of *some* group with
a known list of people. This can be used to replace the access key
requirement for multi-recipient sealed sender sends.
2023-12-11 13:45:12 -08:00