Skip to content

Comments

Correctly handle client certificate custom extensions#16634

Closed
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:cert-request-extensions
Closed

Correctly handle client certificate custom extensions#16634
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:cert-request-extensions

Conversation

@mattcaswell
Copy link
Member

Most extensions are initially sent in the ClientHello and then (optionally) responded to in subsequent messages from the server. However client Certificate messages work differently. In this case the initial extension is added to the server's CertificateRequest message, and the client then may (optionally) respond with the same extension in it's Certificate message.

This was not handled correctly for custom extensions meaning that it was not possible to add custom extensions to a client certificate message.

This should go to 3.0 and 1.1.1. It mostly cherry-picks ok to 1.1.1 but with a trivial conflict in the test. Since its trivial I won't create a separate PR for that branch.

Fixes #16632

Normally we expect a client to send new  extensions in the ClientHello,
which may be echoed back by the server in subsequent messages. However the
server can also send a new extension in the certificate request message to
be echoed back in a certificate message

Fixes openssl#16632
Test the scenario where we add a custom extension to a cetificate
request and expect a response in the client's certificate message.
@mattcaswell mattcaswell added branch: master Applies to master branch approval: review pending This pull request needs review by a committer branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) branch: 3.0 Applies to openssl-3.0 branch labels Sep 20, 2021
@paulidale
Copy link
Contributor

Good for all the branches.

@paulidale paulidale 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 Sep 20, 2021
Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

OK for all branches.

@t8m t8m added the triaged: bug The issue/pr is/fixes a bug label Sep 21, 2021
@openssl-machine openssl-machine removed the approval: done This pull request has the required number of approvals label Sep 22, 2021
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@openssl-machine openssl-machine added the approval: ready to merge The 24 hour grace period has passed, ready to merge label Sep 22, 2021
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Normally we expect a client to send new  extensions in the ClientHello,
which may be echoed back by the server in subsequent messages. However the
server can also send a new extension in the certificate request message to
be echoed back in a certificate message

Fixes #16632

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Test the scenario where we add a custom extension to a cetificate
request and expect a response in the client's certificate message.

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Normally we expect a client to send new  extensions in the ClientHello,
which may be echoed back by the server in subsequent messages. However the
server can also send a new extension in the certificate request message to
be echoed back in a certificate message

Fixes #16632

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)

(cherry picked from commit cbb862f)
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Test the scenario where we add a custom extension to a cetificate
request and expect a response in the client's certificate message.

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)

(cherry picked from commit 0db3a99)
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Normally we expect a client to send new  extensions in the ClientHello,
which may be echoed back by the server in subsequent messages. However the
server can also send a new extension in the certificate request message to
be echoed back in a certificate message

Fixes #16632

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)

(cherry picked from commit cbb862f)
openssl-machine pushed a commit that referenced this pull request Oct 11, 2021
Test the scenario where we add a custom extension to a cetificate
request and expect a response in the client's certificate message.

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #16634)

(cherry picked from commit 0db3a99)
@mattcaswell
Copy link
Member Author

Pushed to master, 3.0 and 1.1.1