Coverage Report

Created: 2025-10-28 06:56

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/ciphers/cipher_null.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 null_get_ctx_params_list
14
static const OSSL_PARAM null_get_ctx_params_list[] = {
15
    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
16
    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
17
    OSSL_PARAM_octet_ptr(OSSL_CIPHER_PARAM_TLS_MAC, NULL, 0),
18
    OSSL_PARAM_END
19
};
20
#endif
21
22
#ifndef null_get_ctx_params_st
23
struct null_get_ctx_params_st {
24
    OSSL_PARAM *ivlen;
25
    OSSL_PARAM *keylen;
26
    OSSL_PARAM *mac;
27
};
28
#endif
29
30
#ifndef null_get_ctx_params_decoder
31
static int null_get_ctx_params_decoder
32
    (const OSSL_PARAM *p, struct null_get_ctx_params_st *r)
33
0
{
34
0
    const char *s;
35
36
0
    memset(r, 0, sizeof(*r));
37
0
    if (p != NULL)
38
0
        for (; (s = p->key) != NULL; p++)
39
0
            switch(s[0]) {
40
0
            default:
41
0
                break;
42
0
            case 'i':
43
0
                if (ossl_likely(strcmp("vlen", s + 1) == 0)) {
44
                    /* OSSL_CIPHER_PARAM_IVLEN */
45
0
                    if (ossl_unlikely(r->ivlen != NULL)) {
46
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
47
0
                                       "param %s is repeated", s);
48
0
                        return 0;
49
0
                    }
50
0
                    r->ivlen = (OSSL_PARAM *)p;
51
0
                }
52
0
                break;
53
0
            case 'k':
54
0
                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
55
                    /* OSSL_CIPHER_PARAM_KEYLEN */
56
0
                    if (ossl_unlikely(r->keylen != NULL)) {
57
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
58
0
                                       "param %s is repeated", s);
59
0
                        return 0;
60
0
                    }
61
0
                    r->keylen = (OSSL_PARAM *)p;
62
0
                }
63
0
                break;
64
0
            case 't':
65
0
                if (ossl_likely(strcmp("ls-mac", s + 1) == 0)) {
66
                    /* OSSL_CIPHER_PARAM_TLS_MAC */
67
0
                    if (ossl_unlikely(r->mac != NULL)) {
68
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
69
0
                                       "param %s is repeated", s);
70
0
                        return 0;
71
0
                    }
72
0
                    r->mac = (OSSL_PARAM *)p;
73
0
                }
74
0
            }
75
0
    return 1;
76
0
}
77
#endif
78
/* End of machine generated */
79
80
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
81
#ifndef null_set_ctx_params_list
82
static const OSSL_PARAM null_set_ctx_params_list[] = {
83
    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS_MAC_SIZE, NULL),
84
    OSSL_PARAM_END
85
};
86
#endif
87
88
#ifndef null_set_ctx_params_st
89
struct null_set_ctx_params_st {
90
    OSSL_PARAM *macsize;
91
};
92
#endif
93
94
#ifndef null_set_ctx_params_decoder
95
static int null_set_ctx_params_decoder
96
    (const OSSL_PARAM *p, struct null_set_ctx_params_st *r)
97
0
{
98
0
    const char *s;
99
100
0
    memset(r, 0, sizeof(*r));
101
0
    if (p != NULL)
102
0
        for (; (s = p->key) != NULL; p++)
103
0
            if (ossl_likely(strcmp("tls-mac-size", s + 0) == 0)) {
104
                /* OSSL_CIPHER_PARAM_TLS_MAC_SIZE */
105
0
                if (ossl_unlikely(r->macsize != NULL)) {
106
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
107
0
                                   "param %s is repeated", s);
108
0
                    return 0;
109
0
                }
110
0
                r->macsize = (OSSL_PARAM *)p;
111
0
            }
112
0
    return 1;
113
0
}
114
#endif
115
/* End of machine generated */