On March 10, 2004 at 13:16, "Dr. Stephen Henson" wrote:

> > % openssl rsautl -in openssl.sig -verify -inkey pub.pem -pubin -raw -hexdum
> p
> > 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff   ................
> > 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff 00 30 21 30   .............0!0
> > 0020 - 09 06 05 2b 0e 03 02 1a-05 00 04 14 3a c4 60 ec   ...+........:.`.
> > 0030 - 70 1b bf fe 93 6f 07 61-1b eb 9c ea 9d ca f0 c3   p....o.a........
> > 
> > And this looks to me that EMSA-PKCS1-v1_5 encoding is being used.
> 
> Yes it is. You might want to try rsautl on the JCE signature too.

I eventually did.  One one set of data it was messed up, but on
another set of data, it looked correct.  So I believe it is developer
usage error and not the JCE implementation.

> > P.S.  If EMSA-PKCS1-v1_5 encoding is used, why do I need to
> > specify the digest to EVP_VerifyInit() since the digest type
> > can be extracted from the signature data?
> 
> Because the signature data and public key is passed to EVP_VerifyFinal() not
> EVP_VerifyInit() so it has to know the digest first in order to calculate it.
> The actual ordering is typically that used in single pass processing in some
> ASN1 structures where you have the digest name, the data to be digested and
> finally the signature details.
> 
> Additionally other signature methods cannot extract the digest type from the
> signature.

This is what I thought.  For the project I am working on, the signature
data is directly accessible, so we could extract the digest type from
the signature before calling EVP_VerifyInit().

Thanks for your response,

--ewh
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to