Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch v0.52.3 #19

Merged
merged 347 commits into from
Jul 26, 2024
Merged

Patch v0.52.3 #19

merged 347 commits into from
Jul 26, 2024

Conversation

tiainen
Copy link
Collaborator

@tiainen tiainen commented Jul 26, 2024

No description provided.

akonradi-signal and others added 30 commits March 25, 2024 15:09
Co-authored-by: moiseev-signal <[email protected]>
This only affects GroupSendEndorsement APIs at this time; everywhere
else List is used, order is significant (or at least must be stable),
or the type is part of an interface or return value.
Add a fake CDSI server with the ability to override handling of inputs and use 
that to test the client's responses to other errors during operation.
Keep up with field renumberings and remove references to removed fields.
Remove some unreachable!() lines by combining two inexhaustive matches into one 
exhaustive match. No behavior change.
Examine the Rust signature to determine what the FFI output type should be. 
This lets us remove all usages of #[bridge_fn_void] since #[bridge_fn] now 
correctly detects the return type.
Use https://github.com/tamasfe/taplo to auto-format TOML files. Add a config 
file to force reordering of dependencies in Cargo.toml files. Run taplo in CI 
to check formatting.
Match against all the error codes the documentation says the server can 
produce. Map these to error types in the app languages.
Bind the `this` value for the deserialization check callbacks when invoking 
them so that the Rust code can access properties on the Native JS module. 
Without this, the Rust code is called with a "global object" as the context, 
which means it fails to construct a LibSignalErrorBase and has to fall back to 
an untyped error message.
Add a test using a local server with a generated self-signed certificate. Also 
miscellaneous improvements that made the test easier to write and debug.
The enclave interactions have internal progress monitoring in the form of 
websocket PING/PONG frames, so the timeout parameters aren't necessary for 
broken connection detection.
- Remove From<http::header::ToStrError> for ChatServiceError
- bridge: Response -> ChatResponse, DebugInfo -> ChatServiceDebugInfo
Co-authored-by: Sergey Skrobotov <[email protected]>
And set up a script to catch them in the future.
getPreKeyId was returning an incorrect value, and the Kyber fields
were missing altogether. None of this affected security of the iOS app
because the iOS app only constructed PreKeyBundles for libsignal to
process, and never read any of these fields. If it did, it would have
failed to establish a session due to the incorrect pre-key ID.

Caught by @dtimoshenko99; thank you!
Use AutoLocal to auto-delete local references that go out of scope. This
prevents us from creating too many local references at a time, which could cause
the JVM to crash.
akonradi-signal and others added 29 commits June 28, 2024 14:55
Explain the difference between libsignal-bridge and libsignal-bridge-types, and
how the pieces fit together.
Remove the special handling code that detects EOF now that the upstream crate 
has fixed the bug that was being worked around. This also fixes a bug where EOF 
was being incorrectly detected when the provided buffer was empty. Add a test 
case to prevent regression in the future.
This parallels the exiting libsignal-jni crate but exports functions from 
libsignal-bridge-testing instead of libsignal-bridge. The crate is compiled as 
a separate shared object that is included in the published libsignal package, 
but which can be excluded at Android packaging time.
We don't save that debug info anywhere yet, but it's a start!
This is following the pattern of build-electron in RingRTC.
The main benefit of this is not our *own* type-checking; it's that
mypy will error out if you try to use a too-new Python API. And in
fact, we were already relying on Python 3.9 and didn't realize.

check_code_size.py works with JSON, so it still uses Any a fair bit.
- For local development, this built the Rust library automatically
  when you invoked `yarn install`, whether you wanted it to or not.

- For the published package, this either did nothing (if the correct
  prebuilds were present) or produced a weird error (if they weren't).
  You can't use the published package without prebuilds, so maybe this
  was useful, but you'd find that out pretty quickly when loading the
  module failed.

- If you used the "link" feature to build Signal Desktop with a local
  checkout of libsignal, this would build the Rust library
  automatically when you `install`ed in the *Desktop* directory,
  whether you wanted it to or not.

- If you pointed Signal Desktop at a local checkout by copy instead of
  link, this would just fail, because the Rust parts wouldn't be
  copied with it.

Overall, it's simpler to just have this step be explicit.
Unlike Java, just bundle it into the exiting signal_node shared library. We 
don't care as much about code size here and splitting it into a separate 
library is significantly more complicated (though it might be worth it some 
day).
This replaces the recipient ID, which is a weak logical reference to external 
data, with one of two types, depending on the mode. For streaming validation, 
only the minimal data is kept. For validation via the CLI or (soon) for 
canonicalization, the full data is kept behind an Arc.
Use a similar strategy as for Node, but with an additional crate that serves as 
the target for running cbindgen. The expectation is that since iOS links with 
the native signal_ffi statically, the linker will be able to prune out the 
unsued test-only code.
This can happen if we get into an error state, or if we have a bug
that has the connection attempt early-exit. We don't want to spin in
place trying to connect.
Notable changes:
- custom colors are now referenced indirectly
- SimpleChatUpdate changes w/ new test cases
(and warn that we might be dropping logs)
@tiainen tiainen merged commit 7f3c505 into main Jul 26, 2024
2 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.