/src/openssl41/providers/implementations/rands/seed_src.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 seed_src_get_ctx_params_list |
21 | | static ossl_unused const OSSL_PARAM seed_src_get_ctx_params_list[] = { |
22 | | OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL), |
23 | | OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL), |
24 | | OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL), |
25 | | OSSL_PARAM_END |
26 | | }; |
27 | | #endif |
28 | | |
29 | | #ifndef seed_src_get_ctx_params_st |
30 | | struct seed_src_get_ctx_params_st { |
31 | | OSSL_PARAM *maxreq; |
32 | | OSSL_PARAM *state; |
33 | | OSSL_PARAM *str; |
34 | | }; |
35 | | #endif |
36 | | |
37 | | #ifndef seed_src_get_ctx_params_decoder |
38 | | static ossl_unused int seed_src_get_ctx_params_decoder |
39 | | (const OSSL_PARAM *p, struct seed_src_get_ctx_params_st *r) |
40 | 211 | { |
41 | 211 | const char *s; |
42 | | |
43 | 211 | memset(r, 0, sizeof(*r)); |
44 | 211 | if (p != NULL) |
45 | 422 | for (; (s = p->key) != NULL; p++) |
46 | 211 | switch(s[0]) { |
47 | 46 | default: |
48 | 46 | break; |
49 | 137 | case 'm': |
50 | 137 | if (ossl_likely(strcmp("ax_request", s + 1) == 0)) { |
51 | | /* OSSL_RAND_PARAM_MAX_REQUEST */ |
52 | 137 | if (ossl_unlikely(r->maxreq != 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 | 137 | r->maxreq = (OSSL_PARAM *)p; |
58 | 137 | } |
59 | 137 | break; |
60 | 137 | case 's': |
61 | 28 | switch(s[1]) { |
62 | 0 | default: |
63 | 0 | break; |
64 | 28 | case 't': |
65 | 28 | switch(s[2]) { |
66 | 0 | default: |
67 | 0 | break; |
68 | 0 | case 'a': |
69 | 0 | if (ossl_likely(strcmp("te", s + 3) == 0)) { |
70 | | /* OSSL_RAND_PARAM_STATE */ |
71 | 0 | if (ossl_unlikely(r->state != NULL)) { |
72 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
73 | 0 | "param %s is repeated", s); |
74 | 0 | return 0; |
75 | 0 | } |
76 | 0 | r->state = (OSSL_PARAM *)p; |
77 | 0 | } |
78 | 0 | break; |
79 | 28 | case 'r': |
80 | 28 | if (ossl_likely(strcmp("ength", s + 3) == 0)) { |
81 | | /* OSSL_RAND_PARAM_STRENGTH */ |
82 | 28 | if (ossl_unlikely(r->str != NULL)) { |
83 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
84 | 0 | "param %s is repeated", s); |
85 | 0 | return 0; |
86 | 0 | } |
87 | 28 | r->str = (OSSL_PARAM *)p; |
88 | 28 | } |
89 | 28 | } |
90 | 28 | } |
91 | 211 | } |
92 | 211 | return 1; |
93 | 211 | } |
94 | | #endif |
95 | | /* End of machine generated */ |