diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-03 09:20:21 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-12 08:27:21 +1000 |
commit | 5506cd0bbd874b164f59e3e6a6a530426a2b38bf (patch) | |
tree | c4bc9dae24676165bad332bfb3e87ea583c975dd /providers/implementations/digests/mdc2_prov.c | |
parent | 5a7e999114562e5d9b696effac550d9d141ff087 (diff) |
prov: update digests to support modified ctx params
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14383)
Diffstat (limited to 'providers/implementations/digests/mdc2_prov.c')
-rw-r--r-- | providers/implementations/digests/mdc2_prov.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 */ |