Closed
Bug 221638
Opened 21 years ago
Closed 21 years ago
NSS fails NIST tests for certs with DSA signatures
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
3.9.1
People
(Reporter: nelson, Assigned: nelson)
References
Details
Attachments
(1 file, 2 obsolete files)
1.89 KB,
patch
|
rrelyea
:
review+
|
Details | Diff | Splinter Review |
NSS fails PKITS tests 4, 5, and 6 of section 4.1.
Those tests all use certs with DSA signatures.
All tests report error -8102, inadequate key usage.
Assuming this is not an error in the test setup somehow, this is apparently a
regression.
This bug is against the "libraries" component of NSS, under the assumption
that this is not an error in the test setup.
Assignee | ||
Comment 1•21 years ago
|
||
The test commands are:
Case 4:
vfychain -d d:/tmp/pkits -u 4 \
ValidDSASignaturesTest4EE.crt \
DSACACert.crt \
TrustAnchorRootCertificate.crt
Case 5:
vfychain -d d:/tmp/pkits -u 4 \
ValidDSAParameterInheritanceTest5EE.crt \
DSAParametersInheritedCACert.crt \
DSACACert.crt \
TrustAnchorRootCertificate.crt
Case 6:
vfychain -d d:/tmp/pkits -u 4 \
InvalidDSASignatureTest6EE.crt
DSACACert.crt \
TrustAnchorRootCertificate.crt
These tests all pass, as far as I can tell.
The reason they failed before is that the -u 4 argument was not given.
However, in researching this, I found a related but not causal bug in
NSS, and will attach a patch for it here.
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•21 years ago
|
||
This patch adds dsaKey to the list of key types that require Key Agreement
usage, rather than Key Encipherment usage.
Assignee | ||
Updated•21 years ago
|
Attachment #139173 -
Flags: review?(rrelyea0264)
Assignee | ||
Comment 3•21 years ago
|
||
Add reviewers to CC list.
Priority: -- → P2
Target Milestone: --- → 3.9.1
Assignee | ||
Updated•21 years ago
|
Assignee: wchang0222 → MisterSSL
Status: ASSIGNED → NEW
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Comment 4•21 years ago
|
||
Comment on attachment 139173 [details] [diff] [review]
patch v1
I like the change from if to switch, but I'd like to understand way we are
trying to do a key exchange with a DSA key?
On the other hand the required key Usage shouldn't be KU_KEY_ENCIPHERMENT
either.
It seems that dsaKeys should always fail if KU_KEY_AGREEMENT_OR_ENCIPHERMENT is
specified.
The only exception would be a dual use key (dsa/dh). If we support this
combination, then this patch would be fine.
bob
Attachment #139173 -
Flags: review?(rrelyea0264) → review-
Assignee | ||
Comment 5•21 years ago
|
||
Here's the story.
We're verifying a cert chain from an SSL server for validity for SSL server auth.
The cert contains a DSA public key.
NSS is asking whether the CERT is good for KU_KEY_AGREEMENT_OR_ENCIPHERMENT
(which is what it always checks for SSL server auth), but there is no
agreement-or-encipherment extended key usage. There is key agreement, and
there is key encipherment. NSS decides to check for one or the other of those
extended keys usages in the cert, based on the type of key.
Perhaps the test should be:
If keyType == keyRSA,
then check for encipherment,
else check for agreement.
because AFAIK, the only type of public key with which we do key encipherment
is RSA.
The way that SSL/TLS use a signature only type key (such as DSA) is to sign
a temporal key agreement key, such as a DH key. That key and the signature
on it are sent in the server key exchange. the DSA (or whatever) signature
validates the DH (or whatever) key in the server key exchange, and so it
part of the larger key agreement operation.
Does that change your mind about this patch?
Would you prefer that the patch work as suggested by the above pseudo code?
Assignee | ||
Comment 6•21 years ago
|
||
Comment on attachment 139173 [details] [diff] [review]
patch v1
Bob, please re-review in light of my most recent comments in this bug.
I will also add another attachment with an alternative implementation.
Perhaps you can choose one.
Attachment #139173 -
Flags: review- → review?(rrelyea0264)
Assignee | ||
Comment 7•21 years ago
|
||
This is an alternative to patch v1. I like this one better.
Assignee | ||
Comment 8•21 years ago
|
||
Comment on attachment 139287 [details] [diff] [review]
patch v2 - bigger, more elegant (?)
Bob, please review this patch too, and if possible, choose one of the two
patches to this bug.
Attachment #139287 -
Attachment description: patch v2 - bigger, more elegant (?) patch → patch v2 - bigger, more elegant (?)
Attachment #139287 -
Flags: review?(rrelyea0264)
Comment 9•21 years ago
|
||
Comment on attachment 139287 [details] [diff] [review]
patch v2 - bigger, more elegant (?)
I like this version better. A couple of comments:
1) There is a function called 'CERT_GetCertKeyType' which does essentially the
same thing as CERT_ExtractPublicKeyType, except it doesn't require actually
extracting the whole Public Key, and it takes a PublicKeyInfo rather than a
Certificate.
2) it seems to me that in the case where we signed a key, that we should be
looking for Signature, not KeyAgreement or KeyEncipherment. This patch is
better than the current code, which would just assume keyEncipherment for the
DSA key.
This leaves the following question, though: are either of the following cases
possible (or will the every be possible)?
1) DH algorithm where the DH key is signed by RSA.
2) RSA algorithm where the RSA key is signed by a DSA cert.
If either of these are acceptable, then it seems we SSL needs to determine if
the key is a signature key and check for that extension.
Since this is an SSL question, this patch is acceptable to me as is.
bob
Attachment #139287 -
Flags: review?(rrelyea0264) → review+
Comment 10•21 years ago
|
||
Comment on attachment 139173 [details] [diff] [review]
patch v1
already granted '+' to v2
Attachment #139173 -
Flags: review?(rrelyea0264)
Assignee | ||
Comment 11•21 years ago
|
||
This patch incorporates Bob's feedback, and also the information about
key usage extensions on page 38 of RFC 2246 (TLS 1.0).
Assignee | ||
Updated•21 years ago
|
Attachment #139173 -
Attachment is obsolete: true
Attachment #139287 -
Attachment is obsolete: true
Assignee | ||
Comment 12•21 years ago
|
||
Comment on attachment 139633 [details] [diff] [review]
patch v3
Bob, please review.
Attachment #139633 -
Flags: review?(rrelyea0264)
Comment 13•21 years ago
|
||
Comment on attachment 139633 [details] [diff] [review]
patch v3
r=relyea, yes, this patch looks good.
Attachment #139633 -
Flags: review?(rrelyea0264) → review+
Assignee | ||
Comment 14•21 years ago
|
||
patch v3 checked in.
Thanks for the reviews.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 15•21 years ago
|
||
Marking VERIFIED.
DSA Signatures tests pass. Test 4.1.4, 4.1.5 and 4.1.6 of the NIST PKITS test suite.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•