Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-26 Thread helpcrypto helpcrypto
Robert Relyea rrel...@redhat.com wrote: Sorry my bad, I wasn't clear. The double decrypt happens in the case where you first call C_Decrypt with pData = NULL. In that case you can return 128 instead of decrypting the data just to get the length. In the case where C_Decrypt is called with

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-26 Thread Robert Relyea
On 01/26/2012 12:04 AM, helpcrypto helpcrypto wrote: Robert Relyearrel...@redhat.com wrote: Sorry my bad, I wasn't clear. The double decrypt happens in the case where you first call C_Decrypt with pData = NULL. In that case you can return 128 instead of decrypting the data just to get the

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-26 Thread helpcrypto helpcrypto
In the first call you need to return a value at least big enough to hold the decrypted data. 128 bytes (size of encrypted data) is big enough for RSA. This isn't ideal, however. You keep saying the data is 24 bytes, but that's not a given, it's only true in the case you were talking. If you

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-25 Thread helpcrypto helpcrypto
Yes, 24 bytes is the length of the key. That key length is different for different key length. You are supposed to get that length from the encoded in pkcs #1 format. The underlying decode function should tell you how many bytes it is returning (assuming it's decoding pkcs #1 data). That is

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-25 Thread Robert Relyea
On 01/25/2012 12:52 AM, helpcrypto helpcrypto wrote: Yes, 24 bytes is the length of the key. That key length is different for different key length. You are supposed to get that length from the encoded in pkcs #1 format. The underlying decode function should tell you how many bytes it is

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-25 Thread Erwann Abalea
Le mardi 24 janvier 2012 16:29:05 UTC+1, helpcrypto helpcrypto a écrit : Ok guys, just to let you know, now its working. (Again, this list deserves my love) 2 things were happenning: 1-As Rob Relyea (thx) pointed me, i was doing something wrong: My C_Decrypt function was returning 128

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-24 Thread helpcrypto helpcrypto
Ok guys, just to let you know, now its working. (Again, this list deserves my love) 2 things were happenning: 1-As Rob Relyea (thx) pointed me, i was doing something wrong: My C_Decrypt function was returning 128 bytes instead of the 24 seems it should. Why it should return 24 and not

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-24 Thread Robert Relyea
On 01/24/2012 07:29 AM, helpcrypto helpcrypto wrote: Ok guys, just to let you know, now its working. (Again, this list deserves my love) 2 things were happenning: 1-As Rob Relyea (thx) pointed me, i was doing something wrong: My C_Decrypt function was returning 128 bytes instead of the 24

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-23 Thread helpcrypto helpcrypto
Hi again rob/all, thx for your answer. This appears to be your problem.  I have know idea what library you are using for your primitives (presumably openssl) Yeah, Openssl , but it clearly is not decrypting the key with RSA_PKCS1_PADDING. The expected result should be something like 24-16

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-23 Thread Martin Paljak
On Mon, Jan 23, 2012 at 10:18, helpcrypto helpcrypto helpcry...@gmail.com wrote: Ill ask again: We do only CKM_RSA_PKCS. Does Mozilla Thundebird requires other mechanims to work properly? AFAIK not. -- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org

Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-20 Thread helpcrypto helpcrypto
Hello guys! Sorry if already asked on the list, but i cant find a similar issue.(Maybe i have to improve my find skills) We are developing a PKCS#11 library for our smartcard, actually working great on win, Linux and osx. (No, its not based on OpenSC, although IMHO it should) Yesterday we

Re: Thunderbird encrypted mail using certificate (on smartcard) isnt able to C_Decrypt the message. Why?

2012-01-20 Thread Robert Relyea
On 01/20/2012 04:17 AM, helpcrypto helpcrypto wrote: After requesting for the pin, Thunderbird calls C_DecryptInit with mechanism CKM_RSA_PKCS and my private key handle. That seems OK. Then, it invokes C_Decrypt with some bytes (Always the same for the same mail...128 length), and we try the