mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Remove built-in AES code and use optional_api instead
Review: https://reviewboard.asterisk.org/r/793/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_KEY_DIR */
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/aes.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include "asterisk/module.h"
|
||||
@@ -453,6 +454,26 @@ int AST_OPTIONAL_API_NAME(ast_crypto_loaded)(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int AST_OPTIONAL_API_NAME(ast_aes_set_encrypt_key)(const unsigned char *key, ast_aes_encrypt_key *ctx)
|
||||
{
|
||||
return AES_set_encrypt_key(key, 128, ctx);
|
||||
}
|
||||
|
||||
int AST_OPTIONAL_API_NAME(ast_aes_set_decrypt_key)(const unsigned char *key, ast_aes_decrypt_key *ctx)
|
||||
{
|
||||
return AES_set_decrypt_key(key, 128, ctx);
|
||||
}
|
||||
|
||||
void AST_OPTIONAL_API_NAME(ast_aes_encrypt)(const unsigned char *in, unsigned char *out, const ast_aes_encrypt_key *ctx)
|
||||
{
|
||||
return AES_encrypt(in, out, ctx);
|
||||
}
|
||||
|
||||
void AST_OPTIONAL_API_NAME(ast_aes_decrypt)(const unsigned char *in, unsigned char *out, const ast_aes_decrypt_key *ctx)
|
||||
{
|
||||
return AES_decrypt(in, out, ctx);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief refresh RSA keys from file
|
||||
* \param ifd file descriptor
|
||||
|
Reference in New Issue
Block a user