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

1651 Commits

Author SHA1 Message Date
Grisha
96451a1a6c
Fixed expect message 2022-02-08 21:53:22 +01:00
Grisha
3cdb6b9258
Cargo fmt and changed .ok() to .expect() 2022-02-08 21:31:50 +01:00
Grisha
f44d7f8943
Refactored arithmetic to bit manipulation
Consider using u64::from_be_bytes()?
2022-02-08 03:15:36 +01:00
Grisha
76d640bd9e
Refactored fingerprint string encoder to iterator
Completed todo marked in comments
2022-02-08 03:09:48 +01:00
Grisha
a457d53703
Added thousands separator 2022-02-08 02:39:14 +01:00
Jordan Rose
71dac29e42 Bump to version v0.12.2 2022-01-31 18:02:49 -08:00
Jordan Rose
3bf583c5ae Update curve25519-dalek for faster deserialization 2022-01-31 17:41:22 -08:00
Jordan Rose
3c5c312e45 Bump to version v0.12.1 2022-01-27 14:37:36 -08:00
Jordan Rose
50c7c2980c
Merge pull request #442 from signalapp/jrose/java-PlaintextContent-ctor
java: Add PlaintextContent(byte[]) constructor
2022-01-27 14:34:23 -08:00
Jordan Rose
e33ce03213 java: Add PlaintextContent(byte[]) constructor
This is necessary when handling PlaintextContent *not* sent via sealed
sender.
2022-01-27 14:13:25 -08:00
Jordan Rose
1eb6ceaa8a
Merge pull request #440 from dennisameling/win-arm64
node: Add Windows ARM64 prebuilds to the NPM packages
2022-01-21 13:10:43 -08:00
Dennis Ameling
a16837fc3e node: Add Windows arm64 prebuilds to CI 2022-01-21 10:50:06 +02:00
Jordan Rose
a2bc7c03fd
Merge pull request #436 from ZabeMath/patch-1
rust: bridge: shared: macros: fix parameter typo
2022-01-03 11:35:58 -08:00
ZabeMath
d32863ba4c
rust: bridge: shared: macros: fix parameter typo 2021-12-25 22:20:49 +00:00
Jordan Rose
3da7078ffe Bump to version v0.12.0 2021-12-20 11:21:02 -08:00
Jordan Rose
600b9070c1
Merge pull request #435 from signalapp/jrose/signAlternateIdentity
Add signAlternateIdentity and verifyAlternateIdentity operations
2021-12-20 11:06:54 -08:00
Jordan Rose
68d52793da
Merge pull request #434 from signalapp/jrose/needsPniSignature
Add a new 'needs_pni_signature' field to the session state
2021-12-20 11:06:12 -08:00
Jordan Rose
66c65cda86 Expose signAlternateIdentity and verifyAlternateIdentity
- Java: on IdentityKeyPair and IdentityKey, respectively
- Swift: on IdentityKeyPair and IdentityKey, respectively
- Node: on IdentityKeyPair and PublicKey; Node doesn't have a separate
  IdentityKey API

For convenience, exposes IdentityKeyPair.generate() in Java and Node
as well. (This API already existed in Swift.)
2021-12-20 10:30:42 -08:00
Jordan Rose
48411139ef protocol: Add IdentityKeyPair::sign_alternate_identity(IdentityKey)
This can be used for one identity to attest that another identity
represents the same account.
2021-12-20 10:28:53 -08:00
Jordan Rose
6a031d0316 protocol: Add support for signing multi-part messages
This saves a bit of allocation when you want to put extra data into a
signature, which will be used in the next commit.
2021-12-20 10:28:52 -08:00
Jordan Rose
255948366b protocol: Avoid a few unnecessary copies in generic key implementation
Always match by reference, avoiding the need for the `ref` keyword and
an accidental 32-byte copy if it's missing.
2021-12-20 10:28:38 -08:00
Jordan Rose
71fdd6566e Expose SessionRecord.needsPniSignature/.setNeedsPniSignature 2021-12-20 10:21:31 -08:00
Jordan Rose
7d761a9744 Add a new 'needs_pni_signature' field to the session state
This marks that a session is being opened by Alice to reply to Bob,
who has sent a message to Alice's phone number rather than her account
UUID. Apps can check this flag to determine if they need to include
extra information in the message content to certify that yes, this
account is the owner of this phone number. The state is automatically
cleared once the current session receives a response from Bob.
2021-12-20 10:21:31 -08:00
Jordan Rose
5802545943 protocol: Remove unused field from SessionRecord 2021-12-20 10:21:31 -08:00
Jordan Rose
b503579024
Merge pull request #431 from signalapp/jrose/error-string-cleanup
protocol: Tidy up some error strings
2021-12-13 14:55:54 -08:00
Jordan Rose
689003d183 Tidy up some error strings
And straighten out InvalidState (a precondition the caller failed to
enforce) vs. InternalError (something went wrong that the caller
couldn't have checked for).
2021-12-13 12:57:11 -08:00
Jordan Rose
262349db5b
Merge pull request #430 from signalapp/jrose/separate-crypto-operation-errors
protocol: Tighten up error handling for internal crypto operations
2021-12-13 12:44:36 -08:00
Jordan Rose
4368ee3a67 protocol: Push MessageKeys validation up to SessionState
This makes it clear that the only way to get invalid MessageKeys is to
have a corrupted session, which in turn means we can remove the
InvalidCipherCryptographicParameters error case.
2021-12-13 11:12:28 -08:00
Jordan Rose
feb6f6f74e protocol: Give the crate-internal crypto helpers their own error types
Separating encryption and decryption errors makes it clearer what can
fail in what ways; using a dedicated error type forces callers within
the crate to decide how to report the error to external clients. The
next commit will remove the now-unused error case here.
2021-12-13 11:12:28 -08:00
Jordan Rose
3c7a225ce8 protocol: Remove dedicated errors for bad root and chain keys
Enforce that directly-created keys have the right length, which pushes
the error to the lazy deserialization code in a session. If the
lengths are wrong there, the session is corrupt.
2021-12-13 11:05:32 -08:00
Jordan Rose
1ed7d739cc
Merge pull request #427 from signalapp/jrose/remove-unused-errors
Remove some unused error cases/codes/types
2021-12-13 11:04:57 -08:00
Jordan Rose
315fe1963f Remove unused FFI-only error code 'InsufficientOutputSize' 2021-12-10 18:08:39 -08:00
Jordan Rose
5a67a4bf0a Remove unused error FingerprintIdentifierMismatch
Fingerprint checks are done with a boolean-returning method; the error
is never thrown. Android and iOS aren't using the exception / error
case either.
2021-12-10 18:08:39 -08:00
Jordan Rose
7ad935c2d9
Merge pull request #429 from signalapp/jrose/check-fuzz-target-on-stable
GitHub: Move fuzz target checking to the stable Rust toolchain job
2021-12-10 18:08:25 -08:00
Jordan Rose
974b7d22ca GitHub: Move fuzz target checking to the stable Rust toolchain job
...because the fuzz target doesn't have a lockfile, and crates don't
generally support arbitrary nightly versions. See
https://github.com/dtolnay/proc-macro2/issues/307 for an example.
2021-12-10 10:43:47 -08:00
Jordan Rose
5104d199d0 Bump to version v0.11.1 2021-12-03 13:37:25 -08:00
Jordan Rose
985220bff1
Merge pull request #426 from signalapp/jrose/npm-m1
NPM: Publish releases for M1 Macs too
2021-12-03 12:29:43 -08:00
Jordan Rose
3e68ca0d0e GitHub: when testing the NPM package, test the prebuilt N-API module
node-gyp-build should make sure that we don't build the Rust library
*again*, but if we do by accident, the tests should still run against
what we're going to submit, which is what's in the prebuilds/
directory.
2021-12-03 11:49:02 -08:00
Jordan Rose
13af5a5429 Node: Build for M1 Macs too
This requires building on the macOS 11 GitHub runner; the 10.15 runner
isn't set up for cross-compiling when not using Xcode.
2021-12-03 11:47:34 -08:00
Jordan Rose
be5aa8ce8b
Merge pull request #420 from signalapp/jrose/jni_args
bridge: add jni_class_name and jni_args helper macros
2021-11-29 11:58:48 -08:00
Jordan Rose
fd4b2b7324
Merge pull request #425 from whisperfish/prost-push
Update to prost 0.9
2021-11-29 10:23:08 -08:00
Ruben De Smet
b6d4aadf30
Update to prost 0.9 2021-11-28 17:32:32 +01:00
Jordan Rose
e4c31a62f6 Bump to version v0.11.0 2021-11-17 11:09:39 -08:00
Jordan Rose
93ee64793b
Merge pull request #423 from signalapp/jrose/zkgroup-pni-credential
zkgroup: Add PniCredential
2021-11-17 10:43:04 -08:00
Jordan Rose
50c1a51cd7 zkgroup: Use more strong types for PniCredentials
While they're structurally the same as ProfileKeyCredentials, they
encode different information.
2021-11-15 10:47:36 -08:00
Jordan Rose
d5f143109a zkgroup: Use one-based arrays in certain places to match the spec
The academic paper zkgroup is based on uses one-based indexes for 'y'
values, which is reflected in the poksho proof elements. Add a
OneBased wrapper so that these values can be used as an aggregate
but indexed in a way that matches the proofs.
2021-11-15 10:33:42 -08:00
Jordan Rose
145ba7f47c Expose PniCredential operations to app languages 2021-11-15 10:27:57 -08:00
Jordan Rose
db298e387d zkgroup: Add PniCredential
PniCredential is like a ProfileKeyCredential, but also contains a PNI.
It can be used to join a group where you were invited by PNI rather
than ACI.
2021-11-15 10:27:57 -08:00
Jordan Rose
9cdc98b3c9 zkgroup: Bump the number of supported credential attributes up to 6
The next commit will start making use of this.
2021-11-15 10:27:03 -08:00
Jordan Rose
4699f2110e zkgroup: Teach the credential system to support keys with N attrs
It doesn't actually *do* that yet (next commit), but at least now
there isn't a hardcoded y1, y2, y3, y4 when we might want to use more
(or fewer!) attributes in a credential KeyPair.
2021-11-15 10:27:03 -08:00