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

1990 Commits

Author SHA1 Message Date
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
d47f96abff Bump version number in the acknowledgments too 2023-12-13 16:06:50 -08:00
Jordan Rose
31babcbd68 Bump to version v0.37.0 2023-12-13 15:57:14 -08:00
Alex Konradi
20c4966cd8
Prevent auto-merging of acknowledgement text files (#454)
Adjust the attributes so that git will treat the generated acknowledgment files 
as binary for the purposes of merging. This will ensure that a merge of two 
branches that both alter the acknowledgments will require manual resolution 
(ideally by re-running the generation script).
2023-12-13 17:02:19 -05:00
Alex Konradi
d168b556da
Fix AGPL 3 license count 2023-12-13 16:08:27 -05:00
Alex Konradi
acabde87e2 Use cargo-about 0.6.0 to produce acknowledgements
The new version introduced a couple changes that are reflected here:

- Rename override_git_commit -> override-git-commit in about.toml since
  that's now the canonical spelling.
- Regenerate the license list since a bug was fixed that changed the
  semantics of the count.

Also pin the version in our documentation and in the script to prevent
differences in behavior depending on when cargo-about was installed on
developer machines.
2023-12-13 14:52:31 -05: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
88a25e889e Collect acknowledgments for libsignal's Cargo dependencies 2023-12-11 16:39:33 -08:00
Jordan Rose
94d1e151fe CI: Add a manual check for -Xcheck:jni warnings 2023-12-11 14:34:25 -08: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
Jordan Rose
bc18bb0ecf SSv2: Parallelize the generation of per-recipient key material
This uses the Rayon library to perform a MapReduce-like operation of
computing key material on recipients and folding them together into
intermediate buffers, with one final collection step at the end. As
written this uses Rayon's default thread pool, which will be lazily
initialized with one worker thread per logical core. We're not trying
to share thread pools with either libsignal-net's tokio contexts,
RingRTC's dedicated threads, or a platform-specific work queue like
iOS's Dispatch; let's keep things simple for now.

As a downside, the code now has to fetch all of the recipients'
identity keys up front, since it's not guaranteed that loading from
the IdentityKeyStore is thread-safe. However, the significant
improvement in wall time spent generating key material for large
recipient lists on even a dual-core system makes this worth it.
2023-12-11 12:36:54 -08:00
Jordan Rose
16653ffea1 SSv2: Add send support for excluded recipients 2023-12-11 12:36:54 -08:00
Jordan Rose
4e6e8c24a7 SSv2: Add send support for the compact device list format
This takes advantage of the fact that multiple devices for the same
user will have the same identity key and therefore will use the same
per-recipient SSv2 data anyway.

This commit also enforces (on the client send side) that device IDs
are in the range 1..=127 for destinations of a SSv2 message.
2023-12-11 12:36:54 -08:00
Jordan Rose
2019a4a2b8
Fuzz test fixes related to pre_key_id and archived sessions count
- Ensure positive, unique (signed_)pre_key_id values.
- Limit archiving more strictly based on sum of me/them.archive_count.

Co-authored-by: Jonathan Moody <103143855+moodyjon@users.noreply.github.com>
2023-12-11 10:38:44 -08:00
Jordan Rose
7c5010a33a jni: Make sure to clean up local JNI references when logging
While neither Oracle's JRE nor Android's misbehaves if you go over
your limit of local references, it may result in the local frame
growing arbitrarily large. We don't want that.
2023-12-08 14:19:20 -08:00
moiseev-signal
6e5e3b0b9f
Use uninhabited types for KeyKind markers 2023-12-08 14:08:22 -08:00
Alex Konradi
e13d9ff8d6
Include more detail in websocket errors
Include more details about what went wrong in the error messages without 
revealing user data.
2023-12-08 17:03:46 -05:00
Alex Konradi
c94b0dd03f
Improve chat websocket debuggability
Add some debug logging and derive Debug for several types.
2023-12-08 16:33:31 -05:00
Jordan Rose
1edbdfcc70 node: Add some assertions to match the other platforms' tests 2023-12-08 12:11:25 -08:00
Jordan Rose
0e7963f787 swift: Fix SenderKeyDistributionMessage.distributionId
Had the same problem as the Java version!
2023-12-08 12:11:25 -08:00
Jordan Rose
6a2ebfdabf java: Fix SenderKeyDistributionMessage.getDistributionId()
...which was using the wrong untyped Native function!
2023-12-08 12:11:25 -08:00
Jordan Rose
1229846d06 java: Convert GroupCipherTest to JUnit 4 2023-12-08 12:11:25 -08:00
Jordan Rose
4bf90bc71a bridge: Move symbol prefixes to env variables set in build.rs
A small step towards separating `bridge_fn` into its own reusable
crate.
2023-12-08 10:50:07 -08:00
Jordan Rose
2c9e3e9d69 ffi: Use size_t to represent Rust usize instead of uintptr_t
Rust's usize serves the same purpose as both size_t and uintptr_t in
C, but for our uses it's always a buffer length or capacity rather
than something specifically the same size as a pointer or machine
register, so size_t is more accurate.

Swift, then, imports size_t as its currency type Int, even though
size_t is unsigned in C, because no buffer can actually fill up all of
memory. Swift, like Rust, doesn't have implicit numeric conversions,
so importing size_t as Int was deemed more useful in practice.
2023-12-07 17:42:34 -08:00
Jordan Rose
2364c268a0 ffi: Prefer std::ffi::* over libc::* for c_void, c_int, etc
And use usize for size_t:
- They're always equivalent in practice.
- When we're actually using it as a memory size, we're talking about
  the size of Rust objects, so usize is more accurate anyway.

This eliminates the use of the libc crate in the bridge layer. We
still use libc for time_t in attest and device_transfer, to interact
with BoringSSL.
2023-12-07 17:42:34 -08:00
Max Moiseev
126f87b73c Bump to version 0.36.1 2023-12-06 15:20:54 -08:00
Alex Konradi
a7cae88e2c
Update curve25519-dalek to 4.1.1 2023-12-06 14:58:14 -08:00
Alex Konradi
07337e2145
Wrap response to server push in MessageProto 2023-12-06 14:47:37 -08:00
Clark
7bf7b5e261
Java: Take in session list for sealed sender multiRecipientEncrypt 2023-12-06 10:03:32 -08:00
Jordan Rose
d67e59f540 Tweak RELEASE.md for automatic Sonatype releases 2023-12-06 09:58:44 -08:00
Jordan Rose
b7bbabd228 Bump to version v0.36.0 2023-12-05 13:00:53 -08:00
Alex Konradi
7f078d7b3c
Accept body in response without content-length 2023-12-05 14:23:45 -05:00
Alex Konradi
1f2d761889
Allow returning handle types from Swift invokeAsyncFunction
Implement the Completable protocol for OpaquePointer and add a test that runs
futures that return handle types to prove that it works.
2023-12-04 16:39:32 -05:00
Alex Konradi
6b50a95bc9
Fix swift linting issues
Fix an existing issue caught by the linter and exclude files generated during
build from linting (since some of them are missing header comments required by
the linter).
2023-12-04 14:27:52 -05:00
Sergey Skrobotov
e8f6274386 libsignal-net: reusing ws components 2023-12-01 14:04:17 -08:00
Alex Konradi
f06faef7a4
Split CDSI lookup to allow token retrieval
Split the libsignal-net implementation of CDSI lookup into two parts: one that
does the initial handshake and token acquisition, and the other to acknowledge
the token and then parse results. Expose the token in Java via the same Consumer
type used in the Android codebase.
2023-12-01 16:05:10 -05:00
Alex Konradi
2c985f3d84
Add CompletableFuture.thenCompose
This is needed for splitting up the CDSI lookup function. The signature mirrors
the Java standard library version.
2023-11-30 16:13:05 -05:00
Alex Konradi
1c6e8e512d
Fix CompletableFuture error handling
Fix the behavior of CompletableFuture.thenApply so that if the applied function
throws an exception, the pending future receives the exception (instead of never
completing). Add tests.
2023-11-30 15:38:22 -05:00
Max Radermacher
05b88ad1d1
Adopt modern SignalCoreKit logging APIs 2023-11-28 11:17:54 -08:00
Rolfe Schmidt
4a00533d03
Use u64 for SVR server IDs 2023-11-22 09:46:01 -07:00
Rolfe Schmidt
806a320a12 Implement XOR secret sharing
Co-authored-by: Max Moiseev <moiseev@signal.org>
Co-authored-by: Rolfe Schmidt <rolfe@privacyresearch.io>
2023-11-21 11:57:29 -08:00
moiseev-signal
0ae3eb3c14
protocol: Clean up pending Kyber pre-keys from sessions 2023-11-17 14:46:03 -08:00
gram-signal
55b61dd1dd
Add SVR2 attestation constants for newly created SVR2 mrenclaves. 2023-11-16 15:15:13 -07:00
Alex Konradi
7f023e7d46
Fix exclude for libsignal-net tests on Android
Use the path within the directory specified by srcDir without the common
prefix. Verified with ./gradlew test :android:connectedDebugAndroidTest
locally.
2023-11-16 14:47:17 -05:00