mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user