Hi,
Thank you very much for the response.
In one protocol, the signature algorithm is defined to be always SHA1. The encoding to be used
is EMSA-PKCS1-v1_5 encoding as defined in PKCS#1 v2.0 document.

In my implementation, Iam using RSA_private_encrypt instead of RSA_sign() for signing purpose.

I referred to section 9.2 of rfc 3447(Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1)
document which says the following

         EM = 0x00 || 0x01 || PS || 0x00 || T.

where T  for SHA1 is defined as

      SHA-1:   (0x)30 21 30 09 06 05 2b 0e 03 02 1a 05 00 04 14 || H.
(H is the Hash value from Step 1).

My specific question is

Is it expected that the input I pass to RSA_private_encrypt for "from" MUST contain the HASH pre-pended with the hex value defined
    or is there any function in OpenSSL which can be called to set this value.

Awaiting your valuable response..

Regards
Suram


At 06:32 PM 5/25/2005, you wrote:
On Wed, May 25, 2005, Suram Chandra Sekhar wrote:

> Hi all,
> Thank you very much for the reply.  I was going through the man page of
> RSA_sign().  It is indicating as follows...
> If type is NID_md5_sha1, an SSL signature (MD5 and SHA1 message digests
> with PKCS #1 padding and no algorithm identifier)
> is created.
>
> It means that Signature Algorithm is not used in RSA_sign().  If my
> understanding is correct, can anyone please point out how to make
> RSA_sign() do this job.
>

Not sure what you mean there.

NID_md5_sha1 is an exceptional case where the signature format is different.
This format is required for TLS and SSL.

In all other cases the DigestInfo encapsulation is used.

AFAIK there isn't a standard for DigestInfo encapsulation of a TLS/SSL
signature: not sure why you'd want to.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]


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

Reply via email to