diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-21 19:11:32 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-21 19:11:32 +0000 |
commit | 15f42844eff69ae1f2576497c2653a7423f42395 (patch) | |
tree | 702c8203da791c3e168d1a0ef5d07dbafea3dd54 /res | |
parent | fe09035019d8f513addec09466170dfc180a1de3 (diff) |
Remove built-in AES code and use optional_api instead
Review: https://reviewboard.asterisk.org/r/793/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_crypto.c | 21 | ||||
-rw-r--r-- | res/res_crypto.exports.in | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index cb87eeec3..e7793a6aa 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -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 diff --git a/res/res_crypto.exports.in b/res/res_crypto.exports.in index 4f5832e77..d7200b50f 100644 --- a/res/res_crypto.exports.in +++ b/res/res_crypto.exports.in @@ -8,6 +8,10 @@ LINKER_SYMBOL_PREFIX*ast_key_get; LINKER_SYMBOL_PREFIX*ast_sign; LINKER_SYMBOL_PREFIX*ast_sign_bin; + LINKER_SYMBOL_PREFIX*ast_aes_encrypt; + LINKER_SYMBOL_PREFIX*ast_aes_decrypt; + LINKER_SYMBOL_PREFIX*ast_aes_set_encrypt_key; + LINKER_SYMBOL_PREFIX*ast_aes_set_decrypt_key; local: *; }; |