Hello, I think that you have a problem with the call "strlen(firma)", because this function use the character '\0' to find the length of the char* and you has not initialized the char* firma.
On 4/13/05, Angel Martinez Gonzalez <[EMAIL PROTECTED]> wrote: > 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] > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]