diff options
author | djm <> | 2009-01-09 12:15:52 +0000 |
---|---|---|
committer | djm <> | 2009-01-09 12:15:52 +0000 |
commit | 23f8d96f0f508b8bef2602049feee9c44228d34c (patch) | |
tree | a2a7787bc00e8f6a29153b8c6d9eb5e8f73d6269 /src/lib/libcrypto/evp/p_verify.c | |
parent | 30562050421d947c3eb3c10edde6e87730b17471 (diff) | |
download | openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.gz openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.bz2 openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/evp/p_verify.c')
-rw-r--r-- | src/lib/libcrypto/evp/p_verify.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c index 21a40a375e..2d46dffe7e 100644 --- a/src/lib/libcrypto/evp/p_verify.c +++ b/src/lib/libcrypto/evp/p_verify.c | |||
@@ -85,17 +85,29 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, | |||
85 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); | 85 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); |
86 | return(-1); | 86 | return(-1); |
87 | } | 87 | } |
88 | EVP_MD_CTX_init(&tmp_ctx); | 88 | if (ctx->digest->verify == NULL) |
89 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); | ||
90 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | ||
91 | EVP_MD_CTX_cleanup(&tmp_ctx); | ||
92 | if (ctx->digest->verify == NULL) | ||
93 | { | 89 | { |
94 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED); | 90 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED); |
95 | return(0); | 91 | return(0); |
96 | } | 92 | } |
97 | 93 | ||
98 | return(ctx->digest->verify(ctx->digest->type,m,m_len, | 94 | EVP_MD_CTX_init(&tmp_ctx); |
99 | sigbuf,siglen,pkey->pkey.ptr)); | 95 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); |
96 | if (ctx->digest->flags & EVP_MD_FLAG_SVCTX) | ||
97 | { | ||
98 | EVP_MD_SVCTX sctmp; | ||
99 | sctmp.mctx = &tmp_ctx; | ||
100 | sctmp.key = pkey->pkey.ptr; | ||
101 | i = ctx->digest->verify(ctx->digest->type, | ||
102 | NULL, -1, sigbuf, siglen, &sctmp); | ||
103 | } | ||
104 | else | ||
105 | { | ||
106 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | ||
107 | i = ctx->digest->verify(ctx->digest->type,m,m_len, | ||
108 | sigbuf,siglen,pkey->pkey.ptr); | ||
109 | } | ||
110 | EVP_MD_CTX_cleanup(&tmp_ctx); | ||
111 | return i; | ||
100 | } | 112 | } |
101 | 113 | ||