Asterisk - The Open Source Telephony Project GIT-master-f36a736
common_config.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2023, Sangoma Technologies Corporation
5 *
6 * George Joseph <gjoseph@sangoma.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19#ifndef COMMON_CONFIG_H_
20#define COMMON_CONFIG_H_
21
22#include <openssl/evp.h>
23
24#include "asterisk.h"
25#include "asterisk/paths.h"
26#include "asterisk/sorcery.h"
28
29/*!
30 * \brief Boolean field to/from string prototype generator
31 *
32 * Most of the boolean fields that appear in the verification and
33 * attestation objects can be ovrridden in the profile object;
34 * "use_rfc9410_responses" for instance. If they were registered as
35 * normal YESNO types, we couldn't tell if a "0" value in the profile
36 * object meant the user set it to "no" to override a value of "yes"
37 * in the verification object, or it just defaulted to "0". By making
38 * the _NOT_SET enum a non-0/1 and making it the default value, we can
39 * tell the difference. The _UNKNOWN enum gets set if the string value
40 * provided to the _from_str function wasn't recognized as one of the
41 * values acceptable to ast_true() or ast_false().
42 *
43 * The result of calling the generator for a field will look like:
44 *
45 \code
46 enum use_rfc9410_responses_enum {
47 use_rfc9410_responses_UNKNOWN = -1,
48 use_rfc9410_responses_NO = 0,
49 use_rfc9410_responses_YES,
50 use_rfc9410_responses_NOT_SET,
51};
52enum use_rfc9410_responses_enum
53 use_rfc9410_responses_from_str(const char *value);
54const char *use_rfc9410_responses_to_str(enum use_rfc9410_responses_enum value);
55\endcode
56
57Most of the macros that follow depend on enum values formatted
58as <param_name>_SOMETHING and their defaults as DEFAULT_<param_name>.
59 */
60#define generate_bool_string_prototypes(param_name) \
61enum param_name ## _enum { \
62 param_name ## _UNKNOWN = -1, \
63 param_name ## _NO = 0, \
64 param_name ## _YES, \
65 param_name ## _NOT_SET, \
66}; \
67enum param_name ## _enum \
68 param_name ## _from_str(const char *value); \
69const char *param_name ## _to_str(enum param_name ## _enum value);
70
71/*
72 * Run the generators
73 */
74generate_bool_string_prototypes(use_rfc9410_responses);
75
76generate_bool_string_prototypes(relax_x5u_port_scheme_restrictions);
77
78generate_bool_string_prototypes(relax_x5u_path_restrictions);
79
81
82generate_bool_string_prototypes(check_tn_cert_public_url);
83
85
86/*!
87 * \brief Enum field to/from string prototype generator
88 *
89 * This operates like the bool generator except you supply
90 * a list of the enum values. The first one MUST be
91 * param_name_UNKNOWN with a value of -1 and the rest running
92 * sequentially with the last being param_name_NOT_SET.
93 */
94#define generate_enum_string_prototypes(param_name, ...) \
95enum param_name ## _enum { \
96 __VA_ARGS__ \
97}; \
98enum param_name ## _enum \
99 param_name ## _from_str(const char *value); \
100const char *param_name ## _to_str(enum param_name ## _enum value);
101
103 endpoint_behavior_UNKNOWN = -1,
104 endpoint_behavior_OFF = 0,
105 endpoint_behavior_ATTEST,
106 endpoint_behavior_VERIFY,
107 endpoint_behavior_ON,
108 endpoint_behavior_NOT_SET
109);
110
112 attest_level_UNKNOWN = -1,
113 attest_level_NOT_SET = 0,
114 attest_level_A,
115 attest_level_B,
116 attest_level_C,
117);
118
119/*
120 * unknown_tn_attest_level uses the same enum as attest_level.
121 */
122enum attest_level_enum unknown_tn_attest_level_from_str(const char *value);
123const char *unknown_tn_attest_level_to_str(enum attest_level_enum value);
124
125/*
126 * enum stir_shaken_failure_action is defined in
127 * res_stir_shaken.h because res_pjsip_stir_shaken needs it
128 * we we need to just declare the function prototypes.
129 */
130
132 stir_shaken_failure_action_from_str(const char *action_str);
133
136
137/*!
138 * \brief Enum sorcery handler generator
139 *
140 * These macros can create the two functions needed to
141 * register an enum field with sorcery as long as there
142 * are _to_str and _from_str functions defined elsewhere.
143 *
144 */
145#define generate_sorcery_enum_to_str_ex(__struct, __substruct, __lc_param, __base_enum) \
146static int sorcery_ ## __lc_param ## _to_str(const void *obj, const intptr_t *args, char **buf) \
147{ \
148 const struct __struct *cfg = obj; \
149 *buf = ast_strdup(__base_enum ## _to_str(cfg->__substruct __lc_param)); \
150 return *buf ? 0 : -1; \
151}
152
153#define generate_sorcery_enum_to_str(__struct, __substruct, __lc_param) \
154 generate_sorcery_enum_to_str_ex(__struct, __substruct, __lc_param, __lc_param)
155
156#define generate_sorcery_enum_from_str_ex(__struct, __substruct, __lc_param, __base_enum, __unknown) \
157static int sorcery_ ## __lc_param ## _from_str(const struct aco_option *opt, struct ast_variable *var, void *obj) \
158{ \
159 struct __struct *cfg = obj; \
160 cfg->__substruct __lc_param = __base_enum ## _from_str (var->value); \
161 if (cfg->__substruct __lc_param == __base_enum ## _ ## __unknown) { \
162 ast_log(LOG_WARNING, "Unknown value '%s' specified for %s\n", \
163 var->value, var->name); \
164 return -1; \
165 } \
166 return 0; \
167}
168
169#define generate_sorcery_enum_from_str(__struct, __substruct, __lc_param, __unknown) \
170 generate_sorcery_enum_from_str_ex(__struct, __substruct, __lc_param, __lc_param, __unknown) \
171
172
173#define generate_sorcery_acl_to_str(__struct, __lc_param) \
174static int sorcery_acl_to_str(const void *obj, const intptr_t *args, char **buf) \
175{ \
176 const struct __struct *cfg = obj; \
177 struct ast_acl *first_acl; \
178 if (!ast_acl_list_is_empty(cfg->vcfg_common.acl)) { \
179 AST_LIST_LOCK(cfg->vcfg_common.acl); \
180 first_acl = AST_LIST_FIRST(cfg->vcfg_common.acl); \
181 if (ast_strlen_zero(first_acl->name)) { \
182 *buf = "deny/permit"; \
183 } else { \
184 *buf = first_acl->name; \
185 } \
186 AST_LIST_UNLOCK(cfg->vcfg_common.acl); \
187 } \
188 *buf = ast_strdup(*buf); \
189 return 0; \
190}
191
192#define generate_sorcery_acl_from_str(__struct, __lc_param, __unknown) \
193static int sorcery_acl_from_str(const struct aco_option *opt, struct ast_variable *var, void *obj) \
194{ \
195 struct __struct *cfg = obj; \
196 int error = 0; \
197 int ignore; \
198 const char *name = var->name + strlen("x5u_"); \
199 if (ast_strlen_zero(var->value)) { \
200 return 0; \
201 } \
202 ast_append_acl(name, var->value, &cfg->vcfg_common.acl, &error, &ignore); \
203 return error; \
204}
205
207
208#define EFFECTIVE_ENUM(__enum1, __enum2, __field, __default) \
209 ( __enum1 != ( __field ## _ ## NOT_SET ) ? __enum1 : \
210 (__enum2 != __field ## _ ## NOT_SET ? \
211 __enum2 : __default ))
212
213#define EFFECTIVE_ENUM_BOOL(__enum1, __enum2, __field, __default) \
214 (( __enum1 != ( __field ## _ ## NOT_SET ) ? __enum1 : \
215 (__enum2 != __field ## _ ## NOT_SET ? \
216 __enum2 : __field ## _ ## __default )) == __field ## _ ## YES)
217
218#define ENUM_BOOL(__enum1, __field) \
219 (__enum1 == ( __field ## _ ## YES ))
220
221/*!
222 * \brief Common config copy utilities
223 *
224 * These macros are designed to be called from as_copy_cfg_common
225 * and vs_copy_cfg_common only. They'll only copy a field if the
226 * field contains a vaild value. Thus a NOT_SET value in the source
227 * won't override a pre-existing good value in the dest. A good
228 * value in the source WILL overwrite a good value in the dest.
229 *
230 */
231#define cfg_stringfield_copy(__cfg_dst, __cfg_src, __field) \
232({ \
233 int __res = 0; \
234 if (!ast_strlen_zero(__cfg_src->__field)) { \
235 __res = ast_string_field_set(__cfg_dst, __field, __cfg_src->__field); \
236 } \
237 __res; \
238})
239
240/*!
241 * \brief cfg_copy_wrapper
242 *
243 * Invoke cfg_stringfield_copy and cause the calling runction to
244 * return a -1 of the copy fails.
245 */
246#define cfg_sf_copy_wrapper(id, __cfg_dst, __cfg_src, __field) \
247{ \
248 int rc = cfg_stringfield_copy(__cfg_dst, __cfg_src, __field); \
249 if (rc != 0) { \
250 ast_log(LOG_ERROR, "%s: Unable to copy field %s from %s to %s\n", \
251 id, #__field, #__cfg_src, #__cfg_dst); \
252 return -1; \
253 } \
254}
255
256/*!
257 * \brief cfg_uint_copy
258 *
259 * Copy a uint from the source to the dest only if the source > 0.
260 * For stir-shaken, 0 isn't a valid value for any uint fields.
261 */
262#define cfg_uint_copy(__cfg_dst, __cfg_src, __field) \
263({ \
264 if (__cfg_src->__field > 0) { \
265 __cfg_dst->__field = __cfg_src->__field; \
266 } \
267})
268
269/*!
270 * \brief cfg_enum_copy
271 *
272 * Copy an enum from the source to the dest only if the source is
273 * neither NOT_SET nor UNKNOWN
274 */
275#define cfg_enum_copy_ex(__cfg_dst, __cfg_src, __field, __not_set, __unknown) \
276({ \
277 if (__cfg_src->__field != __not_set \
278 && __cfg_src->__field != __unknown) { \
279 __cfg_dst->__field = __cfg_src->__field; \
280 } \
281})
282
283#define cfg_enum_copy(__cfg_dst, __cfg_src, __field) \
284 cfg_enum_copy_ex(__cfg_dst, __cfg_src, __field, __field ## _NOT_SET, __field ## _UNKNOWN)
285
286
287/*!
288 * \brief Attestation Service configuration for stir/shaken
289 *
290 * The common structure also appears in profile_cfg.
291 */
296 );
297 enum attest_level_enum attest_level;
298 enum check_tn_cert_public_url_enum check_tn_cert_public_url;
299 enum send_mky_enum send_mky;
300 unsigned char *raw_key;
302};
303
304#define generate_acfg_common_sorcery_handlers(object) \
305 generate_sorcery_enum_from_str(object, acfg_common., check_tn_cert_public_url, UNKNOWN); \
306 generate_sorcery_enum_to_str(object, acfg_common., check_tn_cert_public_url); \
307 generate_sorcery_enum_from_str(object, acfg_common., send_mky, UNKNOWN); \
308 generate_sorcery_enum_to_str(object, acfg_common., send_mky); \
309 generate_sorcery_enum_from_str(object, acfg_common., attest_level, UNKNOWN); \
310 generate_sorcery_enum_to_str(object, acfg_common., attest_level);
311
312int as_check_common_config(const char *id,
313 struct attestation_cfg_common *acfg_common);
314
315int as_copy_cfg_common(const char *id, struct attestation_cfg_common *cfg_dst,
316 struct attestation_cfg_common *cfg_src);
317
318void acfg_cleanup(struct attestation_cfg_common *cfg);
319
322 /*
323 * We need an empty AST_DECLARE_STRING_FIELDS() here
324 * because when STRFLDSET is used with sorcery, the
325 * memory for all sub-structures that have stringfields
326 * is allocated from the parent's stringfield pool.
327 */
330 enum attest_level_enum unknown_tn_attest_level;
332};
333
334struct attestation_cfg *as_get_cfg(void);
335int as_is_config_loaded(void);
336int as_config_load(void);
337int as_config_reload(void);
338int as_config_unload(void);
339
340/*!
341 * \brief Verification Service configuration for stir/shaken
342 *
343 * The common structure also appears in profile_cfg.
344 */
354 );
355 unsigned int curl_timeout;
356 unsigned int max_iat_age;
359 unsigned int max_cache_size;
362 enum use_rfc9410_responses_enum use_rfc9410_responses;
363 enum relax_x5u_port_scheme_restrictions_enum
365 enum relax_x5u_path_restrictions_enum
367 enum load_system_certs_enum load_system_certs;
368
371};
372
373#define generate_vcfg_common_sorcery_handlers(object) \
374 generate_sorcery_enum_from_str(object, vcfg_common.,use_rfc9410_responses, UNKNOWN); \
375 generate_sorcery_enum_to_str(object, vcfg_common.,use_rfc9410_responses); \
376 generate_sorcery_enum_from_str(object, vcfg_common.,stir_shaken_failure_action, UNKNOWN); \
377 generate_sorcery_enum_to_str(object, vcfg_common.,stir_shaken_failure_action); \
378 generate_sorcery_enum_from_str(object, vcfg_common.,relax_x5u_port_scheme_restrictions, UNKNOWN); \
379 generate_sorcery_enum_to_str(object, vcfg_common.,relax_x5u_port_scheme_restrictions); \
380 generate_sorcery_enum_from_str(object, vcfg_common.,relax_x5u_path_restrictions, UNKNOWN); \
381 generate_sorcery_enum_to_str(object, vcfg_common.,relax_x5u_path_restrictions); \
382 generate_sorcery_enum_from_str(object, vcfg_common.,load_system_certs, UNKNOWN); \
383 generate_sorcery_enum_to_str(object, vcfg_common.,load_system_certs); \
384 generate_sorcery_acl_from_str(object, acl, NULL); \
385 generate_sorcery_acl_to_str(object, acl);
386
387int vs_check_common_config(const char *id,
388 struct verification_cfg_common *vcfg_common);
389
390int vs_copy_cfg_common(const char *id, struct verification_cfg_common *cfg_dst,
391 struct verification_cfg_common *cfg_src);
392
393void vcfg_cleanup(struct verification_cfg_common *cfg);
394
397 /*
398 * We need an empty AST_DECLARE_STRING_FIELDS() here
399 * because when STRFLDSET is used with sorcery, the
400 * memory for all sub-structures that have stringfields
401 * is allocated from the parent's stringfield pool.
402 */
406};
407
408struct verification_cfg *vs_get_cfg(void);
409int vs_is_config_loaded(void);
410int vs_config_load(void);
411int vs_config_reload(void);
412int vs_config_unload(void);
413
414/*!
415 * \brief Profile configuration for stir/shaken
416 */
419 /*
420 * We need an empty AST_DECLARE_STRING_FIELDS() here
421 * because when STRFLDSET is used with sorcery, the
422 * memory for all sub-structures that have stringfields
423 * is allocated from the parent's stringfield pool.
424 */
428 enum endpoint_behavior_enum endpoint_behavior;
429 enum attest_level_enum unknown_tn_attest_level;
431};
432
433struct profile_cfg *profile_get_cfg(const char *id);
434struct ao2_container *profile_get_all(void);
435struct profile_cfg *eprofile_get_cfg(const char *id);
436struct ao2_container *eprofile_get_all(void);
437int profile_load(void);
438int profile_reload(void);
439int profile_unload(void);
440
441#define PROFILE_ALLOW_ATTEST(__profile) \
442 (__profile->endpoint_behavior == endpoint_behavior_ON || \
443 __profile->endpoint_behavior == endpoint_behavior_ATTEST)
444
445#define PROFILE_ALLOW_VERIFY(__profile) \
446 (__profile->endpoint_behavior == endpoint_behavior_ON || \
447 __profile->endpoint_behavior == endpoint_behavior_VERIFY)
448
449/*!
450 * \brief TN configuration for stir/shaken
451 *
452 * TN-specific attestation_cfg.
453 */
454
455struct tn_cfg {
457 /*
458 * We need an empty AST_DECLARE_STRING_FIELDS() here
459 * because when STRFLDSET is used with sorcery, the
460 * memory for all sub-structures that have stringfields
461 * is allocated from the parent's stringfield pool.
462 */
465};
466
467struct tn_cfg *tn_get_cfg(const char *tn);
468struct tn_cfg *tn_get_etn(const char *tn,
469 struct profile_cfg *eprofile);
470int tn_config_load(void);
471int tn_config_reload(void);
472int tn_config_unload(void);
473
474/*!
475 * \brief Sorcery fields register helpers
476 *
477 * Most of the fields on attestation_cfg and verification_cfg are also
478 * in profile_cfg. To prevent having to maintain duplicate sets of
479 * sorcery register statements, we can do this once here and call
480 * register_common_verification_fields() from both profile_config and
481 * verification_config and call register_common_attestation_fields()
482 * from profile_cfg and attestation_config.
483 *
484 * Most of the fields in question are in sub-structures like
485 * verification_cfg.vcfg_common which is why there are separate name
486 * and field parameters. For verification_cfg.vcfg_common.ca_file
487 * for instance, name would be ca_file and field would be
488 * vcfg_common.ca_file.
489 *
490 *\note These macros depend on default values being defined
491 * in the 4 _config.c files as DEFAULT_<field_name>.
492 *
493 */
494#define stringfield_option_register(sorcery, CONFIG_TYPE, object, name, field, nodoc) \
495 ast_sorcery_object_field_register ## nodoc(sorcery, CONFIG_TYPE, #name, \
496 DEFAULT_ ## name, OPT_STRINGFIELD_T, 0, \
497 STRFLDSET(struct object, field))
498
499#define uint_option_register(sorcery, CONFIG_TYPE, object, name, field, nodoc) \
500 ast_sorcery_object_field_register ## nodoc(sorcery, CONFIG_TYPE, #name, \
501 __stringify(DEFAULT_ ## name), OPT_UINT_T, 0, \
502 FLDSET(struct object, field))
503
504#define enum_option_register_ex(sorcery, CONFIG_TYPE, name, field, function_prefix, nodoc) \
505 ast_sorcery_object_field_register_custom ## nodoc(sorcery, CONFIG_TYPE, \
506 #name, function_prefix ## _to_str(DEFAULT_ ## field), \
507 sorcery_ ## field ## _from_str, sorcery_ ## field ## _to_str, NULL, 0, 0)
508
509#define enum_option_register(sorcery, CONFIG_TYPE, name, nodoc) \
510 enum_option_register_ex(sorcery, CONFIG_TYPE, name, name, name, nodoc)
511
512#define register_common_verification_fields(sorcery, object, CONFIG_TYPE, nodoc) \
513({ \
514 stringfield_option_register(sorcery, CONFIG_TYPE, object, ca_file, vcfg_common.ca_file, nodoc); \
515 stringfield_option_register(sorcery, CONFIG_TYPE, object, ca_path, vcfg_common.ca_path, nodoc); \
516 stringfield_option_register(sorcery, CONFIG_TYPE, object, crl_file, vcfg_common.crl_file, nodoc); \
517 stringfield_option_register(sorcery, CONFIG_TYPE, object, crl_path, vcfg_common.crl_path, nodoc); \
518 stringfield_option_register(sorcery, CONFIG_TYPE, object, untrusted_cert_file, vcfg_common.untrusted_cert_file, nodoc); \
519 stringfield_option_register(sorcery, CONFIG_TYPE, object, untrusted_cert_path, vcfg_common.untrusted_cert_path, nodoc); \
520 stringfield_option_register(sorcery, CONFIG_TYPE, object, cert_cache_dir, vcfg_common.cert_cache_dir, nodoc); \
521\
522 uint_option_register(sorcery, CONFIG_TYPE, object, curl_timeout, vcfg_common.curl_timeout, nodoc);\
523 uint_option_register(sorcery, CONFIG_TYPE, object, max_iat_age, vcfg_common.max_iat_age, nodoc);\
524 uint_option_register(sorcery, CONFIG_TYPE, object, max_date_header_age, vcfg_common.max_date_header_age, nodoc);\
525 uint_option_register(sorcery, CONFIG_TYPE, object, max_cache_entry_age, vcfg_common.max_cache_entry_age, nodoc);\
526 uint_option_register(sorcery, CONFIG_TYPE, object, max_cache_size, vcfg_common.max_cache_size, nodoc);\
527\
528 enum_option_register_ex(sorcery, CONFIG_TYPE, failure_action, stir_shaken_failure_action, stir_shaken_failure_action, nodoc); \
529 enum_option_register(sorcery, CONFIG_TYPE, use_rfc9410_responses, nodoc); \
530 enum_option_register(sorcery, CONFIG_TYPE, \
531 relax_x5u_port_scheme_restrictions, nodoc); \
532 enum_option_register(sorcery, CONFIG_TYPE, \
533 relax_x5u_path_restrictions, nodoc); \
534 enum_option_register(sorcery, CONFIG_TYPE, \
535 load_system_certs, nodoc); \
536\
537 ast_sorcery_object_field_register_custom ## nodoc(sorcery, CONFIG_TYPE, "x5u_deny", "", sorcery_acl_from_str, NULL, NULL, 0, 0); \
538 ast_sorcery_object_field_register_custom ## nodoc(sorcery, CONFIG_TYPE, "x5u_permit", "", sorcery_acl_from_str, NULL, NULL, 0, 0); \
539 ast_sorcery_object_field_register_custom ## nodoc(sorcery, CONFIG_TYPE, "x5u_acl", "", sorcery_acl_from_str, sorcery_acl_to_str, NULL, 0, 0); \
540})
541
542#define register_common_attestation_fields(sorcery, object, CONFIG_TYPE, nodoc) \
543({ \
544 stringfield_option_register(sorcery, CONFIG_TYPE, object, private_key_file, acfg_common.private_key_file, nodoc); \
545 stringfield_option_register(sorcery, CONFIG_TYPE, object, public_cert_url, acfg_common.public_cert_url, nodoc); \
546 enum_option_register(sorcery, CONFIG_TYPE, attest_level, nodoc); \
547 enum_option_register(sorcery, CONFIG_TYPE, check_tn_cert_public_url, nodoc); \
548 enum_option_register(sorcery, CONFIG_TYPE, send_mky, nodoc); \
549})
550
551int common_config_load(void);
552int common_config_unload(void);
553int common_config_reload(void);
554
560};
561
563 const char *title;
565};
566
567/*!
568 * \brief Output configuration settings to the Asterisk CLI
569 *
570 * \param obj A sorcery object containing configuration data
571 * \param arg Asterisk CLI argument object
572 * \param flags ao2 container flags
573 *
574 * \retval 0
575 */
576int config_object_cli_show(void *obj, void *arg, void *data, int flags);
577
578/*!
579 * \brief Tab completion for name matching with STIR/SHAKEN CLI commands
580 *
581 * \param word The word to tab complete on
582 * \param container The sorcery container to iterate through
583 *
584 * \retval The tab completion options
585 */
587
588/*!
589 * \brief Canonicalize a TN
590 *
591 * \param tn TN to canonicalize
592 * \param dest_tn Pointer to destination buffer to receive the new TN
593 *
594 * \retval dest_tn or NULL on failure
595 */
596char *canonicalize_tn(const char *tn, char *dest_tn);
597
598/*!
599 * \brief Canonicalize a TN into nre buffer
600 *
601 * \param tn TN to canonicalize
602 *
603 * \retval dest_tn (which must be freed with ast_free) or NULL on failure
604 */
605char *canonicalize_tn_alloc(const char *tn);
606
607#endif /* COMMON_CONFIG_H_ */
Asterisk main include file. File version handling, generic pbx functions.
short word
int as_config_unload(void)
int as_config_reload(void)
config_object_type
@ config_object_type_attestation
@ config_object_type_tn
@ config_object_type_profile
@ config_object_type_verification
int vs_config_reload(void)
int config_object_cli_show(void *obj, void *arg, void *data, int flags)
Output configuration settings to the Asterisk CLI.
char * config_object_tab_complete_name(const char *word, struct ao2_container *container)
Tab completion for name matching with STIR/SHAKEN CLI commands.
int common_config_unload(void)
struct ast_acl_list * get_default_acl_list(void)
#define generate_enum_string_prototypes(param_name,...)
Enum field to/from string prototype generator.
Definition: common_config.h:94
int profile_unload(void)
int common_config_reload(void)
struct attestation_cfg * as_get_cfg(void)
int profile_load(void)
int vs_is_config_loaded(void)
char * canonicalize_tn_alloc(const char *tn)
Canonicalize a TN into nre buffer.
int common_config_load(void)
int tn_config_load(void)
Definition: tn_config.c:268
struct tn_cfg * tn_get_cfg(const char *tn)
Definition: tn_config.c:39
const char * unknown_tn_attest_level_to_str(enum attest_level_enum value)
struct verification_cfg * vs_get_cfg(void)
struct profile_cfg * eprofile_get_cfg(const char *id)
int tn_config_unload(void)
Definition: tn_config.c:260
int as_check_common_config(const char *id, struct attestation_cfg_common *acfg_common)
struct ao2_container * eprofile_get_all(void)
struct profile_cfg * profile_get_cfg(const char *id)
struct ao2_container * profile_get_all(void)
int as_config_load(void)
char * canonicalize_tn(const char *tn, char *dest_tn)
Canonicalize a TN.
int vs_copy_cfg_common(const char *id, struct verification_cfg_common *cfg_dst, struct verification_cfg_common *cfg_src)
int as_is_config_loaded(void)
int vs_config_load(void)
int tn_config_reload(void)
Definition: tn_config.c:253
int profile_reload(void)
enum attest_level_enum unknown_tn_attest_level_from_str(const char *value)
struct tn_cfg * tn_get_etn(const char *tn, struct profile_cfg *eprofile)
Definition: tn_config.c:111
int as_copy_cfg_common(const char *id, struct attestation_cfg_common *cfg_dst, struct attestation_cfg_common *cfg_src)
int vs_config_unload(void)
enum stir_shaken_failure_action_enum stir_shaken_failure_action_from_str(const char *action_str)
#define generate_bool_string_prototypes(param_name)
Boolean field to/from string prototype generator.
Definition: common_config.h:60
int vs_check_common_config(const char *id, struct verification_cfg_common *vcfg_common)
void vcfg_cleanup(struct verification_cfg_common *cfg)
void acfg_cleanup(struct attestation_cfg_common *cfg)
const char * stir_shaken_failure_action_to_str(enum stir_shaken_failure_action_enum action)
Asterisk file paths, configured in asterisk.conf.
struct ao2_container * container
Definition: res_fax.c:501
stir_shaken_failure_action_enum
Sorcery Data Access Layer API.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Definition: stringfields.h:341
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:303
Generic container type.
Wrapper for an ast_acl linked list.
Definition: acl.h:76
Attestation Service configuration for stir/shaken.
enum check_tn_cert_public_url_enum check_tn_cert_public_url
enum attest_level_enum attest_level
unsigned char * raw_key
const ast_string_field public_cert_url
const ast_string_field private_key_file
enum send_mky_enum send_mky
SORCERY_OBJECT(details)
struct attestation_cfg_common acfg_common
enum attest_level_enum unknown_tn_attest_level
enum config_object_type object_type
ao2 object wrapper for X509_STORE that provides locking and refcounting
Definition: crypto_utils.h:179
Profile configuration for stir/shaken.
SORCERY_OBJECT(details)
enum endpoint_behavior_enum endpoint_behavior
struct attestation_cfg_common acfg_common
struct profile_cfg * eprofile
enum attest_level_enum unknown_tn_attest_level
struct verification_cfg_common vcfg_common
TN configuration for stir/shaken.
SORCERY_OBJECT(details)
struct attestation_cfg_common acfg_common
Verification Service configuration for stir/shaken.
struct crypto_cert_store * tcs
unsigned int max_cache_size
enum stir_shaken_failure_action_enum stir_shaken_failure_action
enum use_rfc9410_responses_enum use_rfc9410_responses
const ast_string_field cert_cache_dir
const ast_string_field ca_path
enum relax_x5u_path_restrictions_enum relax_x5u_path_restrictions
const ast_string_field crl_file
const ast_string_field crl_path
enum load_system_certs_enum load_system_certs
const ast_string_field ca_file
enum relax_x5u_port_scheme_restrictions_enum relax_x5u_port_scheme_restrictions
unsigned int max_date_header_age
const ast_string_field untrusted_cert_file
struct ast_acl_list * acl
const ast_string_field untrusted_cert_path
unsigned int max_cache_entry_age
SORCERY_OBJECT(details)
struct verification_cfg_common vcfg_common
int value
Definition: syslog.c:37