18 #ifndef _CRYPTO_UTILS_H
19 #define _CRYPTO_UTILS_H
21 #include "openssl/x509.h"
22 #include "openssl/x509_vfy.h"
37 void crypto_log_openssl(
int level,
char *file,
int line,
38 const char *
function,
const char *fmt, ...)
39 __attribute__((format(printf, 5, 6)));
51 int crypto_register_x509_extension(const
char *oid,
52 const
char *short_name, const
char *long_name);
73 ASN1_OCTET_STRING *crypto_get_cert_extension_data(X509 *cert,
int nid,
74 const
char *short_name);
83 X509 *crypto_load_cert_from_file(const
char *filename);
93 EVP_PKEY *crypto_load_private_key_from_memory(const
char *buffer,
size_t size);
107 int crypto_has_private_key_from_memory(const
char *buffer,
size_t size);
118 X509 *crypto_load_cert_from_memory(const
char *buffer,
size_t size);
130 int crypto_get_raw_pubkey_from_cert(X509 *cert,
131 unsigned char **raw_key);
144 int crypto_extract_raw_pubkey(EVP_PKEY *key,
unsigned char **buffer);
156 int crypto_extract_raw_privkey(EVP_PKEY *key,
unsigned char **buffer);
165 EVP_PKEY *crypto_load_privkey_from_file(const
char *filename);
180 #define crypto_free_cert_store(store) ao2_cleanup(store)
222 #define crypto_lock_cert_store(store) ao2_lock(store)
232 #define crypto_unlock_cert_store(store) ao2_unlock(store)
243 int crypto_is_cert_time_valid(X509 *cert, time_t reftime);
255 int crypto_is_cert_trusted(
struct crypto_cert_store *store, X509 *cert,
const char **err_msg);
264 time_t crypto_asn_time_as_time_t(ASN1_TIME *at);
275 char *crypto_get_cert_subject(X509 *cert,
const char *short_name);
285 int crypto_unload(
void);
Asterisk main include file. File version handling, generic pbx functions.
ao2 object wrapper for X509_STORE that provides locking and refcounting
Support for logging to various files, console and syslog Configuration in file logger.conf.
static void crypto_load(int ifd, int ofd)
refresh RSA keys from file