Christopher Ritter wrote on Mon, 10 May 04, 6:05 AM:
> 
> We have problems on the signing side: 
> 
> - Our cards support a signing operation with a private key. 
> 
> - Mozilla can�t verify the signed mails and says that the signature is 
> invalid. 
> 
> - We have a logging mechanism which shows us the pkcs#11 operations and 
> its parameters. 
> 
> - Mozilla calls  C_FindObjectsInit-method just asking for a CKA_VALUE, 
> this value seems not to match with one of our Objects. Do You know which 
> object could be requested by mozilla? 

Off the top of my head, the only thing we are likely to ask for by value is the 
certificate. NSS is trying to match a private key to the certificate it found. What is 
the Value being asked (is it between 500-1000 bytes or is it 20 bytes or something 
very round like 128 bytes?).

> - If we give (in the above case) mozilla the signing certificate, 
> signing seems to work, but the signature can not be verified. 
> 
> - We used an ASN.1 converter to observe the signed mail. It seems that 
> the messageDigest in that file is different from the one we get in the 
> C_Sign-method. 

Are you doing the PKCS #1 formatting? NSS will pass an ASN.1 encoded messageDigest 
package. This package must be wrapped in an PKCS #1 signature value.

> 
> - Mozilla asks for the modulus of the private key, we give it the 
> modulus of the public key, which should be the same. Can You tell us for 
> what mozilla is using the modulus? (We are not sure if our conversion 
> from the Java BigInteger Class to the C side CK_BYTE is correct.) Do You 
> know how mozilla represent the modulus)
> We can give it a 129 Byte 2's Complement or a 128 Bytes 2's Complement 
> without a Signum. 

I'd have to check the code, but I believe NSS is trying to find out the key length so 
it knows how much data to allocate to accept the result. In anycase PKCS #11 modules 
are supposed to return 128 byte unsigned values (in this case the high bit is '1' for 
a normal modulus). NSS accepts 129 byte 2's complement as well.

> 
> We tried to verifiy the mail with openssl, this programm tells us that 
> the blocksize of the signed mail is incorrect (not 01),. Can You tell us 
> what this could meant, or is there a case where we have to set the 
> blocksize in the pkcs#11 module? 

It definately sounds like you aren't wrapping the messageDigest with PKCS #1.

bob
> 
> thanx in advance. 
> 
> Christopher and Sebastian 
> _______________________________________________ 
> mozilla-crypto mailing list 
> [EMAIL PROTECTED] 
> http://mail.mozilla.org/listinfo/mozilla-crypto 

_______________________________________________
mozilla-crypto mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to