aboutsummaryrefslogtreecommitdiffstats
path: root/channels/iax2-parser.h
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-11 17:34:57 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-11 17:34:57 +0000
commit5e031dc5f964a59ef9a326a294269bdd598d5b5e (patch)
tree3df6f2398dc52be55e41a9427e8d6ed7339944cd /channels/iax2-parser.h
parent028ef32ff9d9cc5925274c48d4f3282b482c8aa6 (diff)
Merged revisions 181340 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r181340 | dvossel | 2009-03-11 12:25:31 -0500 (Wed, 11 Mar 2009) | 11 lines encrypted IAX2 during packet loss causes decryption to fail on retransmitted frames If an iax channel is encrypted, and a retransmit frame is sent, that packet's iseqno is updated while it is encrypted. This causes the entire frame to be corrupted. When the corrupted frame is sent, the other side decrypts it and sends a VNAK back because the decrypted frame doesn't make any sense. When we get the VNAK, we look through the sent queue and send the same corrupted frame causing a loop. To fix this, encrypted frames requiring retransmission are decrypted, updated, then re-encrypted. Since key-rotation may change the key held by the pvt struct, the keys used for encryption/decryption are held within the iax_frame to guarantee they remain correct. (closes issue #14607) Reported by: stevenla Tested by: dvossel Review: http://reviewboard.digium.com/r/192/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181371 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-parser.h')
-rw-r--r--channels/iax2-parser.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/channels/iax2-parser.h b/channels/iax2-parser.h
index e40669d3d..e75cd4209 100644
--- a/channels/iax2-parser.h
+++ b/channels/iax2-parser.h
@@ -19,6 +19,7 @@
#define _IAX2_PARSER_H
#include "asterisk/linkedlists.h"
+#include "asterisk/aes.h"
struct iax_ies {
char *called_number;
@@ -89,41 +90,49 @@ struct iax_frame {
int sockfd;
#endif
- /* /Our/ call number */
+ /*! /Our/ call number */
unsigned short callno;
- /* /Their/ call number */
+ /*! /Their/ call number */
unsigned short dcallno;
- /* Start of raw frame (outgoing only) */
+ /*! Start of raw frame (outgoing only) */
void *data;
- /* Length of frame (outgoing only) */
+ /*! Length of frame (outgoing only) */
int datalen;
- /* How many retries so far? */
+ /*! How many retries so far? */
int retries;
- /* Outgoing relative timestamp (ms) */
+ /*! Outgoing relative timestamp (ms) */
unsigned int ts;
- /* How long to wait before retrying */
+ /*! How long to wait before retrying */
int retrytime;
- /* Are we received out of order? */
+ /*! Are we received out of order? */
unsigned int outoforder:1;
- /* Have we been sent at all yet? */
+ /*! Have we been sent at all yet? */
unsigned int sentyet:1;
- /* Non-zero if should be sent to transfer peer */
+ /*! Non-zero if should be sent to transfer peer */
unsigned int transfer:1;
- /* Non-zero if this is the final message */
+ /*! Non-zero if this is the final message */
unsigned int final:1;
- /* Ingress or outgres */
+ /*! Ingress or outgres */
unsigned int direction:2;
- /* Can this frame be cached? */
+ /*! Can this frame be cached? */
unsigned int cacheable:1;
- /* Outgoing Packet sequence number */
+ /*! Outgoing Packet sequence number */
int oseqno;
- /* Next expected incoming packet sequence number */
+ /*! Next expected incoming packet sequence number */
int iseqno;
- /* Retransmission ID */
+ /*! Retransmission ID */
int retrans;
- /* Easy linking */
+ /*! is this packet encrypted or not. if set this varible holds encryption methods*/
+ int encmethods;
+ /*! store encrypt key */
+ ast_aes_encrypt_key ecx;
+ /*! store decrypt key which corresponds to ecx */
+ ast_aes_decrypt_key mydcx;
+ /*! random data for encryption pad */
+ unsigned char semirand[32];
+ /*! Easy linking */
AST_LIST_ENTRY(iax_frame) list;
- /* Actual, isolated frame header */
+ /*! Actual, isolated frame header */
struct ast_frame af;
/*! Amount of space _allocated_ for data */
size_t afdatalen;