Coverage Report

Created: 2026-09-13 06:13

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