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

Upstream merge 2024 11 18 #2012

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

skmcgrail
Copy link
Member

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@skmcgrail skmcgrail requested review from nebeid and justsmth November 25, 2024 23:00
@skmcgrail skmcgrail requested a review from a team as a code owner November 25, 2024 23:00
@skmcgrail skmcgrail marked this pull request as draft November 26, 2024 17:13
@skmcgrail skmcgrail force-pushed the upstream-merge-2024-11-18 branch from fb3c49c to 600b961 Compare November 26, 2024 17:31
@skmcgrail skmcgrail marked this pull request as ready for review November 26, 2024 17:33
ssl/handshake_client.cc Show resolved Hide resolved
ssl/internal.h Show resolved Hide resolved
@skmcgrail skmcgrail force-pushed the upstream-merge-2024-11-18 branch from 600b961 to 4fdca57 Compare December 3, 2024 19:11
@skmcgrail skmcgrail requested a review from nebeid December 3, 2024 19:12
@skmcgrail skmcgrail force-pushed the upstream-merge-2024-11-18 branch from 4fdca57 to 0fff81b Compare December 3, 2024 20:44
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.

Project coverage is 78.67%. Comparing base (905e9d0) to head (899bd22).

Files with missing lines Patch % Lines
ssl/handshake_client.cc 84.21% 3 Missing ⚠️
ssl/ssl_lib.cc 83.33% 1 Missing ⚠️
ssl/test/test_config.cc 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2012      +/-   ##
==========================================
+ Coverage   78.65%   78.67%   +0.02%     
==========================================
  Files         598      598              
  Lines      103329   103347      +18     
  Branches    14688    14692       +4     
==========================================
+ Hits        81272    81312      +40     
+ Misses      21404    21383      -21     
+ Partials      653      652       -1     

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

justsmth
justsmth previously approved these changes Dec 4, 2024
include/openssl/bytestring.h Outdated Show resolved Hide resolved
nebeid
nebeid previously approved these changes Dec 4, 2024
Copy link
Contributor

@nebeid nebeid left a comment

Choose a reason for hiding this comment

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

I added some nit comments.

ssl/handshake_client.cc Outdated Show resolved Hide resolved
ssl/internal.h Outdated Show resolved Hide resolved
@nebeid nebeid self-requested a review December 4, 2024 14:31
TLS <= 1.2 servers indicate supported client certificate key types with
a certificate_types field in the CertificateRequest. Historically, we've
just ignored this field, because we've always outsourced certificate
selection to the caller anyway. This meant that, if you configured an
RSA client certificate in response to a server that requested only ECDSA
certificates, we would happily send the certificate and leave it to the
server to decide if it was happy.

Strictly speaking, this was in violation of RFC 5246:

   -  The end-entity certificate provided by the client MUST contain a
      key that is compatible with certificate_types. [...]

Although prior TLS versions didn't say anything useful about this either
way.

Once we move certificate selection into the library, we'll want to start
evaluating supported algorithms ourselves. A natural implementation of
it will, as a side effect, cause us to enforce this match, even when
only a single certificate is configured. Since this is unlikely to have
any real compatibility impact (every TLS server I've seen just hardcodes
this list), let's just try turning it on. On the off chance it does
break someone, I've left a flag, SSL_set_check_client_certificate_type,
for folks to turn this check off. The flag will most likely be
unnecessary, in which case we can retire it after a few months.

If this does cause a problem, we can opt to turn it off for the default
certificate, or only enable it when multiple certificates are
configured, or lean on the sigalgs list (doesn't work for 1.0/1.1), but
these all result in some slightly suboptimal behavior, so I think we
should treat them as contingency plans.

Update-Note: A TLS 1.2 (or below) client, using client certificates,
connecting to a TLS server which doesn't support its certificate type
will now fail the connection slightly earlier, rather than sending the
certificate and waiting for the server to reject it. The connection
should fail either way, but now it will fail earlier with
SSL_R_UNKNOWN_CERTIFICATE_TYPE. If the server was buggy and did not
correctly advertise its own capabilities (very very unlikely), this may
cause a connection to fail despite previously succeeding. We have
included a temporary API, SSL_set_check_client_certificate_type, to
disable this behavior in the unlikely event this has any impact, but
please contact the BoringSSL team if you need it, as it will interfere
with improvements down the line.

This change does not affect servers requesting client certificates, only
clients sending them.

Bug: 249
Change-Id: I159bc444c4ee79fbe5c476d4253b48d58d2538be
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66687
Commit-Queue: David Benjamin <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
(cherry picked from commit 60c2867092af66bbe369f00d8214b6d06fcb376a)
This is a remnant of when we tried to correlate AEAD selection with
post-quantum curves. Also remove a redundant call to
tls1_get_shared_group. We already saved the result in hs->new_session,
so there's no need to compute it again.

Change-Id: I2425ad40bf664f4d248e1dcf610f574a6cad68bc
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66689
Commit-Queue: David Benjamin <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
(cherry picked from commit 860db9e98f23c6e2692afb143a04987cc232e1f5)
@skmcgrail skmcgrail dismissed stale reviews from nebeid and justsmth via 899bd22 December 4, 2024 18:15
@skmcgrail skmcgrail force-pushed the upstream-merge-2024-11-18 branch from 0fff81b to 899bd22 Compare December 4, 2024 18:15
@skmcgrail skmcgrail merged commit f6d3673 into aws:main Dec 4, 2024
117 of 119 checks passed
@skmcgrail skmcgrail deleted the upstream-merge-2024-11-18 branch December 4, 2024 21:01
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.

5 participants