--- include/asterisk/crypto.h (Asterisk 13.21) +++ include/asterisk/crypto.h (working copy) @@ -31,18 +31,12 @@ #include "asterisk/logger.h" -#ifdef HAVE_CRYPTO -#include "openssl/aes.h" -typedef AES_KEY ast_aes_encrypt_key; -typedef AES_KEY ast_aes_decrypt_key; -#else /* !HAVE_CRYPTO */ -typedef char ast_aes_encrypt_key; -typedef char ast_aes_decrypt_key; -#endif /* HAVE_CRYPTO */ +struct ast_key; +struct aes_key_st; +typedef struct aes_key_st ast_aes_encrypt_key; +typedef struct aes_key_st ast_aes_decrypt_key; #define AST_KEY_PUBLIC (1 << 0) #define AST_KEY_PRIVATE (1 << 1) -struct ast_key; - /*! * \brief Retrieve a key --- channels/iax2/include/parser.h (Asterisk 13.21) +++ channels/iax2/include/parser.h (working copy) @@ -133 +133 @@ - ast_aes_encrypt_key ecx; + ast_aes_encrypt_key *ecx; @@ -135 +135 @@ - ast_aes_decrypt_key mydcx; + ast_aes_decrypt_key *mydcx; --- channels/chan_iax2.c (Asterisk 13.21) +++ channels/chan_iax2.c (working copy) @@ -826 +826 @@ - ast_aes_encrypt_key ecx; + ast_aes_encrypt_key *ecx; @@ -828 +828 @@ - ast_aes_decrypt_key mydcx; + ast_aes_decrypt_key *mydcx; @@ -830 +830 @@ - ast_aes_decrypt_key dcx; + ast_aes_decrypt_key *dcx; @@ -853 +853 @@ - ast_aes_encrypt_key tdcx; + ast_aes_encrypt_key *tdcx; @@ -3548 +3548 @@ - decode_frame(&f->mydcx, fh, &af, &f->datalen); + decode_frame(f->mydcx, fh, &af, &f->datalen); @@ -3561 +3561 @@ - encrypt_frame(&f->ecx, fh, f->semirand, &f->datalen); + encrypt_frame(f->ecx, fh, f->semirand, &f->datalen); @@ -6378 +6378 @@ - ast_aes_set_decrypt_key(digest, &pvt->dcx); + ast_aes_set_decrypt_key(digest, pvt->dcx); @@ -6387,2 +6387,2 @@ - ast_aes_set_encrypt_key(digest, &pvt->ecx); - ast_aes_set_decrypt_key(digest, &pvt->mydcx); + ast_aes_set_encrypt_key(digest, pvt->ecx); + ast_aes_set_decrypt_key(digest, pvt->mydcx); @@ -6542 +6542 @@ - res = decode_frame(&iaxs[callno]->dcx, fh, f, datalen); + res = decode_frame(iaxs[callno]->dcx, fh, f, datalen); @@ -6549 +6549 @@ - res = decode_frame(&iaxs[callno]->dcx, fh, f, datalen); + res = decode_frame(iaxs[callno]->dcx, fh, f, datalen); @@ -6713 +6713 @@ - encrypt_frame(&pvt->ecx, fh, pvt->semirand, &fr->datalen); + encrypt_frame(pvt->ecx, fh, pvt->semirand, &fr->datalen); @@ -6757 +6757 @@ - encrypt_frame(&pvt->ecx, (struct ast_iax2_full_hdr *)mh, pvt->semirand, &fr->datalen); + encrypt_frame(pvt->ecx, (struct ast_iax2_full_hdr *)mh, pvt->semirand, &fr->datalen); @@ -11734 +11734 @@ - ast_aes_set_decrypt_key((unsigned char *) ies.challenge, &iaxs[fr->callno]->dcx); + ast_aes_set_decrypt_key((unsigned char *) ies.challenge, iaxs[fr->callno]->dcx); --- pbx/pbx_dundi.c (Asterisk 13.21) +++ pbx/pbx_dundi.c (working copy) @@ -252,2 +252,2 @@ - ast_aes_encrypt_key ecx; /*!< AES 128 Encryption context */ - ast_aes_decrypt_key dcx; /*!< AES 128 Decryption context */ + ast_aes_encrypt_key *ecx; /*!< AES 128 Encryption context */ + ast_aes_decrypt_key *dcx; /*!< AES 128 Decryption context */ @@ -319,2 +319,2 @@ - ast_aes_encrypt_key us_ecx; /*!< Cached AES 128 Encryption context */ - ast_aes_decrypt_key us_dcx; /*!< Cached AES 128 Decryption context */ + ast_aes_encrypt_key *us_ecx; /*!< Cached AES 128 Encryption context */ + ast_aes_decrypt_key *us_dcx; /*!< Cached AES 128 Decryption context */ @@ -322,2 +322,2 @@ - ast_aes_encrypt_key them_ecx; /*!< Cached AES 128 Encryption context */ - ast_aes_decrypt_key them_dcx; /*!< Cached AES 128 Decryption context */ + ast_aes_encrypt_key *them_ecx; /*!< Cached AES 128 Encryption context */ + ast_aes_decrypt_key *them_dcx; /*!< Cached AES 128 Decryption context */ @@ -1336,2 +1336,2 @@ - ast_aes_set_encrypt_key(key, &peer->us_ecx); - ast_aes_set_decrypt_key(key, &peer->us_dcx); + ast_aes_set_encrypt_key(key, peer->us_ecx); + ast_aes_set_decrypt_key(key, peer->us_dcx); @@ -1407 +1407 @@ - decrypt_memcpy(decrypt_space, src->encdata, srclen, src->iv, &trans->dcx); + decrypt_memcpy(decrypt_space, src->encdata, srclen, src->iv, trans->dcx); @@ -1475 +1475 @@ - encrypt_memcpy(ied.buf + ied.pos, compress_space, bytes, iv, &trans->ecx); + encrypt_memcpy(ied.buf + ied.pos, compress_space, bytes, iv, trans->ecx); @@ -1534,2 +1534,2 @@ - ast_aes_set_decrypt_key(dst, &peer->them_dcx); - ast_aes_set_encrypt_key(dst, &peer->them_ecx); + ast_aes_set_decrypt_key(dst, peer->them_dcx); + ast_aes_set_encrypt_key(dst, peer->them_ecx); --- funcs/func_aes.c (Asterisk 13.21) +++ funcs/func_aes.c (working copy) @@ -94,2 +94,2 @@ - ast_aes_encrypt_key ecx; /* AES 128 Encryption context */ - ast_aes_decrypt_key dcx; + ast_aes_encrypt_key *ecx = NULL; /* AES 128 Encryption context */ + ast_aes_decrypt_key *dcx = NULL; @@ -114,2 +114,2 @@ - 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 */ + 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 */ @@ -140 +140 @@ - ast_aes_encrypt(curblock, (unsigned char *) tmpP, &ecx); + ast_aes_encrypt(curblock, (unsigned char *) tmpP, ecx); @@ -142 +142 @@ - ast_aes_decrypt(curblock, (unsigned char *) tmpP, &dcx); + ast_aes_decrypt(curblock, (unsigned char *) tmpP, dcx);