Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
stir_shaken.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2020, Sangoma Technologies Corporation
5 *
6 * Kevin Harwell <kharwell@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#ifndef _STIR_SHAKEN_H
19#define _STIR_SHAKEN_H
20
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"
34 /*! The identitifier for the STIR/SHAKEN verification */
35 char *identity;
36 /*! The attestation value */
38 /*! The actual verification result */
40};
41
42#define STIR_SHAKEN_ATTESTATION_DS "STIR/SHAKEN/ATTESTATION"
44 /*! Whether to suppress attestation on outgoing call */
46};
47
49 struct ast_channel *chan);
50
51/*!
52 * \brief Retrieve the stir/shaken sorcery context
53 *
54 * \retval The stir/shaken sorcery context
55 */
56struct 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 */
65const char *vs_response_code_to_str(
67
68/*!
69 * \brief Return string version of AS response code
70 *
71 * \param as_rc
72 * \return Response string
73 */
74const char *as_response_code_to_str(
76
77/*!
78 * \brief Retrieves the OpenSSL NID for the TN Auth list extension
79 * \retval The NID
80 */
81int get_tn_auth_nid(void);
82
87
88/*!
89 * \brief Retrieves the OpenSSL trusted cert store
90 * \retval The store
91 */
93
94
95#endif /* _STIR_SHAKEN_H */
ast_stir_shaken_as_response_code
ast_stir_shaken_vs_response_code
struct stir_shaken_attestation_ds * ast_stir_shaken_get_attestation_datastore(struct ast_channel *chan)
const char * as_response_code_to_str(enum ast_stir_shaken_as_response_code as_rc)
Return string version of AS response code.
Definition attestation.c:47
const char * vs_response_code_to_str(enum ast_stir_shaken_vs_response_code vs_rc)
Return string version of VS response code.
struct trusted_cert_store * get_trusted_cert_store(void)
Retrieves the OpenSSL trusted cert store.
struct ast_sorcery * get_sorcery(void)
Retrieve the stir/shaken sorcery context.
int get_tn_auth_nid(void)
Retrieves the OpenSSL NID for the TN Auth list extension.
Main Channel structure associated with a channel.
Structure for rwlock and tracking information.
Definition lock.h:164
Full structure for sorcery.
Definition sorcery.c:231
enum ast_stir_shaken_vs_response_code verify_result
Definition stir_shaken.h:39
X509_STORE * store
Definition stir_shaken.h:84
ast_rwlock_t store_lock
Definition stir_shaken.h:85