diff options
Diffstat (limited to 'providers/implementations/digests/sha3_prov.c')
-rw-r--r-- | providers/implementations/digests/sha3_prov.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/providers/implementations/digests/sha3_prov.c b/providers/implementations/digests/sha3_prov.c index 0db6f86be8..168825d475 100644 --- a/providers/implementations/digests/sha3_prov.c +++ b/providers/implementations/digests/sha3_prov.c @@ -284,15 +284,17 @@ static int shake_set_ctx_params(void *vctx, const OSSL_PARAM params[]) const OSSL_PARAM *p; KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx; - if (ctx != NULL && params != NULL) { - p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN); - if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) { - ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); - return 0; - } + if (ctx == NULL) + return 0; + if (params == NULL) return 1; + + p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN); + if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) { + ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); + return 0; } - return 0; /* Null Parameter */ + return 1; } #define IMPLEMENT_SHA3_functions(bitlen) \ |