summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/m_sigver.c
diff options
context:
space:
mode:
authortb <>2024-03-26 01:41:06 +0000
committertb <>2024-03-26 01:41:06 +0000
commit3f508b41e33a97172c7c36238e28ddfb36bc32fd (patch)
tree32b2ac634a93c4f274cba242ff5c9c4ddb5f3b6e /src/lib/libcrypto/evp/m_sigver.c
parent445e5d71910656f3b05e76de680c2c867db9e9df (diff)
downloadopenbsd-3f508b41e33a97172c7c36238e28ddfb36bc32fd.tar.gz
openbsd-3f508b41e33a97172c7c36238e28ddfb36bc32fd.tar.bz2
openbsd-3f508b41e33a97172c7c36238e28ddfb36bc32fd.zip
Garbage collect the unused verifyctx() and verifyctx_init()
ok joshua jsing
Diffstat (limited to 'src/lib/libcrypto/evp/m_sigver.c')
-rw-r--r--src/lib/libcrypto/evp/m_sigver.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/lib/libcrypto/evp/m_sigver.c b/src/lib/libcrypto/evp/m_sigver.c
index f89f6034bf..5fe3cc8964 100644
--- a/src/lib/libcrypto/evp/m_sigver.c
+++ b/src/lib/libcrypto/evp/m_sigver.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sigver.c,v 1.18 2024/03/25 11:41:40 joshua Exp $ */ 1/* $OpenBSD: m_sigver.c,v 1.19 2024/03/26 01:41:06 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -95,12 +95,7 @@ do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type,
95 } 95 }
96 96
97 if (ver) { 97 if (ver) {
98 if (ctx->pctx->pmeth->verifyctx_init) { 98 if (ctx->pctx->pmeth->digestverify != NULL) {
99 if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx,
100 ctx) <=0)
101 return 0;
102 ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX;
103 } else if (ctx->pctx->pmeth->digestverify != NULL) {
104 ctx->pctx->operation = EVP_PKEY_OP_VERIFY; 99 ctx->pctx->operation = EVP_PKEY_OP_VERIFY;
105 ctx->update = update_oneshot_only; 100 ctx->update = update_oneshot_only;
106 } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) 101 } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0)
@@ -233,22 +228,13 @@ EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen)
233 unsigned char md[EVP_MAX_MD_SIZE]; 228 unsigned char md[EVP_MAX_MD_SIZE];
234 int r; 229 int r;
235 unsigned int mdlen = 0; 230 unsigned int mdlen = 0;
236 int vctx;
237 231
238 if (ctx->pctx->pmeth->verifyctx)
239 vctx = 1;
240 else
241 vctx = 0;
242 EVP_MD_CTX_legacy_clear(&tmp_ctx); 232 EVP_MD_CTX_legacy_clear(&tmp_ctx);
243 if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx)) 233 if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
244 return -1; 234 return -1;
245 if (vctx) { 235 r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen);
246 r = tmp_ctx.pctx->pmeth->verifyctx(tmp_ctx.pctx, sig,
247 siglen, &tmp_ctx);
248 } else
249 r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen);
250 EVP_MD_CTX_cleanup(&tmp_ctx); 236 EVP_MD_CTX_cleanup(&tmp_ctx);
251 if (vctx || !r) 237 if (!r)
252 return r; 238 return r;
253 return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); 239 return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen);
254} 240}