detect certs with duplicated issuer name and serial number



17 years ago
15 years ago


(Reporter: nelson, Assigned: bugz)


Firefox Tracking Flags

(Not tracked)



(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.
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


17 years ago
Severity: normal → enhancement


17 years ago
Blocks: 169696

Comment 2

16 years ago
Assigned the bug to Ian.
Assignee: wtc → ian.mcgreer

Comment 3

16 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.
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.  

Comment 5

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

Comment 6

16 years ago
I checked the second patch in to the tip.
Above, your wrote that you've checked the patch into the trunk.
Is this bug fixed now?  

Comment 8

16 years ago
*** Bug 99422 has been marked as a duplicate of this bug. ***

Comment 9

16 years ago
Yes, it is.
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 10

16 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

15 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.