X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fevp%2Fp_verify.c;h=21a40a375e1b71b6e3a2c17bd0a8ee840cde1ec2;hb=4bb61becbbdb5cb588a2763ce274c8725e3cc063;hp=8d727d8f02d9b9474eb599801ef89f53764b6161;hpb=78414a6a897db42c9bcf06aa21c705811ab33921;p=oweals%2Fopenssl.git diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c index 8d727d8f02..21a40a375e 100644 --- a/crypto/evp/p_verify.c +++ b/crypto/evp/p_verify.c @@ -58,15 +58,12 @@ #include #include "cryptlib.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" +#include +#include +#include -int EVP_VerifyFinal(ctx,sigbuf,siglen,pkey) -EVP_MD_CTX *ctx; -unsigned char *sigbuf; -unsigned int siglen; -EVP_PKEY *pkey; +int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey) { unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; @@ -88,8 +85,10 @@ EVP_PKEY *pkey; EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); return(-1); } - memcpy(&tmp_ctx,ctx,sizeof(EVP_MD_CTX)); - EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); + EVP_MD_CTX_init(&tmp_ctx); + EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); + EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); + EVP_MD_CTX_cleanup(&tmp_ctx); if (ctx->digest->verify == NULL) { EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED);