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:
Terry Wilson
2010-07-21 19:11:32 +00:00
parent 318798e932
commit d6e1c724e5
14 changed files with 95 additions and 2312 deletions

View File

@@ -22,6 +22,9 @@
* \ingroup functions
*/
/*** MODULEINFO
<use>crypto</use>
***/
#include "asterisk.h"
@@ -30,7 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/aes.h"
#include "asterisk/crypto.h"
#define AES_BLOCK_SIZE 16
@@ -97,8 +100,8 @@ static int aes_helper(struct ast_channel *chan, const char *cmd, char *data,
return -1;
}
ast_aes_encrypt_key((unsigned char *) args.key, &ecx); /* encryption: plaintext -> encryptedtext -> base64 */
ast_aes_decrypt_key((unsigned char *) args.key, &dcx); /* decryption: base64 -> encryptedtext -> plaintext */
ast_aes_set_encrypt_key((unsigned char *) args.key, &ecx); /* encryption: plaintext -> encryptedtext -> base64 */
ast_aes_set_decrypt_key((unsigned char *) args.key, &dcx); /* decryption: base64 -> encryptedtext -> plaintext */
tmp = ast_calloc(1, len); /* requires a tmp buffer for the base64 decode */
tmpP = tmp;
encrypt = strcmp("AES_DECRYPT", cmd); /* -1 if encrypting, 0 if decrypting */