Thanks Steve for pointing out that i posting to the wrong list, sorry my bad for some reason i didn't read it right. anyways...

lemme give some background
i have a plain text file plain.txt

i call
#> openssl rsautl -sign -inkey ./private/cakey.pem -in plain.txt -out signature.bin
so my first question
1) what kind of hashing alogrithm would the above command use ? is it possible to suggest one to use like sha1 or md5 etc ...

in my c code i'm using the EVP_verify interface to verify the signature.bin

here's what i do
* I load the cert
* read the public key into EVP_PKEY
* read the plaintext into a buffer 'plainTextData'
* read the signature.bin into a buffer 'sig_buf'
and then do the followin

   EVP_MD_CTX_init(&md_ctx);

EVP_VerifyInit (&md_ctx, EVP_sha1()); <--- here i'm not sure which hash algo to specify. ???
   EVP_VerifyUpdate (&md_ctx, plainTextData, plainTextSize);
   err = EVP_VerifyFinal (&md_ctx, sig_buf, sig_len, pkey);

here what i get
11908:error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm:a_verify.c:141: 11908:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:asn1_lib.c:132: 11908:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:935: 11908:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:304:Type=X509_SIG

Any lead would appreciated, as i'm out of ideas.
Thanks
KB


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

Reply via email to