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

Ensure that the key share group is allowed for our protocol version #19317

Closed
wants to merge 3 commits into from

Conversation

mattcaswell
Copy link
Member

@mattcaswell mattcaswell commented Sep 30, 2022

We should never send or accept a key share group that is not in the
supported groups list or a group that isn't suitable for use in TLSv1.3.

Currently if we put a TLSv1.2 group at the top of the groups list, but we only request TLSv1.3, then the supported groups list will only include TLSv1.3 groups, but the key_share will use a TLSv1.2 group. This results in the server failing with an invalid parameter alert.

server:

openssl s_server  -tls1_3

client:

openssl s_client -tls1_3 -groups prime192v1:P-256 -cipher DEFAULT:@SECLEVEL=1

This PR is based on #19315 and includes those commits - hence this PR is draft. I will take it out of draft once #19315 has been merged.

@mattcaswell mattcaswell added branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch labels Sep 30, 2022
@mattcaswell mattcaswell marked this pull request as draft September 30, 2022 16:15
@github-actions github-actions bot added the severity: fips change The pull request changes FIPS provider sources label Sep 30, 2022
@tomato42
Copy link
Contributor

tomato42 commented Oct 4, 2022

fixes #8369?

@mattcaswell
Copy link
Member Author

fixes #8369?

Yes - although that issue says "When openssl client is configured to support only one of the curves that is forbidden in TLS 1.3, it does send that curve in supported_groups extensions and it does also put appropriate key share into the key_share extension.". However the behaviour in master/3.0 at the moment is that we do not send the curve in supported_groups, but we do still send a key_share for it! This is obviously illegal.

So, it looks to me like we already fixed the issue about sending illegal supported groups, but didn't fix they key_share aspect at the same time. This PR addresses the key_share problem.

We should never send or accept a key share group that is not in the
supported groups list or a group that isn't suitable for use in TLSv1.3
This should not happen but we should tolerate and send an HRR
Make sure that a TLSv1.3 only client does not send a TLSv1.3 key_share.
@mattcaswell mattcaswell marked this pull request as ready for review October 7, 2022 11:33
@mattcaswell
Copy link
Member Author

I have rebased this PR now that #19315 has been merged. I also fixed a typo in the test which caused it to not operate correctly and pass on an unpatched version of OpenSSL!

I have taken this out of "draft" state and it is ready for review.

@mattcaswell mattcaswell added approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member labels Oct 7, 2022
@github-actions github-actions bot removed the severity: fips change The pull request changes FIPS provider sources label Oct 7, 2022
@t8m t8m added the triaged: bug The issue/pr is/fixes a bug label Oct 7, 2022
@openssl openssl deleted a comment Oct 8, 2022
@paulidale paulidale removed the approval: otc review pending This pull request needs review by an OTC member label Oct 10, 2022
@mattcaswell
Copy link
Member Author

Ping for second review?

Copy link
Member

@beldmit beldmit left a comment

Choose a reason for hiding this comment

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

LGTM

@beldmit beldmit added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Oct 10, 2022
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Oct 11, 2022
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Oct 12, 2022
We should never send or accept a key share group that is not in the
supported groups list or a group that isn't suitable for use in TLSv1.3

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from #19317)
openssl-machine pushed a commit that referenced this pull request Oct 12, 2022
This should not happen but we should tolerate and send an HRR

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from #19317)
openssl-machine pushed a commit that referenced this pull request Oct 12, 2022
Make sure that a TLSv1.3 only client does not send a TLSv1.3 key_share.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from #19317)
@mattcaswell
Copy link
Member Author

Pushed. Thanks. There was a conflict while cherry-picking to 3.0, so I raised a backport PR in #19404.

beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
We should never send or accept a key share group that is not in the
supported groups list or a group that isn't suitable for use in TLSv1.3

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from openssl#19317)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
This should not happen but we should tolerate and send an HRR

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from openssl#19317)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
Make sure that a TLSv1.3 only client does not send a TLSv1.3 key_share.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from openssl#19317)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants