summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. David von Oheimb <dev@ddvo.net>2023-10-13 22:27:31 +0200
committerDr. David von Oheimb <dev@ddvo.net>2023-10-17 22:06:35 +0200
commit7343a0847959ae3e7ed356dffdeaa1c9c89eeec3 (patch)
treef9e3960b768122faf784f031708d58b7cc7ad30c
parent3dee5c2f175216bf99c8070acb5755b48875c1d7 (diff)
EVP shake_ctrl(): add missing NULL evp_ctx check
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22390) (cherry picked from commit 410c80dc7bf2085167553ab9fa517189eed2b3a6)
-rw-r--r--crypto/evp/legacy_sha.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/evp/legacy_sha.c b/crypto/evp/legacy_sha.c
index 3859286eeb..0c2afc2900 100644
--- a/crypto/evp/legacy_sha.c
+++ b/crypto/evp/legacy_sha.c
@@ -71,7 +71,11 @@ static int sha1_int_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
static int shake_ctrl(EVP_MD_CTX *evp_ctx, int cmd, int p1, void *p2)
{
- KECCAK1600_CTX *ctx = evp_ctx->md_data;
+ KECCAK1600_CTX *ctx;
+
+ if (evp_ctx == NULL)
+ return 0;
+ ctx = evp_ctx->md_data;
switch (cmd) {
case EVP_MD_CTRL_XOF_LEN: