Repository navigation
Enable brainpool curves for TLS1.3 - #11782
bernd-edlinger wants to merge 1 commit into
Conversation
|
try it out this way: |
|
Talking to myself: the latest fixup was necessary, becaus the following setup failed to connect: this involves a Hello Retry Request (whatever that is good for) |
Really??? That's horrible. Any idea what the reasoning behind that decision was? Do you have a reference to the relevant standard? |
mattcaswell
left a comment
There was a problem hiding this comment.
Some comments below.
I'm not convinced this is the way to go. All of this swapping around between the TLSv1.3 and TLSv1.2 ids is horrible. Why do we not just treat them as entirely different curve ids which you can get and set independently of each other? That would seem a lot simpler to me.
There was a problem hiding this comment.
Nit: spurious space after function name
There was a problem hiding this comment.
Can we move this function call to before the "for" loop - so we don't have to call it every time? The ver_min and ver max values won't change.
There was a problem hiding this comment.
The function is only rarely needed, I was kind of trying not to add overhead to
the normal case, which is no brainpool curves. These are only meant as
a fallback for people who do not trust in the NIST curves, and might like
to have a different fallback instead. So I think that is at most called 3 times,
once for each brainpool curve NID.
But I can do that if it is considered too ugly.
There was a problem hiding this comment.
Additionally it is an error path that is not needed when no brainpool
curve is to be enabled.
There was a problem hiding this comment.
I would rather have the SSLfatal call replicated on each location an error occurs. This means we actually will know the exact line that the error occurred on - rather than "somewhere in this function".
There was a problem hiding this comment.
Okay. Good point.
There was a problem hiding this comment.
It looks like we should introduce some new tests for brainpool in TLSv1.3
There was a problem hiding this comment.
I can add a second test here, but it does not seem to do the full handshake,
for tls1.2 yes, but tls1.3 does not have the server certificate ready when the
test expects to see it, the certificate is only there after the new session ticket arrives.
There was a problem hiding this comment.
I don't understand what is meant by "tls1.3 does not have the server certificate ready when the test expects to see it, the certificate is only there after the new session ticket arrives" -- in TLS 1.3, the NewSessionTicket message is not sent until after the server Finished, which is after the Certificate is sent (though can be in the same flight).
There was a problem hiding this comment.
Just a vague idea. Since it is impossible for me to debug into this test case,
I tried to print the server certificate in s_client and the certificate was NULL
at the point where tls1.2 had it available, but very short after that there
is a new session callback and the certificate is available there.
It is funny that s_client does not seem to show the server certificate, since
I think I remember that was once the case.
There was a problem hiding this comment.
@kaduk I think everything woks as expected, I was just confused since this did not work:
test => {
+ "ExpectedClientCertType" => "brainpoolP256r1",
+ "ExpectedClientSignHash" => "SHA256",
+ "ExpectedClientSignType" => "EC",
"ExpectedResult" => "Success"
I thought that would test the cert received by the client.
but instead it tests the client cert received by the server.
but since there is no client brainpool cert available that did not work.
No idea what I did wrong with the s_client test I cannot reproduce
what I saw there.
There was a problem hiding this comment.
Ah, thanks for clarifying.
I trust you found the ExpectedserverCertType and related directives that would apply for the server's certificate.
|
|
I am sorry for mistakenly closing the PR. I mis-clicked the button. I just wonder if treating them as completely separate curves for TLS-1.3 and 1.2 would not be too confusing to users as usually would want to enable both. I do not even see a reason why you would want to enable it just for one of the protocol versions. |
I actually think the opposite is true. I think there will be more confusion by trying to hide the fact that there are actually 2 different group ids. If people use OpenSSL in conjunction with other software (wireshark, other clients/servers etc) these two different groups will become very visible. Where did that extra group from? Why don't I see group x when I "get" the list of groups - but I can see it on the wire? What happens when the peer sends one of the groups but not the other - this will get very confusing when you "get" the group list and the required group is there - but for some reason it isn't being used in your protocol version. By trying to hide all of this I think we are just storing up problems for ourselves. Much better IMO is to just be up front and explain that there are 2 groups for the different protocol versions and get people to set both if they want both. |
Yes, as mentioned in the commit message: See the recently assigned brainpool code points at: Table TLS Supported Groups contains these 26 | brainpoolP256r1 | Y | N | [RFC7027] |
27 | brainpoolP384r1 | Y | N | [RFC7027] |
28 | brainpoolP512r1 | Y | N | [RFC7027] |
29 | x25519 | Y | Y | [RFC8446][RFC8422] |
30 | x448 | Y | Y | [RFC8446][RFC8422] |
31 | brainpoolP256r1tls13 | Y | N | [RFC8734] |
32 | brainpoolP384r1tls13 | Y | N | [RFC8734] |
33 | brainpoolP512r1tls13 | Y | N | [RFC8734]But adding another NID for brainpool did not seem like a really compelling option |
This is a side effect of how RFC 8446 was done. There was a desire to provide a small "clean slate" of known-good parameters for TLS 1.3 use (across cipher suites, signature schemes, groups, everything) and as part of the cleanup for how that was expressed in the document, the old brainpool group IDs got marked as "obsolete_RESERVED" for TLS 1.3 usage -- see Appendix B.3.1.4 in RFC 8446. It was pointed out somewhat later that this designation burns the TLS 1.2 codepoints from being resuable for TLS 1.3, but to some extent that is necessary. |
|
Thanks @kaduk - that's useful background. The more I think about it the more I tend to think that we should keep very clear separation between the 2 codepoints within OpenSSL as well. I'm actually doing some work at the moment to refactor how the group code works anyway - so I'd suggest not spending too much time on this feature at this stage until the dust has settled with that refactoring. The way to add new groups is likely to look very different after I have finished. Something I hadn't appreciated when I reviewed this PR is that it is targeting 1.1.1 and is a backport of #7485. I guess my comments should have been made against the master version of this. I don't this PR is going to be acceptable against 1.1.1 because it is a new feature. |
649d8f9 to
d354c90
Compare
|
What is the current status of this change request? |
It's still targeting 1.1.1, and still unlikely to get OTC approval. |
|
This PR is waiting for the creator to make requested changes but it has not been updated for 105 days. If you have made changes or commented to the reviewer please make sure you re-request a review (see icon in the 'reviewers' section). |
|
This PR has been closed. It was waiting for the creator to make requested changes but it has not been updated for 120 days. |
|
#7485 was re-based to current master, so re-opening this PR |
See the recently assigned brainpool code points at: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
d354c90 to
fd768e5
Compare
|
This PR is waiting for the creator to make requested changes but it has not been updated for 30 days. If you have made changes or commented to the reviewer please make sure you re-request a review (see icon in the 'reviewers' section). |
|
This PR is waiting for the creator to make requested changes but it has not been updated for 61 days. If you have made changes or commented to the reviewer please make sure you re-request a review (see icon in the 'reviewers' section). |
|
This PR has been closed. It was waiting for the creator to make requested changes but it has not been updated for 90 days. |
This adds (optional) support for brainpool curves in TLS1.3
Checklist
back-port of #7485 for 1.1.1