res_stir_shaken: Initial commit and reading private key.

This commit sets up some of the initial framework for the module and
adds a way to read the private key from the specified file, which will
then be appended to the certificate object. This works fine for now, but
eventually some other structure will likely need to be used to store all
this information. Similarly, the caller_id_number is specified on the
certificate config object, but in the end we will want that information
to be tied to the certificate itself and read it from there.

A method has been added that will retrieve the private key associated
with the caller_id_number passed in. Tab completion for certificates and
stores has also been added.

Change-Id: Ic4bc1416fab5d6afe15a8e2d32f7ddd4e023295f
This commit is contained in:
Ben Ford
2020-03-23 15:00:09 -05:00
committed by George Joseph
parent 7a64868118
commit 716e51a3f3
12 changed files with 1270 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2020, Sangoma Technologies Corporation
*
* Kevin Harwell <kharwell@sangoma.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
#ifndef _RES_STIR_SHAKEN_H
#define _RES_STIR_SHAKEN_H
#include <openssl/evp.h>
#include <openssl/pem.h>
/*!
* \brief Retrieve the stir/shaken sorcery context
*
* \retval The stir/shaken sorcery context
*/
struct ast_sorcery *ast_stir_shaken_sorcery(void);
/*!
* \brief Get the private key associated with a caller id
*
* \param caller_id_number The caller id used to look up the private key
*
* \retval The private key
*/
EVP_PKEY *ast_stir_shaken_get_private_key(const char *caller_id_number);
#endif /* _RES_STIR_SHAKEN_H */