Closed
Bug 1334114
Opened 8 years ago
Closed 8 years ago
NSS 3.28 regression in signature scheme flexibility, causes connectivity issue between iOS 8 clients and NSS servers with ECDSA certificates
Categories
(NSS :: Libraries, defect, P1)
Tracking
(firefox52 fixed, firefox53 fixed, firefox54 fixed)
RESOLVED
FIXED
3.29
People
(Reporter: hkario, Assigned: KaiE)
References
Details
(Keywords: regression)
Attachments
(1 file)
|
1002 bytes,
patch
|
mt
:
review-
|
Details | Diff | Splinter Review |
NSS since 3.28.0 will use TLSv1.3-draft interpretation of signature algorithms extension. That means that ECDSA P-256 key can be used only to sign using SHA-256 hash and that ECDSA P-384 key can be used only to sign using SHA-384 hash.
If a client advertises support for just ECDSA+SHA256 and P-256 and P-384 curves, and connects to a server with P-384 certificate installed, the connection will be aborted by the server with NSS 3.28, but will connect fine to a NSS 3.27 server.
In particular iOS 8 clients do advertise P-256 and P-384 curve and ECDSA+SHA256 signature algorithm, but they do not advertise ECDSA+SHA384 or ECDSA+SHA512 signature algorithm.
According to Nick Sullivan (Couldflare), about 3.8% of clients exhibit this kind of behaviour (with a sample of 50k connection attempts).
| Assignee | ||
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 1•8 years ago
|
||
Let me try to put it simpler:
NSS 3.28 is less flexible than it was in the past, which is a regression, and that regression prevents widely deployed clients to connect to NSS servers, if the NSS server upgrades to NSS 3.28
If a server is configured with a P-384 key, only, and a client doesn't offer SHA384 sig alg support, the connection fails with NSS 3.28.
It worked with NSS 3.27
We need a fix that restores the flexibility on NSS trunk for future releases, and a fix that can be backported to NSS 3.28
We need this fix rather quickly, because the March 7 upgrade of Firefox 52 will trigger a wide upgrade to NSS 3.28, and we should avoid the regression for servers that upgrade, too.
Keywords: regression
| Assignee | ||
Updated•8 years ago
|
Severity: normal → blocker
Priority: -- → P1
| Assignee | ||
Updated•8 years ago
|
Summary: NSS 3.28 regression in signature scheme definitions cause connection issues with iOS 8 clients with ECDSA certificates → NSS 3.28 regression in signature scheme flexibility, causes connectivity issue between iOS 8 clients and NSS servers with ECDSA certificates
| Assignee | ||
Comment 2•8 years ago
|
||
Hubert, you said you could help us with creating a test client, that we could to use the potential fix?
| Assignee | ||
Comment 3•8 years ago
|
||
... that we could use to test the potential fix?
| Assignee | ||
Comment 4•8 years ago
|
||
I think I found a way to test it just with NSS code.
I've built NSS 3.28 with TLS 1.3 disabled.
I've started selfserv, using the certificate "server" directory produced by the NSS test suite, and configured selfserv to have an -ec key only.
In ssl3con.c, I changed the array
SSLSignatureScheme defaultSignatureSchemes[]
to contain just one entry:
ssl_sig_ecdsa_secp256r1_sha256
With that change to the code, tstclnt is unable to connect, with error
SSL_ERROR_NO_CYPHER_OVERLAP
| Assignee | ||
Comment 5•8 years ago
|
||
I don't know if this patch is good enough.
But at least in my limited connection test, it seems to work?
| Assignee | ||
Comment 6•8 years ago
|
||
This patch works on NSS trunk (pre-3.29), too.
Does that mean we still have all the code that is required to support this combination, but you simply tried to disable by policy?
| Reporter | ||
Comment 7•8 years ago
|
||
(In reply to Kai Engert (:kaie) from comment #2)
> Hubert, you said you could help us with creating a test client, that we
> could to use the potential fix?
yes, working on it right now
(In reply to Kai Engert (:kaie) from comment #4)
> I think I found a way to test it just with NSS code.
>
> I've built NSS 3.28 with TLS 1.3 disabled.
>
> I've started selfserv, using the certificate "server" directory produced by
> the NSS test suite, and configured selfserv to have an -ec key only.
>
> In ssl3con.c, I changed the array
> SSLSignatureScheme defaultSignatureSchemes[]
> to contain just one entry:
> ssl_sig_ecdsa_secp256r1_sha256
wouldn't use of SSL_SignatureSchemePrefSet() be cleaner?
| Assignee | ||
Comment 8•8 years ago
|
||
(In reply to Hubert Kario from comment #7)
> wouldn't use of SSL_SignatureSchemePrefSet() be cleaner?
I was just hardcoding to be able to test with minimal effort. If we want a real ability to test with a reduced set of schemes, we'll have to write code that dynamically parses a list from the test client command line.
| Reporter | ||
Comment 9•8 years ago
|
||
downstream, I'll depend on tlsfuzzer test case, but I though that a gtest unit test that uses that method could be added upstream...
Comment 10•8 years ago
|
||
Comment on attachment 8830745 [details] [diff] [review]
dont-match-group.patch
Review of attachment 8830745 [details] [diff] [review]:
-----------------------------------------------------------------
Almost right. You should probably ensure that the unit tests continue to work though. I am fairly sure that there are some that will fail with this change.
::: lib/ssl/ssl3con.c
@@ +6378,5 @@
> SSLSignatureScheme preferred = ss->ssl3.signatureSchemes[i];
> PRUint32 policy;
>
> if (!ssl_SignatureSchemeValidForKey(!isTLS13 /* allowSha1 */,
> + PR_FALSE /* matchGroup */,
this needs to be isTLS13
Comment 11•8 years ago
|
||
Comment on attachment 8830745 [details] [diff] [review]
dont-match-group.patch
Review of attachment 8830745 [details] [diff] [review]:
-----------------------------------------------------------------
Please see https://nss-review.dev.mozaws.net/D181
Attachment #8830745 -
Flags: review-
Comment 12•8 years ago
|
||
trunk: https://hg.mozilla.org/projects/nss/rev/c5196cda0d0cc
NSS_3_29_BRANCH: https://hg.mozilla.org/projects/nss/rev/7fd9984bde06ba7a9e5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 13•8 years ago
|
||
Verified as fixed.
Thank you!
Comment 14•8 years ago
|
||
Is this something we'll want to get in Firefox 52 before release too?
Assignee: nobody → kaie
Flags: needinfo?(kaie)
Updated•8 years ago
|
Comment 16•8 years ago
|
||
Let's do that. (Leaving n-i in place so that I can send the necessary requests, make the appropriate tags, etc... when I have more time.)
Comment 17•8 years ago
|
||
I think that having Bug 1337580 will do, as long as it gets approved.
Flags: needinfo?(martin.thomson)
You need to log in
before you can comment on or make changes to this bug.
Description
•