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

1099 Commits

Author SHA1 Message Date
Jordan Rose
05da19f8b0 crypto: Remove AES-GCM-SIV implementation 2021-07-01 13:46:20 -07:00
Jordan Rose
d72047a245 Bridge: expose RustCrypto's AES-GCM-SIV instead of our own
Same as before, but for the wrapper exposed to the app languages.
2021-07-01 13:46:20 -07:00
Jordan Rose
59974cf627 Update aes and block_modes crates to match aes-gcm-siv's dependencies
Also turn on the AES crate's use of ARMv8 intrinsics
2021-07-01 13:46:20 -07:00
Jordan Rose
1a05d5cb0d protocol: Use RustCrypto's AES-GCM-SIV instead of our own
Now that RustCrypto aes-gcm-siv supports runtime-detected ARMv8 and
x86_64 crypto intrinsics, we don't need our own implementation, which
will be removed from signal-crypto in a later commit.
2021-07-01 13:46:20 -07:00
Jordan Rose
9e168226f6 Docker: Fix typo in 3a3476b83: paths are relative to the repo root
This COPY command never should have worked, but the macOS Docker seems
to normalize ../foo to ./foo, so it passed my local testing.
2021-06-28 14:30:38 -07:00
Jordan Rose
348df2a268 Bump version to v0.8.2 2021-06-28 12:52:57 -07:00
Jordan Rose
ccb3dea7ea
Merge pull request #329 from signalapp/jrose/docker-rust-toolchain
Docker: use the rust-toolchain file instead of hardcoding a version
2021-06-22 14:14:41 -07:00
Jordan Rose
3a3476b833 Docker: use the rust-toolchain file instead of hardcoding a version 2021-06-22 13:19:46 -07:00
Jordan Rose
ffd2fe1664
Merge pull request #323 from Imperiopolis-Signal/nt/m1-and-catalyst-support
Add support for M1 and Catalyst architectures via cocoapods
2021-06-10 17:27:12 -07:00
Nora Trapp
720d796f76 Add support for M1 and Catalyst architectures via cocoapods 2021-06-10 11:34:10 -07:00
Nora Trapp
81ffe0af51 Update toolchain to nightly-2021-06-08 2021-06-09 14:04:22 -07:00
Jordan Rose
df4ba53aed
Merge pull request #324 from cryptomilk/asn-fix-python3
node: Build node modules with python3
2021-06-09 09:30:30 -07:00
Andreas Schneider
a8a24f66c6 node: Build node modules with python3
This fixes the build on openSUSE Tumbleweed.
2021-06-09 09:19:17 +02:00
Jordan Rose
c042f16fbb
Merge pull request #320 from pierwill/fix-intra-doc-link
Fix intra doc link
2021-06-02 12:19:52 -07:00
Jordan Rose
b715e02aa9 Bump to version 0.8.1 2021-06-02 11:14:12 -07:00
Jordan Rose
2d8d13cf77
Merge pull request #322 from signalapp/jrose/update-neon
Update to (our fork of) Neon 0.8.3
2021-06-02 11:13:40 -07:00
Jordan Rose
83b0218cb1 Update to (our fork of) Neon 0.8.3
Fixes a memory leak.
2021-06-02 10:52:05 -07:00
Jordan Rose
6259292b20
Merge pull request #321 from signalapp/jrose/java-sealed-sender-group-id-on-success
Java: include the sealed sender groupId on sucessful decryption
2021-06-02 10:45:56 -07:00
Jordan Rose
08e72307ca Java: include the sealed sender groupId on sucessful decryption
This is useful for PlaintextContent messages (just
DecryptionErrorMessage for now), which can't include a group ID when
sent outside of sealed sender because it would reveal group
membership.
2021-05-28 10:06:31 -07:00
pierwill
c529ce719a Fix intra doc link 2021-05-27 21:04:20 -05:00
Jordan Rose
a095f6a1fc Bump version to 0.8.0 2021-05-27 14:32:06 -07:00
Jordan Rose
1867f75b07
Merge pull request #318 from signalapp/jrose/DecryptionErrorMessage-deviceId
Add a deviceId field to DecryptionErrorMessage
2021-05-27 14:08:06 -07:00
Jordan Rose
e5cd6fcc48
Merge pull request #319 from signalapp/jrose/java-save-usmc-in-protocol-exception
Java: put the UnidentifiedSenderMessageContent in a ProtocolException
2021-05-27 14:07:27 -07:00
Jordan Rose
b54a830013 Java: put the UnidentifiedSenderMessageContent in a ProtocolException
That is, when there's an error decrypting the inner payload of a
sealed sender message, instead of just saving the sender (and more
recently the content hint and group ID), save the whole decrypted
contents of the sealed sender message. This is necessary so that the
app can make a DecryptedErrorMessage from that failed payload.

This is complicated somewhat by the fact that the app also uses the
"short" constructor for the various Protocol*Exceptions, so we have to
keep those working.
2021-05-27 12:27:48 -07:00
Jordan Rose
b780409c1b Add a deviceId field to DecryptionErrorMessage
This allows a device to know whether it's the one that sent a bad
message, and take action accordingly.

We could have a slightly more typesafe API here by using
ProtocolAddress and extracting the device ID, but that doesn't match
up with getting the device ID out of a sealed sender certificate.
2021-05-26 17:23:42 -07:00
Jordan Rose
4c0141c31f Fix merge conflict in Java and Swift tests too. 2021-05-26 16:43:11 -07:00
Jordan Rose
b17b83614c Node: fix merge conflict in tests. 2021-05-26 16:41:48 -07:00
Jordan Rose
0f2ae6ee53 Bump version to 0.7.0 2021-05-26 16:32:06 -07:00
Jordan Rose
2491447ee7
Merge pull request #316 from signalapp/jrose/DecryptionErrorMessage-and-PlaintextContent-2
Add DecryptionErrorMessage and PlaintextContent (alternate)
2021-05-26 16:27:49 -07:00
Jordan Rose
0bf80c7fc3
Merge pull request #317 from signalapp/jrose/ContentHint
Finalize ContentHint design
2021-05-26 16:20:11 -07:00
Jordan Rose
51dd86a1db Finalize ContentHint design
- Default: sender will not resend; an error should be shown
  immediately
- Resendable: sender will try to resend; delay any error UI if
  possible
- Implicit: don't show any error UI at all; this is something sent
  implicitly like a typing message or a receipt
2021-05-26 15:57:45 -07:00
Jordan Rose
f7acf9005e Add SessionRecord.currentRatchetKeyMatches
This checks if there is an active sender state using the given ratchet
key, for use with decryption error messages. In this case, the app may
choose to archive the current session, or take even stronger actions
such as fetching new prekeys for the recipient.
2021-05-26 15:41:04 -07:00
Jordan Rose
3f3a6e1aca Expose DecryptionErrorMessage and PlaintextContent to Java/Swift/TS 2021-05-26 15:41:04 -07:00
Jordan Rose
3828be3656 Add a PlaintextContent, a CiphertextMessage for unencrypted content
For now this only supports DecryptionErrorMessage, which is sent
without session encryption because something might be wrong with the
session. In the future we might have other kinds of PlaintextContent;
what's important is that we don't mix up content that's okay to send
unencrypted with content that should never be in the clear.

Note that even though the content might not be session-encrypted, it
can still be put in a sealed sender message, which has its own
encryption.
2021-05-26 15:13:04 -07:00
Jordan Rose
7fd8033dc3 Add DecryptionErrorMessage
This is a new message type that indicates that the current app was
unable to decrypt a received message (for instance, because they don't
have the sender key needed to decrypt a SenderKeyMessage). It includes
the timestamp of the original message as well as the "ratchet key" to
identify the 1:1 session it came from, if applicable.

This is a content message, like SenderKeyDistributionMessage. See next
commit.
2021-05-25 18:28:47 -07:00
Jordan Rose
5ff6762086
Merge pull request #314 from signalapp/jrose/0.6.0
Bump version to 0.6.0
2021-05-21 15:28:44 -07:00
Jordan Rose
a41233936f Bump version to 0.6.0 2021-05-21 15:04:27 -07:00
Jordan Rose
00e232d5e0
Merge pull request #309 from signalapp/jrose/SSv2-registration-ids-from-sessions
Get registration IDs from sessions for Sealed Sender v2
2021-05-21 14:29:19 -07:00
Jordan Rose
6f9083175e Get registration IDs from sessions for Sealed Sender v2
The app-visible change is that sealedSenderMultiRecipientEncrypt now
takes a SessionStore as well. Sessions will be looked up in bulk using
a new SessionStore API, 'loadExistingSessions' or
'getExistingSessions`. The registration ID is then loaded from each
session and included in the resulting SSv2 payload.

The implementation is a bit of a divergence from some other APIs in
libsignal-client in that the "look up in bulk" step is performed in
the Java, Swift, or TypeScript layer, with the resulting sessions
passed down to Rust. Why? Because otherwise we'd pass a list of
addresses into Rust, which would have to turn them back into a Java,
Swift, or TypeScript array to call the SessionStore method. This would
be (1) a bunch of extra work to implement, and (2) a waste of CPU when
we already /have/ a list of addresses in the correct format: the
argument to sealedSenderMultiRecipientEncrypt.

This is an example of "the boundaries between the Rust and
Java/Swift/TypeScript parts of the library don't have to be perfect;
they're internal to the overall product". In this case, we've taken
that a little further than usual: usually we try to make the
libsignal-protocol API as convenient as possible as well, but here it
had to be a bit lower-level to satisfy the needs of the app language
wrappers. (Specifically, callers need to fetch the list of
SessionRecords themselves.)

P.S. Why doesn't v1 of sealed sender include registration IDs? Because
for SSv1, libsignal-client isn't producing the entire request body to
upload to the server; it's only producing the message content that
will be decrypted by the recipient. With SSv2, the serialized message
the recipient downloads has both shared and per-recipient data in it,
which the server must assemble from the uploaded request. Because of
this, SSv2's encrypt API might as well produce the entire request.
2021-05-20 18:04:03 -07:00
Jordan Rose
b72e93225d
Merge pull request #312 from signalapp/jrose/jni-throw-exceptions-correctly
JNI: correctly throw exceptions that don't have a String constructor
2021-05-20 17:19:55 -07:00
Jordan Rose
b5c91c861e JNI: correctly throw exceptions that don't have a String constructor
Not all Exception types have a constructor that takes a String; for
those that don't, we can't use JNI's built-in 'throw_new' API.
2021-05-20 15:47:11 -07:00
Jordan Rose
746d200b77
Merge pull request #311 from signalapp/jrose/jni-pointers
JNI: don't reinterpret-cast a slice of longs as a slice of pointers
2021-05-20 15:38:34 -07:00
Jordan Rose
ff342e3f36 JNI: don't reinterpret-cast a slice of longs as a slice of pointers
...because we support 32-bit platforms, and that's not correct.
2021-05-20 11:22:40 -07:00
Jordan Rose
ceef64ea1f
Merge pull request #308 from signalapp/jrose/use-neon-fork
Node: Switch to our fork of Neon with faster EventQueue operations
2021-05-19 18:08:10 -07:00
Jordan Rose
9748c25f40 Node: Switch to our fork of Neon with faster EventQueue operations 2021-05-19 17:49:04 -07:00
Jordan Rose
92e239c28f
Merge pull request #307 from signalapp/jrose/fix-typo-in-publish-to-npm-action
GitHub: "Publish to NPM" action should always check out the same ref
2021-05-18 16:23:16 -07:00
Jordan Rose
f33c060f44 GitHub: add more paths that don't need PR testing 2021-05-18 16:01:28 -07:00
Jordan Rose
21f12c9197 GitHub: "Publish to NPM" action should always check out the same ref
Typo fix
2021-05-18 15:56:15 -07:00
Jordan Rose
1ed9b156d1
Merge pull request #305 from signalapp/jrose/SSv2-registration-id-placeholders
Add registration IDs to the Sealed Sender v2 upload (encrypt) format
2021-05-18 15:16:41 -07:00
Jordan Rose
e91a2879a2 Add registration IDs to the Sealed Sender v2 upload (encrypt) format
This changes the encoding only; the change in API to provide real
registration IDs will come in a follow-up.
2021-05-18 14:48:09 -07:00