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.
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.
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`
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
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.
Check that a Frame that contains a Recipient proto contains valid data.
This adds validation for the `destination` field, which was previously
ignored.
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.
This applies the NicknameLimits that were previously only checked in
Username::candidates_from, in addition to validating other aspects of
the username.
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.
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.
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.
...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.
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.