Hi,

I have another newbie question.

I'm using RSA_verify to verify a signature which synopsis according to the OpenSSL 
webpage documentation if following:

int RSA_verify(int type, unsigned char *m, unsigned int m_len,
    unsigned char *sigbuf, unsigned int siglen, RSA *rsa);

and i've been wondering what should be there in siglen?

I tried strlen(sigbuf), but then my signature doesn't verify - RSA_verify returns a -1 
and the error is "wrong signature length".
(If the sigbuf contains string terminating characters, strlen(sigbuf) doesn't return 
the actual length of sigbuf.)

If i force the siglen to be "right" using the following code:

returnval = RSA_verify(NID_sha1, mdigest, md_len, sigret, (unsigned 
int)RSA_size(pubkey->pkey.rsa), pubkey->pkey.rsa);
  if (returnval != 1) {ERR_print_errors_fp (stderr); exit(1);}

the signature verifies ok.

Have i misunderstood something? How do I get the right size of sigbuf into the 
variable siglen?


Thanx in advance,
Elen

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

Reply via email to