Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive benchmark suite using google_benchmark under bench/ and refactors several core BIO and ASN1 modules from C to C++, utilizing modern C++ helpers like bssl::UniquePtr and bssl::Span. It also updates build configurations, removes deprecated algorithms like Kyber, and revises documentation to align with C++ style guidelines. Feedback on these changes includes a critical compilation error in crypto/bio/bio.cc where CRYPTO_free_ex_data is missing the this argument, and a recommended cast to SOCKET in crypto/bio/socket_helper.cc to prevent compiler warnings on Windows.
| if (method->destroy != nullptr) { | ||
| method->destroy(this); | ||
| } | ||
| CRYPTO_free_ex_data(&g_ex_data_class, &ex_data); |
There was a problem hiding this comment.
The call to CRYPTO_free_ex_data is missing the second argument (void *obj), which should be this. In BoringSSL, CRYPTO_free_ex_data expects three arguments: const CRYPTO_EX_DATA_CLASS *g_class, void *obj, and CRYPTO_EX_DATA *ad. Passing only two arguments will result in a compilation error in C++.
CRYPTO_free_ex_data(&g_ex_data_class, this, &ex_data);| &except_set, &timeout) == SOCKET_ERROR) { | ||
| return 0; | ||
| } | ||
| if (!FD_ISSET(sock, &write_set) && !FD_ISSET(sock, &except_set)) { |
There was a problem hiding this comment.
9527a8c to
e2413b8
Compare
e2413b8 to
38df963
Compare
cherylEnkidu
left a comment
There was a problem hiding this comment.
Thanks for putting this sync together! Package.swift sources match build.json cleanly and renaming err_data.c → err_data.cc makes sense (and the two gemini-code-assist comments can be ignored — bio.cc is a false positive against the updated 2-arg CRYPTO_free_ex_data, and both are unmodified upstream files).
Before merging, a few things to address:
- Re-enable the
spmCI workflow:.github/workflows/spm.ymlis currentlydisabled_inactivity, so none of the Xcode/SwiftPM build checks ran on this PR. PerREADME.md(#5 & #6), please re-enable it in the Actions tab and trigger a run (and confirm a clean local Xcode build). - Remove re-introduced
*/test/directories & test vectors (~21 MB bloat + 15 Wiz Secret findings): Runningsync-upstream.shre-introduced 215 files (18 MB) acrosscrypto/cipher/test/,ssl/test/(includingssl/test/CMakeLists.txt),crypto/x509/test/,crypto/test/,crypto/rsa/test/,crypto/pkcs7/test/, andcrypto/pkcs8/test/, plus ~2.7 MB of new test vectors (crypto/slhdsa/*.txt,crypto/hpke/*test*vectors*,crypto/fipsmodule/rand/ctrdrbg_df_vectors.txt) andpki/test_helpers.{cc,h}. This nearly doubles the repo size (25 MB → 47.6 MB) and triggers the 15 Wiz Secret Scanner findings on dummy.pemkeys. Could we prunetest/testdatadirectories and these test vector/helper files inscripts/sync-upstream.shand re-run it? - Persist PR #34 cleanups in
scripts/sync-upstream.sh:CMakeLists.txt,cmake/,go.mod, andgo.sumstill exist in upstream427ec40and appear to have been removed manually here — please addcmake/,CMakeLists.txt,go.mod, andgo.sumtocleanup()so future syncs don't re-introduce them. - Redundant line in
scripts/sync-upstream.sh(line 73): Since line 48 now doesrm -rf "$clean_file"before restoringPRESERVE(which includes.github),.github/workflows/branch-time.ymlis already deleted beforecleanup()runs and can be removed from line 73. - Optional — avoid duplicating
err_data.cc:./err_data.ccandgen/crypto/err_data.ccare now byte-for-byte identical. Since it no longer needs to be renamed to.c,Package.swiftcould reference"gen/crypto/err_data.cc"directly and avoid keeping a duplicate copy at the root. - Minor: Could we update the PR description to mention
scripts/generate-err-data.shand whichBoringSSL-GRPC/ gRPC version0.20260929.0aligns with? Also considerswift build --build-testsinsync-upstream.shsoSwiftPMTests/build-testis validated during sync.
- Prune */test/ and */testdata/ directories, test vectors, and pki/test_helpers.{cc,h} in scripts/sync-upstream.sh and remove the 230 re-introduced/unused files (~27.1 MB, incl. 15 dummy .pem keys)
- Persist cmake/, CMakeLists.txt, go.mod, and go.sum removal in cleanup(), preserve .gitignore, and drop redundant .github/workflows/branch-time.yml removal
- Reference gen/crypto/err_data.cc directly in Package.swift, stop copying to ./err_data.cc in scripts/generate-err-data.sh, and remove duplicate root err_data.cc
- Validate test targets via swift build --build-tests in scripts/sync-upstream.sh and remove int main() from SwiftPMTests/build-test/test.cc to avoid duplicate _main under Swift 6.4 swiftbuild
|
@cherylEnkidu All PR comments addressed except re-enable spm CI workflow, as i don't have permission to enable it. |
cherylEnkidu
left a comment
There was a problem hiding this comment.
LGTM! All feedback addressed, repo size & secret-scanner findings cleaned up, and the re-enabled spm CI checks passed across iOS Simulator, macOS, tvOS Simulator, and iOS Device.
Summary
google/boringssl@427ec40cc8edc545253289232e885708c409e5ea(0.20260929.0) which AlignedBoringSSL-GRPC/ gRPC version:BoringSSL-GRPC 0.0.44/gRPC v1.86.0.Package.swiftsourcesto match upstreambuild.jsonand referencedgen/crypto/err_data.ccdirectly (removing the old rooterr_data.cwithout keeping a duplicateerr_data.cccopy at the repo root) so Clang compiles it as C++17, updatedscripts/generate-err-data.shto generategen/crypto/err_data.ccin place (updated logging fromerr_data.c→err_data.ccand removed thecpto the repo root).swift build --build-teststo validateSwiftPMTests/build-testduring sync and removedint main()fromSwiftPMTests/build-test/test.ccto resolve a duplicate_mainlinker error against Swift 6.4swiftbuild's synthesized@maintest entry point (test_entry_point.swift), which still checks for accidental_mainsymbols inopenssl_grpc.sync-upstream.shto discard unused and test files