Coverage Report

Created: 2025-11-11 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/digests/mdc2_prov.c
Line
Count
Source
1
/*
2
 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
/*
11
 * MDC2 low level APIs are deprecated for public use, but still ok for
12
 * internal use.
13
 */
14
#include "internal/deprecated.h"
15
16
#include <string.h>
17
#include <openssl/crypto.h>
18
#include <openssl/params.h>
19
#include <openssl/mdc2.h>
20
#include <openssl/core_names.h>
21
#include <openssl/err.h>
22
#include <openssl/proverr.h>
23
#include <internal/common.h>
24
#include "prov/digestcommon.h"
25
#include "prov/implementations.h"
26
#include "providers/implementations/digests/mdc2_prov.inc"
27
28
static OSSL_FUNC_digest_set_ctx_params_fn mdc2_set_ctx_params;
29
static OSSL_FUNC_digest_settable_ctx_params_fn mdc2_settable_ctx_params;
30
31
static const OSSL_PARAM *mdc2_settable_ctx_params(ossl_unused void *ctx,
32
                                                  ossl_unused void *provctx)
33
0
{
34
0
    return mdc2_set_ctx_params_list;
35
0
}
36
37
static int mdc2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
38
62
{
39
62
    struct mdc2_set_ctx_params_st p;
40
62
    MDC2_CTX *ctx = (MDC2_CTX *)vctx;
41
42
62
    if (ctx == NULL || !mdc2_set_ctx_params_decoder(params, &p))
43
0
        return 0;
44
45
62
    if (p.pad != NULL && !OSSL_PARAM_get_uint(p.pad, &ctx->pad_type)) {
46
0
        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
47
0
        return 0;
48
0
    }
49
62
    return 1;
50
62
}
51
52
/* ossl_mdc2_functions */
53
IMPLEMENT_digest_functions_with_settable_ctx(
Unexecuted instantiation: mdc2_prov.c:mdc2_newctx
Unexecuted instantiation: mdc2_prov.c:mdc2_dupctx
54
    mdc2, MDC2_CTX, MDC2_BLOCK, MDC2_DIGEST_LENGTH, 0,
55
    MDC2_Init, MDC2_Update, MDC2_Final,
56
    mdc2_settable_ctx_params, mdc2_set_ctx_params)