Fix grpc-master-x86_64 integration test #3346
Conversation
|
🔒 Security Review — View Report Please review before merging. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3346 +/- ##
=======================================
Coverage 78.18% 78.18%
=======================================
Files 693 693
Lines 123959 123985 +26
Branches 17213 17215 +2
=======================================
+ Hits 96912 96934 +22
- Misses 26129 26134 +5
+ Partials 918 917 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
962127e to
b3c7928
Compare
| if (ssl_group_id_to_nid(group_id) == NID_undef) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
BoringSSL's equivalent (check_group_ids) pushes SSL_R_UNSUPPORTED_ELLIPTIC_CURVE when it hits an unknown ID.
Suggest matching upstream:
| if (ssl_group_id_to_nid(group_id) == NID_undef) { | |
| return false; | |
| } | |
| if (ssl_group_id_to_nid(group_id) == NID_undef) { | |
| OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE); | |
| return false; | |
| } |
| static bool ssl_check_group_ids(Array<uint16_t> *out_group_ids, | ||
| Span<const uint16_t> group_ids) { | ||
| for (uint16_t group_id : group_ids) { | ||
| if (ssl_group_id_to_nid(group_id) == NID_undef) { |
There was a problem hiding this comment.
NP: BoringSSL also rejects duplicate group IDs here (check_no_duplicates). Duplicates would just get advertised twice in supported_groups, so probably harmless, but worth a decision.
| case ssl_select_cert_retry: | ||
| return ssl_hs_certificate_selection_pending; |
There was a problem hiding this comment.
The default handles the success path, but I think the retry path has the same problem: if the callback returns ssl_select_cert_retry with stale errors on the queue, SSL_do_handshake returns <= 0 and SSL_get_error checks the error queue before rwstate, so the caller sees a fatal SSL_ERROR_SSL instead of SSL_ERROR_PENDING_CERTIFICATE.
Maybe clear in the retry case too?
case ssl_select_cert_retry:
ERR_clear_error();
return ssl_hs_certificate_selection_pending;| server_ctx.get())); | ||
| } | ||
|
|
||
| TEST(SSLTest, Set1GroupIds) { |
There was a problem hiding this comment.
Couple of small things:
OPENSSL_ARRAY_SIZE(valid_groups)instead of the literal3/1counts.- This never verifies the setting actually takes effect. Cheap addition: restrict the server to one group, handshake, and check
SSL_get_group_id. - Might be worth pinning down
num_group_ids == 0: BoringSSL explicitly resets to the default list, while we store an empty list thattls1_get_grouplisttreats as "use defaults" -- functionally the same, but a test would keep it that way.
Issues:
Resolves P468646736
Description of changes:
gRPC's new certification selection offloading feature (code change) is causing our
grpc-master-x86_64integration test to fail. This PR fixes that.SSL_CTX_set1_group_ids/SSL_set1_group_idswhich AWS-LC lacked. This PR adds and exposes both.Testing
New unit tests added.
grpc-masterpasses