Coverage Report

Created: 2025-10-28 06:56

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/kem/rsa_kem.inc
Line
Count
Source
1
/*
2
 * Copyright 2025 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
12
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
13
#ifndef rsakem_get_ctx_params_list
14
static const OSSL_PARAM rsakem_get_ctx_params_list[] = {
15
# if defined(FIPS_MODULE)
16
    OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR, NULL),
17
# endif
18
    OSSL_PARAM_END
19
};
20
#endif
21
22
#ifndef rsakem_get_ctx_params_st
23
struct rsakem_get_ctx_params_st {
24
# if defined(FIPS_MODULE)
25
    OSSL_PARAM *ind;
26
# else
27
    int dummy; /* unused */
28
# endif
29
};
30
#endif
31
32
#ifndef rsakem_get_ctx_params_decoder
33
static int rsakem_get_ctx_params_decoder
34
    (const OSSL_PARAM *p, struct rsakem_get_ctx_params_st *r)
35
0
{
36
0
    const char *s;
37
38
0
    memset(r, 0, sizeof(*r));
39
0
    if (p != NULL)
40
0
        for (; (s = p->key) != NULL; p++)
41
# if defined(FIPS_MODULE)
42
            if (ossl_likely(strcmp("fips-indicator", s + 0) == 0)) {
43
                /* OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR */
44
                if (ossl_unlikely(r->ind != NULL)) {
45
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
46
                                   "param %s is repeated", s);
47
                    return 0;
48
                }
49
                r->ind = (OSSL_PARAM *)p;
50
            }
51
# else
52
0
            ;
53
0
# endif
54
0
    return 1;
55
0
}
56
#endif
57
/* End of machine generated */
58
59
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
60
#ifndef rsakem_set_ctx_params_list
61
static const OSSL_PARAM rsakem_set_ctx_params_list[] = {
62
    OSSL_PARAM_utf8_string(OSSL_KEM_PARAM_OPERATION, NULL, 0),
63
# if defined(FIPS_MODULE)
64
    OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_KEY_CHECK, NULL),
65
# endif
66
    OSSL_PARAM_END
67
};
68
#endif
69
70
#ifndef rsakem_set_ctx_params_st
71
struct rsakem_set_ctx_params_st {
72
# if defined(FIPS_MODULE)
73
    OSSL_PARAM *ind_k;
74
# endif
75
    OSSL_PARAM *op;
76
};
77
#endif
78
79
#ifndef rsakem_set_ctx_params_decoder
80
static int rsakem_set_ctx_params_decoder
81
    (const OSSL_PARAM *p, struct rsakem_set_ctx_params_st *r)
82
0
{
83
0
    const char *s;
84
85
0
    memset(r, 0, sizeof(*r));
86
0
    if (p != NULL)
87
0
        for (; (s = p->key) != NULL; p++)
88
0
            switch(s[0]) {
89
0
            default:
90
0
                break;
91
0
            case 'k':
92
# if defined(FIPS_MODULE)
93
                if (ossl_likely(strcmp("ey-check", s + 1) == 0)) {
94
                    /* OSSL_KEM_PARAM_FIPS_KEY_CHECK */
95
                    if (ossl_unlikely(r->ind_k != NULL)) {
96
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
97
                                       "param %s is repeated", s);
98
                        return 0;
99
                    }
100
                    r->ind_k = (OSSL_PARAM *)p;
101
                }
102
# endif
103
0
                break;
104
0
            case 'o':
105
0
                if (ossl_likely(strcmp("peration", s + 1) == 0)) {
106
                    /* OSSL_KEM_PARAM_OPERATION */
107
0
                    if (ossl_unlikely(r->op != NULL)) {
108
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
109
0
                                       "param %s is repeated", s);
110
0
                        return 0;
111
0
                    }
112
0
                    r->op = (OSSL_PARAM *)p;
113
0
                }
114
0
            }
115
0
    return 1;
116
0
}
117
#endif
118
/* End of machine generated */