diff options
author | Richard Levitte <levitte@openssl.org> | 2015-11-27 14:17:50 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-12-07 17:36:57 +0100 |
commit | 77a01145be26ceeefa6870e1e9dd7f99ac123fa3 (patch) | |
tree | 5b2426456e3a7f4b8fd4790462ebf7068b547622 /crypto/evp/p_verify.c | |
parent | Make the definition of EVP_MD_CTX opaque (diff) | |
download | openssl-77a01145be26ceeefa6870e1e9dd7f99ac123fa3.tar.xz openssl-77a01145be26ceeefa6870e1e9dd7f99ac123fa3.zip |
Have other crypto/evp files include evp_locl.h
Note: this does not include the files in crypto/evp that are just
instanciations of EVP_MD.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/evp/p_verify.c')
-rw-r--r-- | crypto/evp/p_verify.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c index 9802dccbae..02c26631f0 100644 --- a/crypto/evp/p_verify.c +++ b/crypto/evp/p_verify.c @@ -70,17 +70,20 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, int i = 0; EVP_PKEY_CTX *pkctx = NULL; - if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) { + if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) { if (!EVP_DigestFinal_ex(ctx, m, &m_len)) goto err; } else { int rv = 0; - EVP_MD_CTX tmp_ctx; - EVP_MD_CTX_init(&tmp_ctx); - rv = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx); + EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_create(); + if (tmp_ctx == NULL) { + EVPerr(EVP_F_EVP_VERIFYFINAL, ERR_R_MALLOC_FAILURE); + return 0; + } + rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx); if (rv) - rv = EVP_DigestFinal_ex(&tmp_ctx, m, &m_len); - EVP_MD_CTX_cleanup(&tmp_ctx); + rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len); + EVP_MD_CTX_destroy(tmp_ctx); if (!rv) return 0; } |