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

Bump to v4.13.0 from upstream #31

Closed
wants to merge 45 commits into from
Closed

Bump to v4.13.0 from upstream #31

wants to merge 45 commits into from

Conversation

andrew-signal
Copy link

We don't want to get too far behind upstream.

This just pulls v4.13.0 into our main branch and resolves any conflicts with our patches.

The only parts of the merge conflict resolution that took manual effort was:

  1. Ensuring some of the changes did not overwrite our CRL patch
  2. As upstream modified methods like set_flags in verify.rs, I opted to harmonize our implementation/interface with upstream.

I tested via running cargo test locally on both Rust stable and Rust 1.75. I also tested that the libsignal tests pass while building with this new version of the dependency.

rushilmehra and others added 30 commits August 2, 2024 02:14
* chore(boring-sys): Fix git apply patch on Windows

* cargo fmt --all
`ForeignTypeExt` and `ForeignTypeRefExt` are inspired by
sfackler/rust-openssl#1345, which make dealing
with FFI safer and more ergonomic. The new APIs (e.g.
from_const_ptr_opt`) also allow for gracefully handling instances where
the initial API call results in `NULL`. Instead of crashing the program,
`None` will be returned.
Our rustdocs are miserably broken. We manually link to openssl docs in
most binding definitions, and openssl keeps changing their documentation
URL, so in order to fix everything I'd have to touch every single
binding definition in every single file. Instead, we should use the
`corresponds` macro from the openssl-macros crate which nicely adds a
link to the openssl documentation on our behalf. If the openssl
documentation url ever changes again in the future, a simple dependency
bump should solve the issue.
Model callback arguments as structs
set_surves_list is similar to set_curves, but the curves are specified
by a string. This makes it convenient when the supported curves of
the underlying BoringSSL is not known at compile time.

Also fix a bug in checking return value of SSL_set1_curves_list.
bindgen has had a lot of improvements since 0.68, and this newer version seems to able to compile libbssl from within edgeworker
For TLS, early adopters prefer X25519MLKEM768. Remove IPDWing in
preparation for adding X25519MLKEM768.

https://datatracker.ietf.org/doc/draft-kwiatkowski-tls-ecdhe-mlkem/

This reverts commit 4725a93.
This is the successor of X25519Kyber768Draft00.

Spec:

https://datatracker.ietf.org/doc/draft-kwiatkowski-tls-ecdhe-mlkem/02/

IANA has assigned the codepoint.

https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8

Upstream BoringSSL support landed in.

google/boringssl@7fb4d3d

The version of BoringSSL we patch does not include it, so we add it manually.

Chrome and Firefox are planning to enable in October.

This PR is based on the IPD-Wing patch reviewed here:

cloudflare#243

There are two changes. First we simplify the patch a bit as we do not
need IPD-Wing. Secondly, we perform the encapsulation key check, which
was a last minute addition of NIST. We perform this check also for Kyber.
crypto_test_data.cc is not included anymore since 2475ef3
With the bindgen 0.70 upgrade, the default rust target is set to be 1.77,
which becomes the de facto MSRV of boring-sys since the change.

This change makes sure that the MSRV of boring-sys is kept at 1.70,
which is the same as that of bindgen.
Creating Semgrep.yml file - Semgrep is a tool that will be used to scan Cloudflare's public repos for Supply chain, code and secrets. This work is part of Application & Product Security team's initiative to onboard Semgrep onto all of Cloudflare's public repos.

In case of any questions, please reach out to "Hrushikesh Deshpande" on cf internal chat.
This adds a feature to build against a BoringSSL version compatible with
the current boringssl-fips, but _without_ actually enabling the `fips`
feature.

This can be useful to use with `fips-link-precompiled` while using a
custom BoringSSL version based on the older FIPS branch.
BoringSSL doesn't expose these APIs for FIPs builds, so we gate them
here as well
Add a wrapper for `SSL_CTX_set_cert_verify`, which allows consumers to
override the default certificate verification behavior.

The binding resembles `SSL_CTX_set_verify`'s.

See
https://docs.openssl.org/master/man3/SSL_CTX_set_cert_verify_callback/
for more details.
@@ -19,11 +19,12 @@ tag-prefix = ""
publish = false

[workspace.dependencies]
boring-sys = { version = "4.9.0", path = "./boring-sys", default-features = false }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this default-features = false is important-ish while we still have cloudflare#80 in our fork. We could just remove it, though, since we're now using libssl too.

This reverts commit 12d00aa.

We do not use this flag, so revert this commit to get back closer to upstream.
Copy link

@jrose-signal jrose-signal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM, please push directly to main to preserve the merge commit. Thank you for picking this up!

@andrew-signal
Copy link
Author

This has been merged in 1af143f.

1af143f is identical to 739b60c.

andrew@Mac boring % git rev-parse 1af143f50937bce6a9a9c7405ec824a9153c8ba0^{tree}
8aeb2f7f52072f894e3b24a7b7365142ca90cb96
andrew@Mac boring % git rev-parse 739b60c8f6342ee3baf063f5a28fdecaf3d317c1^{tree}
8aeb2f7f52072f894e3b24a7b7365142ca90cb96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.