mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
During OpenSIPit, we found out that the public certificates must be of type X.509. When reading in public keys, we use the corresponding X.509 functions now. We also discovered that we needed a better naming scheme for the certificates since certificates with the same name would cause issues (overwriting certs, etc.). Now when we download a public certificate, we get the serial number from it and use that as the name of the cached certificate. The configuration option public_key_url in stir_shaken.conf has also been renamed to public_cert_url, which better describes what the option is for. https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021 Change-Id: Ia00b20835f5f976e3603797f2f2fb19672d8114d
68 lines
1.9 KiB
C
68 lines
1.9 KiB
C
/*
|
|
* 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 _STIR_SHAKEN_H
|
|
#define _STIR_SHAKEN_H
|
|
|
|
#include <openssl/evp.h>
|
|
|
|
/*!
|
|
* \brief Output configuration settings to the Asterisk CLI
|
|
*
|
|
* \param obj A sorcery object containing configuration data
|
|
* \param arg Asterisk CLI argument object
|
|
* \param flags ao2 container flags
|
|
*
|
|
* \retval 0
|
|
*/
|
|
int stir_shaken_cli_show(void *obj, void *arg, int flags);
|
|
|
|
/*!
|
|
* \brief Tab completion for name matching with STIR/SHAKEN CLI commands
|
|
*
|
|
* \param word The word to tab complete on
|
|
* \param container The sorcery container to iterate through
|
|
*
|
|
* \retval The tab completion options
|
|
*/
|
|
char *stir_shaken_tab_complete_name(const char *word, struct ao2_container *container);
|
|
|
|
/*!
|
|
* \brief Reads the public (or private) key from the specified path
|
|
*
|
|
* \param path The path to the file containing the private key
|
|
* \param priv Specify 0 for public, 1 for private
|
|
*
|
|
* \retval NULL on failure
|
|
* \retval The public/private key on success
|
|
*/
|
|
EVP_PKEY *stir_shaken_read_key(const char *path, int priv);
|
|
|
|
/*!
|
|
* \brief Gets the serial number in hex form from the X509 certificate at path
|
|
*
|
|
* \note The returned string will need to be freed by the caller
|
|
*
|
|
* \param path The full path of the X509 certificate
|
|
*
|
|
* \retval NULL on failure
|
|
* \retval serial number on success
|
|
*/
|
|
char *stir_shaken_get_serial_number_x509(const char *path);
|
|
|
|
#endif /* _STIR_SHAKEN_H */
|