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
Protobuf handling #51
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dr7ana
force-pushed
the
protobuf
branch
3 times, most recently
from
September 7, 2023 17:55
f2a9cfa
to
a81eabc
Compare
jagerman
force-pushed
the
protobuf
branch
3 times, most recently
from
September 7, 2023 21:11
33f6d9e
to
083f501
Compare
dr7ana
force-pushed
the
protobuf
branch
2 times, most recently
from
September 11, 2023 16:22
237ca7e
to
8065932
Compare
dr7ana
force-pushed
the
protobuf
branch
4 times, most recently
from
September 20, 2023 16:13
e95f3f8
to
43c66cb
Compare
|
Now squashed and rebased on top of #59 (which will most likely be merged before this PR). |
jagerman
force-pushed
the
protobuf
branch
4 times, most recently
from
October 3, 2023 23:40
72ee4eb
to
1a46b1d
Compare
We use wine to test the windows CI builds
It's stupidly difficult to avoid false positives (and protobuf triggers it).
This adds support for automatic wrapping and unwrapping of config messages that may be wrapped in protobuf; this was unintentional, but is out in the wild in current Session releases. The long-term plan is to stop doing this eventually, but supporting it here allows us to change from the current mode (always wrap/unwrap affected message types) to a mode where we only unwrap, and then finally we can drop unwrapping as well. For now: we wrap/unwrap the existing released message types (user profile, conversation info, and so on) but not the new groups configs (which should always be un-wrapped). Various notes: - protobuf added as external dependency. - protobuf 21.12 is used, which is an older release, but is what is still being used by lots of projects and Linux distributions because Google applied huge amounts of extra bloat in v22 (including pulling a massive pile of crap in abseil), broke the build system in various ways, and made everything suck to the point that many Linux distributions have just stuck with the latest 21.12 because of all the broken crap Google imposed on everyone in v22 and newer. - SessionProtos.pro and WebSocketResources.proto looped in from session-ios codebase, with one minor change to let us use it in "lite" mode (which is still very bloated, but nothing like non-lite mode). - Added pregenerated header/cpp files; we experimented with building them as part of the build, but that ended up neigh impossible for our various cross-compiled builds. (These also get excluded from format.sh because they break if formatted. Hurray.) - Add protobuf::libprotobuf-lite to the static build list. - Adds a dummy test script that does nothing, but tests that we can probably link against the combined archive (when building with `-DSTATIC_BUILD=ON`).
- Removed an unneeded `ustring` argument overload which just calls the `ustring_view` alternative (which already is fine when given a ustring). - Don't eat exceptions from protobuf production. If this throws on *producing* a protobuf then it is indicative of some application bug (unlike input, where we legitimately might not have a protobuf at all). - Switch to protobuf's ParseFromArray to avoid string construction. - Small code simplifications
Part of protobuf handling apparently also requires session protocol decryption, so this adds that to libsession.
Adds protobuf parsing as Session does it.
This adds a deterministic version of session protocol encryption that differs from crypto_box_seal by using a keyed hash of the sender seed, recipient pubkey, and message to generate the ephemeral key. This effectively neuters such an encrypted message to be a regular crypto_box encryption, which means the sender is later able to decrypt it; this is thus only really a special case for protobuf+encrypted config messages for backwards compatible config message support.
The only thing in this header are config-specific, so seems better under `config`. This also resolves some issues with circular library dependencies in the build between config, crypto, and protos.
jagerman
force-pushed
the
protobuf
branch
4 times, most recently
from
October 4, 2023 19:20
c3753db
to
d8d22ce
Compare
Also moves the `protos` build into /protos rather than building it via `../` inside src.
The dependencies are causing headaches right now on iOS, and currently session clients don't need this code so can disable it.
Session clients required the list of hashes from a merge() to perform various operations based on the messages that were accepted. This updates `merge()` to return a vector of accepted hashes. For the C API, this returns a config_string_list* pointer that needs to be freed, but contains all the good hashes (the same way current_hashes() works).
It was only matching 13 but not 13.0, which was making gmp putting in assembly instructions that ios doesn't support (because gmp only turns that off if it sees "darwin" in the host string).
Without this we were running `make -j` on macos which is a minor fork bomb. Also adds a workaround in case that doesn't work either to fall back to just -j1.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.