--- Nils Larsch <[EMAIL PROTECTED]> wrote:

> rai mahua wrote:
> > Hi,
> > 
> > I have a case wherein I get the message that has
> been
> > signed + the R & S value of the DSA generated
> > signature.
> > 
> > How do I verify this using openssl lib.
> 
> put the r and s value into a DSA_SIG structure (i.e.
> something
> like:
>       DSA_SIG *dsasig = DSA_SIG_new();
>       BN_bin2bn(r, r_len, dsasig->r);
>       BN_bin2bn(s, s_len, dsasig->s); )
> and then use DSA_do_verify with sha-1 hash of the
> message (and, of
> course, the public key in the DSA object).
> 

So if I take a look at DSA_verify, should I replace
the call to d2i_DSA_SIG with the 2 calls to BN_bin2bn.
 
int DSA_verify(int type, const unsigned char *dgst,
int dgst_len,
             const unsigned char *sigbuf, int siglen,
DSA *dsa)
        {
        DSA_SIG *s;
        int ret=-1;

        s = DSA_SIG_new();
        if (s == NULL) return(ret);
        if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL)
goto err;  <--- should I be replacing this with
           <--- the two calls to BN_bin2bn ?
        ret=DSA_do_verify(dgst,dgst_len,s,dsa);
err:    
        DSA_SIG_free(s);
        return(ret);
        }



                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to