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

1188 Commits

Author SHA1 Message Date
Jordan Rose
bfb88431ff protocol: More logging for successful decryption of 1:1 messages
- Log on every successful decryption, including the session base key.
  (Previously this was just a debug-level log.)
- Log the sender for sucessful decryptions.
- Log when we process a pre-key message.
- To balance this out, don't log "we're about to deserialize a sealed
  sender message".
2021-08-18 11:49:14 -07:00
Jordan Rose
79ade49a94
Merge pull request #343 from signalapp/signal-crypto-armv8-feature
Fix armv8 feature flag for signal-crypto
2021-08-18 10:24:42 -07:00
Jordan Rose
11a1e37995 Fix armv8 feature flag for signal-crypto
This was a rebase failure where the armv8 support in signal-crypto
dependencies was not actually put behind the armv8 flag. Our CI didn't
catch it because we don't do a build that's both stable *and*
targeting aarch64, but for completeness we should get it right.
2021-08-17 18:09:08 -07:00
Jordan Rose
376a858bf1
Merge pull request #342 from signalapp/jrose/multi-recipient-encrypt-reuse-identity-work
Sealed Sender v2: reuse work when sending to the same identity key
2021-08-17 16:19:53 -07:00
Jordan Rose
eed1f8b97d Sealed Sender v2: reuse work when sending to the same identity key
Identity keys are tied to an account, not a device, so when a
multi-recipient sealed sender message is sent to every device for a
particular account, a lot of work is wasted re-encoding the ephemeral
message key and authentication tag for each device. This commit checks
to see if the current identity key is the same as the previous one and
reuses the previous encrypted message key and authentication tag if
so, drastically reducing the marginal cost of another linked device
(from ~200ms to ~2ms on my machine).
2021-08-17 14:35:13 -07:00
Jordan Rose
2d096f5086 Add some benchmarks for sealed sender (v1 and v2) 2021-08-17 14:35:13 -07:00
Jordan Rose
8af357e314 Sealed sender v2: use named constants for slice lengths
...that get used in multiple places.
2021-08-17 14:35:13 -07:00
Jordan Rose
d9bff2ea12 Expose Curve25519 key length constants 2021-08-17 14:35:13 -07:00
Jordan Rose
c7a53697b2
Merge pull request #339 from signalapp/jrose/better-ssv2-error
SSv2: when fetching a registration ID fails, mention the recipient
2021-08-17 14:27:04 -07:00
Jordan Rose
c44f1f2f81
Merge pull request #341 from signalapp/jrose/fuzz-protocol-interaction
protocol: Add a fuzz target that runs interactions between two clients
2021-08-17 14:26:48 -07:00
Jordan Rose
e80339c15f protocol: Add a fuzz target that runs interactions between two clients
Based on the fuzzing input, this simulates message sends and receives,
out-of-order delivery, dropped messages, and session resets, solely to
find bugs in happy-path interaction between two clients.
2021-08-13 16:09:04 -07:00
Jordan Rose
90011a8ba8 protocol: Improve some 1:1 logging
- Downgrade per-session decryption errors to warnings, because we try
  multiple sessions for each decryption and emit a roll-up error at the
  end.

- Remove some accidental double hex-encoding (as in, we were
  hex-encoding the ASCII hex representation of a slice).
2021-08-13 12:42:15 -07:00
Jordan Rose
fb2018aef7
Merge pull request #337 from whisperfish/armv8-behind-nightly-flag
Put aes' armv8 feature behind nightly feature
2021-08-03 10:18:27 -07:00
Ruben De Smet
036661b60c
Add rust stable to tests 2021-08-03 11:31:36 +02:00
Ruben De Smet
1befbb8cb0
Bridge crates default to armv8 feature 2021-08-03 11:16:05 +02:00
Ruben De Smet
69b231a690
Put aes' armv8 feature behind armv8 feature flag 2021-08-03 11:16:05 +02:00
Jordan Rose
778f6f85eb SSv2: when fetching a registration ID fails, mention the recipient
...in the error. This should help apps debug when a session is
archived but they still think a recipient is prepared to receive
sender-key messages. (If they were sending 1:1 messages, they would
have caught this earlier.)
2021-08-02 13:41:19 -07:00
Jordan Rose
71e635558e
Merge pull request #338 from signalapp/jrose/update-to-neon-0.9
Update to Neon 0.9.0
2021-07-26 15:04:53 -07:00
Jordan Rose
ca37067f5a Update to Neon 0.9.0
- Drop our fork of Neon now that our changes have been integrated
- Adopt rename of EventQueue to Channel
- Add a napi-6 feature to signal-neon-futures to make it easier to test
  under the configuration we're actually shipping
2021-07-26 12:37:42 -07:00
Jordan Rose
528aec7e26
Merge pull request #336 from signalapp/cody/bugfix/hex-match-expected-output
Java: Make toStringCondensed match output from other Signal implementations.
2021-07-09 12:46:03 -07:00
Cody Henthorne
b8b6c285ad Java: Make toStringCondensed match output from other Signal implementations. 2021-07-09 15:23:58 -04:00
Jordan Rose
8fc9361647
Merge pull request #335 from whisperfish/prost08
Upgrade prost to 0.8
2021-07-09 10:35:52 -07:00
Ruben De Smet
b25196c256
Upgrade prost to 0.8 2021-07-09 18:54:37 +02:00
Jordan Rose
6021535fb5 Bump version to 0.8.3 2021-07-06 12:57:12 -07:00
Jordan Rose
3f19e0cd58
Merge pull request #332 from signalapp/jrose/now_or_never
Replace block_on and expect_ready with FutureExt::now_or_never
2021-07-06 11:01:28 -07:00
Jordan Rose
e7a0f4d424 Replace block_on and expect_ready with FutureExt::now_or_never
Both futures::executor::block_on and our own expect_ready were being
used to resolve futures that were, in practice, known to be
non-blocking. FutureExt::now_or_never handles that case more lightly
than block_on and more uniformly than expect_ready.

This lets us drop the dependency on the full 'futures' crate down to
just futures_util, which should help with compile time.
2021-07-06 10:30:42 -07:00
Jordan Rose
d923dd38c9
Merge pull request #333 from signalapp/jrose/aes-ctr-32-bit
crypto: Fix a 32-bit overflow in AES-256-CTR
2021-07-02 19:04:16 -07:00
Jordan Rose
499320a4a2 crypto: Fix a 32-bit overflow in AES-256-CTR
Very large initial counter values would overflow the computation of
the initial offset. Use u64 even on 32-bit platforms to avoid this.
2021-07-02 18:23:49 -07:00
Jordan Rose
b00c2e3847
Merge pull request #328 from signalapp/jrose/use-more-RustCrypto
Use more RustCrypto
2021-07-02 14:39:10 -07:00
Jordan Rose
405d9d7b09
Merge pull request #331 from signalapp/jrose/android-aes-gcm-fixes
Fix AES-256-GCM on 32-bit platforms
2021-07-02 14:35:54 -07:00
Jordan Rose
1e55bae7db Java: Remove unused JCE-like interface for AES-256-GCM
Not only is it not sufficient for the streaming decryption used by
Android, but we forgot to mark it 'public'.
2021-07-02 10:29:20 -07:00
Jordan Rose
0e78c785ef Java: expose the tag size for Aes256GcmDecryption
If the tag is stored appended to the data (not unusual) it's the
caller's responsibility to split it off, and they need to know how
much to split.
2021-07-02 10:29:20 -07:00
Jordan Rose
33128d5f45 GitHub: Run Rust tests for a 32-bit platform as well
While Desktop and iOS only support 64-bit platforms, both 32-bit and
64-bit Android are supported.
2021-07-02 10:29:20 -07:00
Jordan Rose
d51920eba2 crypto: Explicitly convert to u64 for the "lengths" in AES-GCM
The algorithm requires eight bytes here, but we were mistakenly only
including four on 32-bit platforms.
2021-07-01 17:54:41 -07:00
Jordan Rose
4519eb4803 FFI: Depend on cpufeatures 0.1.5 to ensure iOS gets optimized crypto 2021-07-01 13:48:05 -07:00
Jordan Rose
4394d742ef crypto: Remove unused dependencies 2021-07-01 13:48:05 -07:00
Jordan Rose
6a73e5051b crypto: Use RustCrypto's GHash as well 2021-07-01 13:48:05 -07:00
Jordan Rose
92a40ce1c3 crypto: Use RustCrypto's AES and AES-CTR implementations
The signal-crypto struct Aes256Ctr32 is still useful because we use a
different nonce size than RustCrypto's "full block", and we provide a
convenience constructor to specify an initial counter value.
2021-07-01 13:48:04 -07:00
Jordan Rose
7905bd7a5a FFI: remove clone capability from AES bridge objects
This was never exposed in Swift, so there's no effective change.
2021-07-01 13:46:20 -07:00
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