Hello:

I want sign with OpenSSL, and I use the RSA_sign fuction:


void Firmar(char *mdigest, int longmdigest, RSA *claveRSA)
{
 int error;
 char *firma;

 firma = malloc(RSA_size(claveRSA));

 error = RSA_sign(NID_sha1, mdigest, longmdigest, firma, strlen(firma),
claveRSA);

 if (error == 1)
  printf ("Firma realizada con exito\n");
 else
  printf ("Error en el firmado\n");

}

And I call to this funcion "Firmar" with this code:

Firmar(messagedigest, longitudMensajeDigest, parClaves);

Where:
unsigned char messagedigest[EVP_MAX_MD_SIZE];
int longitudMensajeDigest;
RSA *parClaves;

and this variables have a valid value.

But I have an error in execution time. What is wrong?.

Thanks.


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

Reply via email to