X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=providers%2Fimplementations%2Fdigests%2Fmdc2_prov.c;h=b184c8393cabfa9580ac9dd2d1815c599c66579f;hp=edd73ed89ee4b4ac309429221ff4b121b7a8a214;hb=HEAD;hpb=e772f25ca856d830b46927464c8e79c819746974;ds=sidebyside diff --git a/providers/implementations/digests/mdc2_prov.c b/providers/implementations/digests/mdc2_prov.c index edd73ed89e..de39f8a104 100644 --- a/providers/implementations/digests/mdc2_prov.c +++ b/providers/implementations/digests/mdc2_prov.c @@ -41,15 +41,17 @@ static int mdc2_set_ctx_params(void *vctx, const OSSL_PARAM params[]) const OSSL_PARAM *p; MDC2_CTX *ctx = (MDC2_CTX *)vctx; - if (ctx != NULL && params != NULL) { - p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_PAD_TYPE); - if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->pad_type)) { - 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_PAD_TYPE); + if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->pad_type)) { + ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); + return 0; } - return 0; /* Null Parameter */ + return 1; } /* ossl_mdc2_functions */