/src/openssl41/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 | 143k | { |
41 | 143k | const char *s; |
42 | | |
43 | 143k | memset(r, 0, sizeof(*r)); |
44 | 143k | if (p != NULL) |
45 | 286k | for (; (s = p->key) != NULL; p++) |
46 | 143k | switch(s[0]) { |
47 | 0 | default: |
48 | 0 | break; |
49 | 3.29k | case 'i': |
50 | 3.29k | if (ossl_likely(strcmp("vlen", s + 1) == 0)) { |
51 | | /* OSSL_CIPHER_PARAM_IVLEN */ |
52 | 3.29k | 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 | 3.29k | r->ivlen = (OSSL_PARAM *)p; |
58 | 3.29k | } |
59 | 3.29k | break; |
60 | 3.29k | case 'k': |
61 | 3.29k | if (ossl_likely(strcmp("eylen", s + 1) == 0)) { |
62 | | /* OSSL_CIPHER_PARAM_KEYLEN */ |
63 | 3.29k | 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 | 3.29k | r->keylen = (OSSL_PARAM *)p; |
69 | 3.29k | } |
70 | 3.29k | break; |
71 | 136k | case 't': |
72 | 136k | if (ossl_likely(strcmp("ls-mac", s + 1) == 0)) { |
73 | | /* OSSL_CIPHER_PARAM_TLS_MAC */ |
74 | 136k | 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 | 136k | r->mac = (OSSL_PARAM *)p; |
80 | 136k | } |
81 | 143k | } |
82 | 143k | return 1; |
83 | 143k | } |
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 | 3.29k | { |
105 | 3.29k | const char *s; |
106 | | |
107 | 3.29k | memset(r, 0, sizeof(*r)); |
108 | 3.29k | if (p != NULL) |
109 | 9.87k | for (; (s = p->key) != NULL; p++) |
110 | 6.58k | if (ossl_likely(strcmp("tls-mac-size", s + 0) == 0)) { |
111 | | /* OSSL_CIPHER_PARAM_TLS_MAC_SIZE */ |
112 | 3.29k | 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 | 3.29k | r->macsize = (OSSL_PARAM *)p; |
118 | 3.29k | } |
119 | 3.29k | return 1; |
120 | 3.29k | } |
121 | | #endif |
122 | | /* End of machine generated */ |