Debian Codegraph @

res/res_stir_shaken/stir_shaken.h

raw symbols SCIP
1 /*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2020, Sangoma Technologies Corporation
5 *
6 * Kevin Harwell <[email protected]>
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 #ifndef _STIR_SHAKEN_H
19 #define _STIR_SHAKEN_H
20
21 #include "asterisk/res_stir_shaken.h"
22 #include "common_config.h"
23 #include "crypto_utils.h"
24 #include "curl_utils.h"
25 #include "attestation.h"
26 #include "verification.h"
27
28 #define STIR_SHAKEN_ENCRYPTION_ALGORITHM "ES256"
29 #define STIR_SHAKEN_PPT "shaken"
30 #define STIR_SHAKEN_TYPE "passport"
31
32 #define STIR_SHAKEN_VERIFICATION_DS "STIR/SHAKEN/VERIFICATION"
33 struct stir_shaken_verification_ds {
34 /*! The identitifier for the STIR/SHAKEN verification */
35 char *identity;
36 /*! The attestation value */
37 char *attestation;
38 /*! The actual verification result */
39 enum ast_stir_shaken_vs_response_code verify_result;
40 };
41
42 #define STIR_SHAKEN_ATTESTATION_DS "STIR/SHAKEN/ATTESTATION"
43 struct stir_shaken_attestation_ds {
44 /*! Whether to suppress attestation on outgoing call */
45 int suppress;
46 };
47
48 struct stir_shaken_attestation_ds *ast_stir_shaken_get_attestation_datastore(
49 struct ast_channel *chan);
50
51 /*!
52 * \brief Retrieve the stir/shaken sorcery context
53 *
54 * \retval The stir/shaken sorcery context
55 */
56 struct ast_sorcery *get_sorcery(void);
57
58
59 /*!
60 * \brief Return string version of VS response code
61 *
62 * \param vs_rc
63 * \return Response string
64 */
65 const char *vs_response_code_to_str(
66 enum ast_stir_shaken_vs_response_code vs_rc);
67
68 /*!
69 * \brief Return string version of AS response code
70 *
71 * \param as_rc
72 * \return Response string
73 */
74 const char *as_response_code_to_str(
75 enum ast_stir_shaken_as_response_code as_rc);
76
77 /*!
78 * \brief Retrieves the OpenSSL NID for the TN Auth list extension
79 * \retval The NID
80 */
81 int get_tn_auth_nid(void);
82
83 struct trusted_cert_store {
84 X509_STORE *store;
85 ast_rwlock_t store_lock;
86 };
87
88 /*!
89 * \brief Retrieves the OpenSSL trusted cert store
90 * \retval The store
91 */
92 struct trusted_cert_store *get_trusted_cert_store(void);
93
94
95 #endif /* _STIR_SHAKEN_H */