Note: There are a few cases of duplicates in user autocompletion which are being worked on.

detect certs with duplicated issuer name and serial number

RESOLVED FIXED in 3.7

Status

NSS
Libraries
P1
enhancement
RESOLVED FIXED
15 years ago
13 years ago

People

(Reporter: Nelson Bolyard (seldom reads bugmail), Assigned: Ian McGreer)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

When NSS enounters a cert (e.g. via a call to CERT_NewTempCertificate,
and perhaps via other calls as well) that has the same issuer name and 
serial number as a cert already known to NSS (e.g. in a token or the cert DB), 
NSS treats the new cert as a duplicate of the known cert, even if the two
certs are not identical.  The two certs are assumed to be identical because
they contain the same issuer and serial number.  No comparison is made to 
ensure that they actually are fully identical.  

NSS should compare the newly encountered cert with the previously known one.
If they are the same, then NSS should continue to treat the new cert as a 
duplicate of the old one (because it is).  If they are not the same, NSS
should fail to "import" the new cert (or whatever operation it is performing)
and should return an error code that signifies that the new cert has a 
duplicated issuer name and serial number.  

This change may need to be made in many places in NSS, such as when a cert
is added to the cert cache, or to the temporary store of certs, or to the
cert DB inside the soft token.  I do not know all the places where this needs
to be done.  Hopefully Bob and Ian can help enumerate them all.
(Reporter)

Comment 1

15 years ago
In today's meeting, we agreed that this bug should be P1 for NSS 3.7.

The motivation for this bug is to reduce the amount of time spent diagnosing
errors caused by certs with duplicated issuer and serial numbers.  Such 
certs are not issued by competent CAs.  But the complaints about problems 
arising from such certs have recently become onerous.
Priority: -- → P1
Target Milestone: --- → 3.7
(Reporter)

Updated

15 years ago
Severity: normal → enhancement
(Reporter)

Updated

15 years ago
Blocks: 169696

Comment 2

15 years ago
Assigned the bug to Ian.
Assignee: wtc → ian.mcgreer
(Assignee)

Comment 3

15 years ago
Created attachment 106971 [details] [diff] [review]
block import of different certs with same issuer/sn as existing certs


Both certutil and pk12util went through CERT_NewTempCertificate, and the error
was caught there.  I changed a line in libpkcs12 to pick up the correct error
code.  I imagine most cases will be handled this way, as the only other way to
create a cert from a DER is to use the deprecated __CERT_DecodeDERCertificate.

Just to be safe, I changed certutil to call DecodeDER and then PK11_Import, the
error was caught in that code path in the same way.
(Reporter)

Comment 4

15 years ago
Thanks for the patch, Ian.  One comment:

Let's not call this new error SEC_ERROR_CERT_ALREADY_EXISTS.  
That's going to cause misunderstanding.  
Let's call it SEC_ERROR_DUPLICATE_ISSUER_AND_SERIAL or
SEC_ERROR_REUSED_ISSUER_AND_SERIAL or something similar.
(Assignee)

Comment 5

15 years ago
Created attachment 107023 [details] [diff] [review]
rename error code
Attachment #106971 - Attachment is obsolete: true
(Assignee)

Comment 6

15 years ago
I checked the second patch in to the tip.
(Reporter)

Comment 7

15 years ago
Ian,  
Above, your wrote that you've checked the patch into the trunk.
Is this bug fixed now?  

Comment 8

15 years ago
*** Bug 99422 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 9

15 years ago
Yes, it is.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED

Comment 10

15 years ago
Ok. Scenerio for you.

Our IMAP mailserver uses the same SSL Cert for both SMTP and IMAP (it's the same
box, same CN). Since 1.3a, we've been unable to use SMTP TLS if we've connected
to IMAP via TLS.

Did this patch potentially cause this issue?

Comment 11

14 years ago
*** Bug 39495 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.