Coverage Report

Created: 2026-05-20 07:05

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