Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVP_DigestSignFinal: *siglen should not be read if sigret == NULL #17460

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions crypto/evp/m_sigver.c
Expand Up @@ -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);
mattcaswell marked this conversation as resolved.
Show resolved Hide resolved
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;

Expand Down