summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-01-10 17:09:59 +0100
committerTomas Mraz <tomas@openssl.org>2022-01-12 13:03:47 +0100
commit3dcec2fb274235e938ce04f43e3e2f6d5743ae52 (patch)
treeeb342c2fb7ef1b46739fbe60e590697717e0e21a /crypto
parent3755dc294d2e24b741e235550d063850464467cb (diff)
EVP_DigestSignFinal: *siglen should not be read if sigret == NULL
This fixes small regression from #16962. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17460) (cherry picked from commit a4e01187d3648d9ce99507097400902cf21f9b55)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/m_sigver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c
index 9188edbc21..7409780065 100644
--- a/crypto/evp/m_sigver.c
+++ b/crypto/evp/m_sigver.c
@@ -480,14 +480,14 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
if (sigret == NULL || (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) != 0)
return pctx->op.sig.signature->digest_sign_final(pctx->op.sig.algctx,
sigret, siglen,
- (siglen == NULL) ? 0 : *siglen);
+ sigret == NULL ? 0 : *siglen);
dctx = EVP_PKEY_CTX_dup(pctx);
if (dctx == NULL)
return 0;
r = dctx->op.sig.signature->digest_sign_final(dctx->op.sig.algctx,
sigret, siglen,
- (siglen == NULL) ? 0 : *siglen);
+ *siglen);
EVP_PKEY_CTX_free(dctx);
return r;