Skip to content

impl(rest): use SSL_get_all_group_names() with BoringSSL - #16566

Merged
colinmoy merged 2 commits into
googleapis:mainfrom
colinmoy:fix-boringssl-ec-curves
Oct 15, 2026
Merged

colinmoy merged 2 commits into
googleapis:mainfrom
colinmoy:fix-boringssl-ec-curves

Conversation

@colinmoy

Copy link
Copy Markdown
Collaborator

Simplifies how AvailableCryptoGroups() queries supported TLS key-exchange groups when built with BoringSSL:

  • Uses BoringSSL's SSL_get_all_group_names() function to get the list of supported TLS groups directly, replacing the previous workaround that combined EC_get_builtin_curves() with trial-and-error calls to SSL_CTX_set1_curves_list().
  • Checks #if defined(SSL_GROUP_SECP256R1) to verify that the installed BoringSSL version is new enough to have SSL_get_all_group_names() (both were added in the same BoringSSL commit).
  • For older BoringSSL versions that don't have SSL_get_all_group_names(), returns an empty list so BoringSSL keeps its default TLS groups (those older versions predate X25519MLKEM768 support anyway).

Use BoringSSL's SSL_get_all_group_names() API directly to query supported TLS groups instead of probing candidate curves via SSL_CTX_set1_curves_list() and filtering EC_get_builtin_curves().

SSL_get_all_group_names() was added in the same BoringSSL commit (335523a2c456) as the SSL_GROUP_* macros, so we guard on defined(SSL_GROUP_SECP256R1). Older versions of BoringSSL predate X25519MLKEM768 support and return an empty list so default groups remain unchanged.
@colinmoy
colinmoy requested a review from a team as a code owner October 14, 2026 19:53

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the AvailableCryptoGroups function in ssl_ec_curves.cc to use SSL_get_all_group_names for newer BoringSSL versions, replacing the previous approach of probing candidate curves with a temporary SSL_CTX. It also simplifies preprocessor checks and removes the unused <array> header. The feedback suggests caching the retrieved crypto groups in static variables to avoid repeated heap allocations and library queries on every function call.

Comment thread google/cloud/internal/openssl/ssl_ec_curves.cc
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.39%. Comparing base (7af76ee) to head (e987590).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16566      +/-   ##
==========================================
+ Coverage   92.37%   92.39%   +0.01%     
==========================================
  Files        2265     2265              
  Lines      219470   219457      -13     
==========================================
+ Hits       202745   202770      +25     
+ Misses      16725    16687      -38     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@colinmoy
colinmoy merged commit e4357e4 into googleapis:main Oct 15, 2026
71 checks passed
@colinmoy
colinmoy deleted the fix-boringssl-ec-curves branch October 15, 2026 17:55

This branch was successfully deployed

1 active deployment
false — e9875907 Deployed Oct 14, 2026 by colinmoy via Save PR ref #12449
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.

2 participants