Mikolaj Habryn wrote:
> On Sun, 2006-04-09 at 22:08 -0700, Nelson B wrote:
> 
>>These other functions
>>do not, as a rule, require that the user cert have a chain that verifiably
>>was issued by a locally trusted root.  Verifying that the chain leads to
>>a locally trusted root is a function for a relying party, not for a signer.
> 
> The call chain looks something like nsCrypto::SignText ->
> SEC_PKCS7CreateSignedData -> sec_pkcs7_add_signer -> CERT_VerifyCert. Is
> that last call then a bug in all cases? (Presuming of course that
> _add_signer is only called in signing operations)

OK, well there's a pretty major problem right there:
   nsCrypto::SignText -> SEC_PKCS7CreateSignedData

PKCS#7 is another name for "Cryptographic Message Syntax" (CMS) version 1.0.
The current IETF standard version of CMS is version 3.0.  NSS has two
separate implementations of CMS.  One, libpkcs7, is about 10 years old,
implements CMS 1.0, and has function names beginning with SEC_PKCS7.
The other, libsmime, is about 5 years old, with function names starting
with NSS_CMS.

Libpkcs7 is known to have many problems.  In the year 2000, the NSS team
decided to rewrite libpkcs7, rather than attempt to fix all the problems
with libpkcs7.  That is how libsmime came to be written.
(libsmime is misnamed, since it implements only CMS, not full SMIME).
Libpkcs7 is now completely deprecated.  Since the completion of libsmime
in year 2001, applications should be using libsmime, rather than waiting
for libpkcs7 bugs to be fixed.

Sadly, when nsCrypto::SignText was implemented in 2004, the implementor
chose to use the older deprecated SEC_PKCS7 API rather than the newer
NSS_CMS one.  Now, nsCrypto::SignText is demonstrating one of the many
known problems with libPKCS7, one that IMO is likely to remain unfixed,
given the existence of libSMIME. :-(

>>(d) A local "user" cert that is not obviously unsuitable on its face (e.g.
>>not expired, not bearing extended key usage extension that prohibits use
>>for signing, etc.)
> 
> Is there an existing function I should mention in the bug report that
> does all the above as an alternative to VerifyCert?

CERT_FindUserCertsByUsage is one that I had in mind.

-- 
Nelson B
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to