On 3 December 2013 10:36, Aastha Mehta <aasth...@gmail.com> wrote:
> Hello,
>
> I wrote a simple code to sign and verify using DSA keys, but I am facing
> some problem with verification and I cannot figure it out. This is the error
> I get:
> error:0A071003:dsa routines:DSA_do_verify:BN lib
>
> I know the error comes from EVP_VerifyFinal, but I don't exactly know why.
>
> My code for signing and verification looks as follows:
>
> do_sign(EVP_PKEY *k, char *data, unsigned int data_len, char *signature,
> unsigned int *sig_len)
> {
>   EVP_MD_CTX *ctx = EVP_MD_CTX_create();
>   if (EVP_SignInit(ctx, EVP_sha256() == 1) && EVP_SignUpdate(ctx, data,

Well, there's one error. Mis-placed ). Should be:
EVP_SignInit(ctx, EVP_sha256()) == 1


Matt
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to