With the changes as mentioned, I get a core dump at DSA_do_verify, reason being that dsa_sig->s & dsa_sig->r are NULL. ??
static int verify_dsa_msg(const EVP_MD_CTX *ctx, const u_char *sigdata, int siglen, EVP_PKEY *pubkey) { static EVP_MD_CTX tmp_ctx; unsigned char dgst[EVP_MAX_MD_SIZE]; unsigned int dgst_len; DSA_SIG *dsa_sig; int rc; EVP_MD_CTX_init(&tmp_ctx); EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); EVP_DigestFinal_ex(&tmp_ctx,&(dgst[0]),&dgst_len); EVP_MD_CTX_cleanup(&tmp_ctx); if (siglen != 40) return -1; dsa_sig = DSA_SIG_new(); if (dsa_sig == NULL) return -1; //if (d2i_DSA_SIG(&dsa_sig,&sigbuf,siglen) == NULL) //goto err; BN_bin2bn(sigdata, 20, dsa_sig->r); BN_bin2bn(sigdata + 20, 20, dsa_sig->s); rc=DSA_do_verify(dgst,dgst_len,dsa_sig, pubkey->pkey.ptr); DSA_SIG_free(dsa_sig); return rc; } --- Nils Larsch <[EMAIL PROTECTED]> wrote: > rai mahua wrote: > ... > > 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. > > yes > > Nils > > ______________________________________________________________________ > OpenSSL Project > http://www.openssl.org > User Support Mailing List > [EMAIL PROTECTED] > Automated List Manager > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]