-
Notifications
You must be signed in to change notification settings - Fork 151
Update BoringSSL to a newer version with updated patches #419
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
Conversation
|
Ugh |
|
|
839d1b4 to
20acdd6
Compare
|
The Android, MinGW and MSVC builds are all failing at link-time. Android and MinGW missing symbols from the C++ runtime (which is now mandatory). MSVC is missing |
7407adf to
1707caf
Compare
|
Using |
3d6b352 to
9becf5a
Compare
|
@nox From a quick look the PQ patch looks good to me. Were there merge conflicts or was it a clear rebase? |
Everything changed since last time, as there was no |
|
Silly me, you are talking about PQ, not RPK. Your patches applied cleanly. |
In upstream commit 56d3ad9d23bc130aa9404bfdd1957fe81b3ba498, BoringSSL stopped assuming SSE2 support for i688 platforms, requiring users to explicitly pass -msse2. ``` target/i686-unknown-linux-gnu/debug/build/boring-sys-3edff0f2746d7cbb/out/boringssl/crypto/fipsmodule/../internal.h:120:2: error: #error "x86 assembly requires SSE2. Build with -msse2 (recommended), or disable assembly optimizations with -DOPENSSL_NO_ASM." ```
For starters, they should link against libc++, as they have always intended to use STL "c++_shared". https://github.com/Kitware/CMake/blob/824f2a7a200f9d3e41a2b68be2d5e1cc678afffa/Modules/Platform/Android-Common.cmake#L70-L75 Also, fix the variable names we define, as far as I know cmake never cared about ANDROID_NATIVE_API_LEVEL nor ANDROID_STL.
Those need to link against libstdc++.
RPK support has changed completely, it uses SSL_CREDENTIAL now. Have fun reviewing this!
Instead of keeping around a flag on contexts to know whether we are configured for RPK, we start from SslMethod with a flag to know whether it is configured for X.509 certificates. We then propagate this flag to context builders and contexts, defaulting to false, and introduce `assume_x509` methods to inform the crate of X.509 support for contexts created with other means than our own functions. This improves the safety of the crate as any `SslContextBuilder` configured with `SslMethod::tls_with_buffer` would crash if used with functions involving X.509 certificates. This `SslMethod` is made unsafe because we can't guarantee that we check for X.509 support from all FFI bindingsi (for example, BoringSSL crashes if there is a mismatch in X.509 support in `SSL_set_SSL_CTX`). Note that there is no point anyway in forbidding X.509 functions on a context that supports RPK, as current BoringSSL is able to negociate both raw public keys and X.509 certificates on the same context. Finally, I removed `SslMethod::tls_client` and other peer-specific methods as they are just the same as there non-peer-specific equivalent methods.
The BoringSSL commit this is based on is now 91a66a59b6c1435120ff83e245d7719411294386.
RPK support has drastically changed and is now more flexible, allowing clients to accept both RPKs and X.509 certificates.
While working on it, I noticed that how we disallowed X.509-related functions on RPK contexts was not as optimal nor as safe as it could be, which led to the second commit of this PR.
I'm going away for 8 months of parental leave on Tuesday so I guess I'll not be the person pushing the big green button on this 😁