Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upConnection error when using EC client certificate with explicit parameters and TLS1.2 #7045
Comments
This comment has been minimized.
This comment has been minimized.
|
Explicit parameters are forbidden by RFC 5480, section 2.1.1.
I know of no implementation other than OpenSSL that parses the non-compliant specifiedCurve form in public keys. Although, OpenSSL does parse it, so I'm guessing instead it's tripping the logic to enforce the curve is one of the advertised ones. There, RFC 8422 does not include a provision for the client to advertise support for non-named curves so it's understandable that OpenSSL would reject them. The older RFC 4492 does have an arbitrary_explicit_prime_curves advertisement, but I don't believe OpenSSL ever supported those. Probably (though I don't know for sure off-hand) OpenSSL 1.0.x was missing a check that 1.1.x added. All this explicit curve business was done when ECC was much younger and we were less sure how it would be used. Now we know better and the analogous problems with DHE negotiation in TLS demonstrate that arbitrary parameters were a clear mistake. (They are difficult to advertise and difficult to make performant.) Use the named encoding. |
This comment has been minimized.
This comment has been minimized.
|
Right - as @davidben says this isn't allowed by the RFCs. There was some half-hearted, broken, explicit curve support that exists in 1.0.2 but was removed by commit 2235b7f. That change brings OpenSSL in line with the standards and was an explicit decision. That I suppose is a breaking change, but 1.0 -> 1.1 is breaking anyway. So, the up shot is - this won't be fixed. |
This comment has been minimized.
This comment has been minimized.
|
Perhaps an FAQ entry would make sense for this? Most of the body of the FAQ is in these comments. |
This comment has been minimized.
This comment has been minimized.
Maybe...but as far as I can recall this is the first question on this in the two years since the commit was made. The dodgy 1.0.2 explicit parameter support only ever applied to client certs anyway - it was unimplemented for server certs. Probably doesn't qualify as "frequent", for an FAQ! |
This comment has been minimized.
This comment has been minimized.
|
Ok, but in that case the "openssl ec -param_enc" option should be removed as well so you can't even generate such invalid keys/certificates. Also, it does work, as long as you're only using TLS1.1 or lower. If you say that it shouldn't work, perhaps support should be ripped out entirely? That would make it more obvious. It's kind annoying because we have several hundred certificates like this because prior to 1.1 "explicit parameters" was the default for EC certificate generation. |
This comment has been minimized.
This comment has been minimized.
Well, the situation is a bit more murky at the ecparam level. That app supports X9.62 parameters - where explicit parameters are allowed. The IETF based standards are built on top of X9.62 but specify that you can't use the explicit parameters bit. So while the app allows you to create them, you're not supposed to use them in any standard related to IETF (i.e. RFCs). That doesn't preclude their use in other settings. I don't know if there are any such settings that people are using openssl for.
It doesn't work because of the TLSv1.2 signature algorithm checking which doesn't exist in TLSv1.1. and below. We could disable it in those protocols as well but, since it would be a breaking change, we can't do it until we move to OpenSSL 1.2.0 which is unscheduled at the moment. It's also probably a non-trivial change. Removing it from TLSv1.2 made sense because that was a simplifying change. I'm not sure how much enthusiasm there would be for adding some extra complexity into TLSv1.1 and below just for this. |
This comment has been minimized.
This comment has been minimized.
|
To the 1.1. vs 1.2 business, supported_{curves,groups} exists prior to TLS 1.2 as well. If I've configured OpenSSL to only accept such-and-such curves (because, say, I consider the others to be insecure), I would probably want them to be rejected consistently at both versions. |
This comment has been minimized.
This comment has been minimized.
|
I wouldn't put too much stock in that it wasn't reported earlier. It's a difficult problem to track down, because the server produces no error message (fixed in 1.1.1) and the client merely says "TLS alert: decode error". The problem mysteriously vanishes when the key/certificates are recreated. There are enough vague TLS failure reports that it's possible people didn't realise this was the problem. In any case, now it's clear it's not going to be fixed we are working on fixing all the key/certificates in the field. The attached script does the conversion, I hope it is useful for other people.
|
This comment has been minimized.
This comment has been minimized.
|
I tried to generate a key with the SECP256K1 curve but for me it fails whatever I do. I just can't use it and it says "wrong curve". Is that curve really supported for TLS 1.2? |
This comment has been minimized.
This comment has been minimized.
|
Please don't use a closed issue to start a new thread. |
This is a regression, this worked fine in the OpenSSL 1.0 series, but appears broken in all OpenSSL 1.1 (including the current master).
Steps to reproduce:
Switching to TLS1.1 or 1.0 works just fine. Using named curve settings also makes it work.
When testing with master an extra error message is dropped:
This is the key it generated that fails: