Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
stir_shaken.h File Reference
#include "asterisk/res_stir_shaken.h"
#include "common_config.h"
#include "crypto_utils.h"
#include "curl_utils.h"
#include "attestation.h"
#include "verification.h"
Include dependency graph for stir_shaken.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stir_shaken_attestation_ds
 
struct  stir_shaken_verification_ds
 
struct  trusted_cert_store
 

Macros

#define STIR_SHAKEN_ATTESTATION_DS   "STIR/SHAKEN/ATTESTATION"
 
#define STIR_SHAKEN_ENCRYPTION_ALGORITHM   "ES256"
 
#define STIR_SHAKEN_PPT   "shaken"
 
#define STIR_SHAKEN_TYPE   "passport"
 
#define STIR_SHAKEN_VERIFICATION_DS   "STIR/SHAKEN/VERIFICATION"
 

Functions

const char * as_response_code_to_str (enum ast_stir_shaken_as_response_code as_rc)
 Return string version of AS response code.
 
struct stir_shaken_attestation_dsast_stir_shaken_get_attestation_datastore (struct ast_channel *chan)
 
struct ast_sorceryget_sorcery (void)
 Retrieve the stir/shaken sorcery context.
 
int get_tn_auth_nid (void)
 Retrieves the OpenSSL NID for the TN Auth list extension.
 
struct trusted_cert_storeget_trusted_cert_store (void)
 Retrieves the OpenSSL trusted cert store.
 
const char * vs_response_code_to_str (enum ast_stir_shaken_vs_response_code vs_rc)
 Return string version of VS response code.
 

Macro Definition Documentation

◆ STIR_SHAKEN_ATTESTATION_DS

#define STIR_SHAKEN_ATTESTATION_DS   "STIR/SHAKEN/ATTESTATION"

Definition at line 42 of file stir_shaken.h.

◆ STIR_SHAKEN_ENCRYPTION_ALGORITHM

#define STIR_SHAKEN_ENCRYPTION_ALGORITHM   "ES256"

Definition at line 28 of file stir_shaken.h.

◆ STIR_SHAKEN_PPT

#define STIR_SHAKEN_PPT   "shaken"

Definition at line 29 of file stir_shaken.h.

◆ STIR_SHAKEN_TYPE

#define STIR_SHAKEN_TYPE   "passport"

Definition at line 30 of file stir_shaken.h.

◆ STIR_SHAKEN_VERIFICATION_DS

#define STIR_SHAKEN_VERIFICATION_DS   "STIR/SHAKEN/VERIFICATION"

Definition at line 32 of file stir_shaken.h.

Function Documentation

◆ as_response_code_to_str()

const char * as_response_code_to_str ( enum ast_stir_shaken_as_response_code  as_rc)

Return string version of AS response code.

Parameters
as_rc
Returns
Response string

Definition at line 47 of file attestation.c.

49{
50 return ARRAY_IN_BOUNDS(as_rc, as_rc_map) ?
51 as_rc_map[as_rc] : NULL;
52}
static const char * as_rc_map[]
Definition attestation.c:31
#define NULL
Definition resample.c:96
#define ARRAY_IN_BOUNDS(v, a)
Checks to see if value is within the bounds of the given array.
Definition utils.h:727

References ARRAY_IN_BOUNDS, as_rc_map, and NULL.

◆ ast_stir_shaken_get_attestation_datastore()

struct stir_shaken_attestation_ds * ast_stir_shaken_get_attestation_datastore ( struct ast_channel chan)

Definition at line 314 of file res_stir_shaken.c.

316{
317 struct stir_shaken_attestation_ds *attestation_ds;
318 struct ast_datastore *chan_datastore;
319
320 chan_datastore = ast_channel_datastore_find(chan, &attestation_ds_info, NULL);
321 if (!chan_datastore) {
322 return NULL;
323 }
324 attestation_ds = chan_datastore->data;
325 return attestation_ds;
326}
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition channel.c:2389
static const struct ast_datastore_info attestation_ds_info
Structure for a data store object.
Definition datastore.h:64
void * data
Definition datastore.h:66

References ast_channel_datastore_find(), attestation_ds_info, ast_datastore::data, and NULL.

Referenced by stir_shaken_outgoing_request().

◆ get_sorcery()

struct ast_sorcery * get_sorcery ( void  )

◆ get_tn_auth_nid()

int get_tn_auth_nid ( void  )

Retrieves the OpenSSL NID for the TN Auth list extension.

Return values
TheNID

Definition at line 44 of file res_stir_shaken.c.

45{
46 return tn_auth_list_nid;
47}
static int tn_auth_list_nid

References tn_auth_list_nid.

Referenced by check_tn_auth_list().

◆ get_trusted_cert_store()

struct trusted_cert_store * get_trusted_cert_store ( void  )

Retrieves the OpenSSL trusted cert store.

Return values
Thestore

◆ vs_response_code_to_str()

const char * vs_response_code_to_str ( enum ast_stir_shaken_vs_response_code  vs_rc)

Return string version of VS response code.

Parameters
vs_rc
Returns
Response string

Definition at line 90 of file verification.c.

92{
93 return ARRAY_IN_BOUNDS(vs_rc, vs_rc_map) ?
94 vs_rc_map[vs_rc] : NULL;
95}
static const char * vs_rc_map[]

References ARRAY_IN_BOUNDS, NULL, and vs_rc_map.

Referenced by ast_stir_shaken_vs_verify(), and func_read_verification().