Update IPSec support and resolve some bugs in network functions.

This commit is contained in:
bossiel 2010-02-24 18:29:42 +00:00
parent eae2256877
commit 99fdeea784
30 changed files with 5791 additions and 2944 deletions

View File

@ -69,7 +69,7 @@
#if TIPSEC_UNDER_WINDOWS && !defined(_WIN32_WCE)
//# include <windows.h>
# include <ws2tcpip.h>
//# include <ws2tcpip.h>
# include <winsock2.h>
#endif

View File

@ -41,8 +41,8 @@ TSK_BEGIN_DECLS
#define TIPSEC_CONTEXT(ctx) ((tipsec_context_t*)(ctx))
#define TIPSEC_IPPROTO_FROM_STR(ipproto) (tsk_strequals(ipproto, "tcp") ? ipproto_tcp : ipproto_udp)
#define TIPSEC_IPPROTO_TO_STR(ipproto) (ipproto == ipproto_tcp ? "tcp" : "udp")
#define TIPSEC_IPPROTO_FROM_STR(ipproto) (tsk_strequals(ipproto, "tcp") ? ipproto_tcp : (tsk_strequals(ipproto, "icmp") ? ipproto_icmp : ipproto_udp))
#define TIPSEC_IPPROTO_TO_STR(ipproto) (ipproto == ipproto_tcp ? "tcp" : (ipproto == ipproto_icmp ? "icmp" : "udp"))
#define TIPSEC_MODE_FROM_STR(mode) (tsk_strequals(mode, "tun") ? mode_tun : mode_trans)
#define TIPSEC_MODE_TO_STR(mode) (mode == mode_tun ? "tun" : "trans")
@ -113,7 +113,9 @@ typedef enum tipsec_ipproto_e
//! UDP.
ipproto_udp,
//! TCP.
ipproto_tcp
ipproto_tcp,
//! ICMP.
ipproto_icmp
}
tipsec_ipproto_t;

View File

@ -128,12 +128,14 @@ int tipsec_start(tipsec_context_t* ctx)
goto bail;
}
/* Load previous Policies */
/* delete previous Policies */
tipsec_run_command(TEXT("d sp "TEXT(TINYIPSEC_IPSEC6_UCPS_POLICY)));
tipsec_run_command(TEXT("d sp "TEXT(TINYIPSEC_IPSEC6_USPC_POLICY)));
/* Load new policies */
ret = tipsec_run_command(TEXT("l "TEXT(TINYIPSEC_IPSEC6_FILE)));
if(!(ret = tipsec_run_command(TEXT("l "TEXT(TINYIPSEC_IPSEC6_FILE))))){
TIPSEC_CONTEXT(ctx_xp)->started = 1;
}
bail:
/* Remove files */

View File

@ -24,9 +24,11 @@
#include "tsk_debug.h"
#define ADDR_REMOTE "192.168.0.9" //"2a01:e35:8b32:7050:6122:2706:2124:32ca"//"192.168.0.15"
#define ADDR_LOCAL "192.168.0.12" //"2a01:e35:8b32:7050:6122:2706:2124:32cb"//"192.168.0.14"
#define USE_IPV6 0
//#define ADDR_REMOTE "192.168.0.9" //"2a01:e35:8b32:7050:6122:2706:2124:32ca"//"192.168.0.15"
//#define ADDR_LOCAL "192.168.0.12" //"2a01:e35:8b32:7050:6122:2706:2124:32cb"//"192.168.0.14"
#define ADDR_REMOTE "2001:5c0:1502:1800::225"
#define ADDR_LOCAL "2001:5c0:1502:1800:5cc8:4a4e:3ef7:3314"
#define USE_IPV6 1
#define IK "1234567890123456"
#define CK "1234567890121234"
@ -44,7 +46,7 @@ int _tmain(int argc, _TCHAR* argv[])
int ret;
tipsec_lifetime_t lifetime = 600000; /* Always set it to the maximum value. (Not possible to update the value after REGISTER 200OK. ) */
tipsec_context_t * ctx = TIPSEC_CONTEXT_CREATE(ipproto_udp, USE_IPV6, mode_trans, ealg_aes, algo_hmac_md5_96, proto_both);
tipsec_context_t * ctx = TIPSEC_CONTEXT_CREATE(ipproto_icmp, USE_IPV6, mode_trans, ealg_aes, algo_hmac_md5_96, proto_both);
if((ret = tipsec_set_local(ctx, ADDR_LOCAL, ADDR_REMOTE, PORT_UC, PORT_US))){
goto bail;
@ -60,12 +62,12 @@ int _tmain(int argc, _TCHAR* argv[])
/* get and process the 401/407
*/
tipsec_set_keys(ctx, IK, CK);
if((ret = tipsec_set_remote(ctx, SPI_PC, SPI_PS, PORT_PC, PORT_PS, lifetime))){
goto bail;
}
tipsec_set_keys(ctx, IK, CK);
/* Start */
if((ret = tipsec_start(ctx))){
goto bail;

View File

@ -231,7 +231,7 @@ tnet_fd_t tnet_transport_connectto(const tnet_transport_handle_t *handle, const
fd = transport->master->fd;
}
if((status = tnet_sockfd_connetto(fd, (const struct sockaddr *)&to))){
if((status = tnet_sockfd_connetto(fd, (const struct sockaddr_storage *)&to))){
if(fd != transport->master->fd){
tnet_sockfd_close(&fd);
}

View File

@ -75,6 +75,7 @@ typedef char tnet_ip_t[INET6_ADDRSTRLEN];
# define TNET_ERROR_WOULDBLOCK WSAEWOULDBLOCK
# define TNET_ERROR_INPROGRESS WSAEINPROGRESS
# define TNET_ERROR_CONNRESET WSAECONNRESET
# define TNET_ERROR_INTR WSAEINTR
# if defined(_WIN32_WCE)
# define tnet_gai_strerror(...) "FIXME"
# else
@ -85,6 +86,7 @@ typedef char tnet_ip_t[INET6_ADDRSTRLEN];
# define TNET_ERROR_WOULDBLOCK EWOULDBLOCK
# define TNET_ERROR_INPROGRESS EINPROGRESS
# define TNET_ERROR_CONNRESET ECONNRESET
# define TNET_ERROR_INTR EINTR
# define tnet_gai_strerror gai_strerror
#endif
#define TNET_INVALID_FD TNET_INVALID_SOCKET

View File

@ -554,13 +554,11 @@ int tnet_get_sockip_n_port(struct sockaddr *addr, tnet_ip_t *ip, tnet_port_t *po
if(addr->sa_family == AF_INET)
{
struct sockaddr_in *sin = (struct sockaddr_in *)addr;
if(port)
{
if(port){
*port = ntohs(sin->sin_port);
status = 0;
}
if(ip)
{
if(ip){
if((status = tnet_getnameinfo((struct sockaddr*)sin, sizeof(*sin), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST)))
{
return status;
@ -573,13 +571,11 @@ int tnet_get_sockip_n_port(struct sockaddr *addr, tnet_ip_t *ip, tnet_port_t *po
#if TNET_UNDER_WINDOWS
int index;
#endif
if(port)
{
if(port){
*port = ntohs(sin6->sin6_port);
status = 0;
}
if(ip)
{
if(ip){
if((status = tnet_getnameinfo((struct sockaddr*)sin6, sizeof(*sin6), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST)))
{
return status;
@ -601,18 +597,41 @@ int tnet_get_sockip_n_port(struct sockaddr *addr, tnet_ip_t *ip, tnet_port_t *po
return status;
}
// MUST be connect()ed
int tnet_get_peerip_n_port(tnet_fd_t localFD, tnet_ip_t *ip, tnet_port_t *port)
{
if(port){
*port = 0;
}
if(localFD > 0){
int status;
socklen_t len;
struct sockaddr_storage ss;
len = sizeof(ss);
if((status = getpeername(localFD, (struct sockaddr *)&ss, &len))){
TSK_DEBUG_ERROR("TNET_GET_SOCKADDR has failed with status code: %d", status);
return -1;
}
return tnet_get_sockip_n_port(((struct sockaddr *)&ss), ip, port);
}
TSK_DEBUG_ERROR("Could not use an invalid socket description.");
return -1;
}
int tnet_get_ip_n_port(tnet_fd_t fd, tnet_ip_t *ip, tnet_port_t *port)
{
if(port){
*port = 0;
}
if(fd > 0)
{
if(fd > 0){
int status;
struct sockaddr_storage ss;
if((status = tnet_get_sockaddr(fd, &ss)))
{
if((status = tnet_get_sockaddr(fd, &ss))){
TSK_DEBUG_ERROR("TNET_GET_SOCKADDR has failed with status code: %d", status);
return -1;
}
@ -850,34 +869,53 @@ int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, size_t size, int flags, struct
int tnet_sockfd_send(tnet_fd_t fd, void* buf, size_t size, int flags)
{
int ret = -1;
if(fd == TNET_INVALID_FD){
TSK_DEBUG_ERROR("Using invalid FD to send data.");
return -1;
goto bail;
}
return send(fd, buf, size, flags);
if((ret = send(fd, buf, size, flags)) <= 0){
TNET_PRINT_LAST_ERROR("send failed.");
// Under Windows XP if WSAGetLastError()==WSAEINTR then try to disable both the ICS and the Firewall
// More info about How to disable the ISC: http://support.microsoft.com/?scid=kb%3Ben-us%3B230112&x=6&y=11
goto bail;
}
bail:
return ret;
}
int tnet_sockfd_recv(tnet_fd_t fd, void* buf, size_t size, int flags)
{
int ret = -1;
if(fd == TNET_INVALID_FD){
TSK_DEBUG_ERROR("Using invalid FD to recv data.");
return -1;
goto bail;
}
return recv(fd, buf, size, flags);
if((ret = recv(fd, buf, size, flags)) <= 0){
TNET_PRINT_LAST_ERROR("recv failed.");
goto bail;
}
bail:
return ret;
}
int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr *to)
int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr_storage *to)
{
int status = -1;
#if TNET_UNDER_WINDOWS
if((status = WSAConnect(fd, (LPSOCKADDR)&to, sizeof(to), NULL, NULL, NULL, NULL)) == SOCKET_ERROR)
if((status = WSAConnect(fd, (LPSOCKADDR)to, sizeof(*to), NULL, NULL, NULL, NULL)) == SOCKET_ERROR)
{
if((status = WSAGetLastError()) == WSAEWOULDBLOCK){
TSK_DEBUG_INFO("WSAEWOULDBLOCK error for WSAConnect operation");
status = WSAGetLastError();
if(status == WSAEWOULDBLOCK || status == WSAEINTR || status == WSAEINPROGRESS ){
TSK_DEBUG_WARN("WSAEWOULDBLOCK/WSAEINTR/WSAEINPROGRESS error for WSAConnect operation");
status = 0;
}
else{
@ -888,14 +926,14 @@ int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr *to)
#else /* !TNET_UNDER_WINDOWS */
# if TNET_HAVE_SS_LEN
if((status = connect(fd, (struct sockaddr*)&to, to.ss_len)))
if((status = connect(fd, (struct sockaddr*)to, to.ss_len)))
# else
if((status = connect(fd, (struct sockaddr*)&to, sizeof(to))))
if((status = connect(fd, (struct sockaddr*)to, sizeof(*to))))
# endif
{
status = tnet_geterrno();
if(status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_INPROGRESS){
TSK_DEBUG_INFO("TNET_ERROR_WOULDBLOCK/TNET_ERROR_INPROGRESS error for Connect operation");
if(status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_INPROGRESS || status == EAGAIN){
TSK_DEBUG_WARN("TNET_ERROR_WOULDBLOCK/TNET_ERROR_INPROGRESS/EAGAIN error for Connect operation");
status = 0;
}
else{

View File

@ -97,10 +97,13 @@ TINYNET_API int tnet_get_sockaddr(tnet_fd_t fd, struct sockaddr_storage *result)
TINYNET_API tnet_socket_type_t tnet_get_socket_type(tnet_fd_t fd);
TINYNET_API int tnet_get_ip_n_port(tnet_fd_t fd, tnet_ip_t *ip, tnet_port_t *port);
TINYNET_API int tnet_get_sockip_n_port(struct sockaddr *addr, tnet_ip_t *ip, tnet_port_t *port);
TINYNET_API int tnet_get_peerip_n_port(tnet_fd_t localFD, tnet_ip_t *ip, tnet_port_t *port);
#define tnet_get_ip(fd, ip) tnet_get_ip_n_port(fd, ip, 0)
#define tnet_get_port(fd, port) tnet_get_ip_n_port(fd, 0, port)
#define tnet_get_sockip(addr, ip) tnet_get_sockip_n_port(addr, ip, 0)
#define tnet_get_sockport(addr, port) tnet_get_sockip_n_port(addr, 0, port)
#define tnet_get_peerip(localFD, ip) tnet_get_peerip_n_port(localFD, ip, 0)
#define tnet_get_peerport(localFD, port) tnet_get_peerip_n_port(localFD, 0, port)
TINYNET_API int tnet_getnameinfo(const struct sockaddr *sa, socklen_t salen, char* node, socklen_t nodelen, char* service, socklen_t servicelen, int flags);
TINYNET_API int tnet_gethostname(tnet_host_t* result);
@ -120,7 +123,7 @@ TINYNET_API int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, cons
TINYNET_API int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, size_t size, int flags, struct sockaddr *from);
TINYNET_API int tnet_sockfd_send(tnet_fd_t fd, void* buf, size_t size, int flags);
TINYNET_API int tnet_sockfd_recv(tnet_fd_t fd, void* buf, size_t size, int flags);
TINYNET_API int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr *to);
TINYNET_API int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr_storage *to);
TINYNET_API int tnet_sockfd_close(tnet_fd_t *fd);

View File

@ -335,7 +335,7 @@ COLON = SWS ":" SWS ; colon
LDQUOT = SWS DQUOTE ; open double quotation mark
RDQUOT = DQUOTE SWS ; close double quotation mark
;;;; tocken
;;;; token
token = 1*( alphanum / "-" / "." / "!" / "%" / "*" / "_" / "+" / "`" / "'" / "~" )
;;;; quoted-string

View File

@ -66,8 +66,8 @@ typedef struct tsip_challenge_s
char* algorithm;
const char* qop;
uint8_t ck[AKA_CK_SIZE];
uint8_t ik[AKA_IK_SIZE];
AKA_CK_T ck;
AKA_IK_T ik;
tsk_md5string_t cnonce;
unsigned nc;

View File

@ -151,6 +151,7 @@ int tsip_dialog_response_send(const tsip_dialog_t *self, tsip_response_t* respon
int tsip_dialog_get_newdelay(tsip_dialog_t *self, const tsip_response_t* response);
int tsip_dialog_update(tsip_dialog_t *self, const tsip_response_t* response);
int tsip_dialog_getCKIK(tsip_dialog_t *self, AKA_CK_T *ck, AKA_IK_T *ik);
int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, tsip_stack_handle_t * stack, const char* call_id, tsip_operation_handle_t* operation);
int tsip_dialog_hangup(tsip_dialog_t *self);

View File

@ -39,9 +39,9 @@ TSIP_BEGIN_DECLS
* Creates new sip 'Security-Client' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header.
* @sa TSK_OBJECT_SAFE_FREE.
*/
#define TSIP_HEADER_SECURITY_CLIENT_VA_ARGS() tsip_header_Security_Client_def_t
#define TSIP_HEADER_SECURITY_CLIENT_CREATE() tsk_object_new(TSIP_HEADER_SECURITY_CLIENT_VA_ARGS())
#define TSIP_HEADER_SECURITY_CLIENT_CREATE_NULL() TSIP_HEADER_SECURITY_CLIENT_CREATE()
#define TSIP_HEADER_SECURITY_CLIENT_VA_ARGS(mech, alg, prot, mod, ealg, port_c, port_s, spi_c, spi_s) tsip_header_Security_Client_def_t, (const char*)mech, (const char*)alg, (const char*)prot, (const char*)mod, (const char*)ealg, (tnet_port_t)port_c, (tnet_port_t)port_s, (uint32_t)spi_c, (uint32_t)spi_s
#define TSIP_HEADER_SECURITY_CLIENT_CREATE(mech, alg, prot, mod, ealg, port_c, port_s, spi_c, spi_s) tsk_object_new(TSIP_HEADER_SECURITY_CLIENT_VA_ARGS(mech, alg, prot, mod, ealg, port_c, port_s, spi_c, spi_s))
#define TSIP_HEADER_SECURITY_CLIENT_CREATE_NULL() TSIP_HEADER_SECURITY_CLIENT_CREATE(TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL, TSIP_NULL)
////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct

View File

@ -70,6 +70,7 @@ tsip_transport_ipsec_t;
int tsip_transport_ipsec_createTempSAs(tsip_transport_ipsec_t* self);
int tsip_transport_ipsec_ensureTempSAs(tsip_transport_ipsec_t* self, const tsip_response_t *r401_407, int32_t expires);
int tsip_transport_ipsec_startSAs(tsip_transport_ipsec_t* self, const tipsec_key_t* ik, const tipsec_key_t* ck);
int tsip_transport_ipsec_cleanupSAs(tsip_transport_ipsec_t* self);
tnet_fd_t tsip_transport_ipsec_getFD(tsip_transport_ipsec_t* self, int isRequest);
int tsip_transport_ipsec_updateMSG(tsip_transport_ipsec_t* self, tsip_message_t *msg);

View File

@ -60,6 +60,7 @@ int tsip_transport_layer_send(const tsip_transport_layer_t* self, const char *br
int tsip_transport_createTempSAs(const tsip_transport_layer_t *self);
int tsip_transport_ensureTempSAs(const tsip_transport_layer_t *self, const tsip_response_t *r401_407, int32_t expires);
int tsip_transport_startSAs(const tsip_transport_layer_t* self, const void* ik, const void* ck);
int tsip_transport_cleanupSAs(const tsip_transport_layer_t *self);
int tsip_transport_layer_start(const tsip_transport_layer_t* self);

View File

@ -126,6 +126,14 @@
}
}
action parse_prot
{
if(curr_securityclient)
{
TSK_PARSER_SET_STRING(curr_securityclient->prot);
}
}
action parse_preference
{
if(curr_securityclient)
@ -155,8 +163,9 @@
spi_c = "spi-c"i EQUAL DIGIT+>tag %parse_spi_c;
ealg = "ealg"i EQUAL token>tag %parse_ealg;
alg = "alg"i EQUAL token>tag %parse_alg;
prot = "prot"i EQUAL token>tag %parse_prot;
preference = "q"i EQUAL qvalue>tag %parse_preference;
mech_parameters = (preference | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mech_parameters = (preference |prot | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mechanism_name = token>tag %parse_mech;
sec_mechanism = (mechanism_name ( SEMI mech_parameters )*) >create_securityclient %add_securityclient;
Security_Client = "Security-Client"i HCOLON sec_mechanism ( COMMA sec_mechanism )*;
@ -176,7 +185,7 @@ int tsip_header_Security_Client_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Client->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Client->mech,
Security_Client->alg ? ";alg=" : "",
@ -184,6 +193,9 @@ int tsip_header_Security_Client_tostring(const void* header, tsk_buffer_t* outpu
Security_Client->ealg ? ";ealg=" : "",
Security_Client->ealg ? Security_Client->ealg : "",
Security_Client->prot ? ";prot=" : "",
Security_Client->prot ? Security_Client->prot : "",
Security_Client->spi_c,
Security_Client->spi_s,
@ -245,11 +257,29 @@ static void* tsip_header_Security_Client_create(void *self, va_list * app)
tsip_header_Security_Client_t *Security_Client = self;
if(Security_Client)
{
const char* mech = va_arg(*app, const char*);
TSIP_HEADER(Security_Client)->type = tsip_htype_Security_Client;
TSIP_HEADER(Security_Client)->tostring = tsip_header_Security_Client_tostring;
Security_Client->q = -1;
if(mech){
Security_Client->mech = tsk_strdup(mech);
Security_Client->alg = tsk_strdup(va_arg(*app, const char*));
Security_Client->prot = tsk_strdup(va_arg(*app, const char*));
Security_Client->mod = tsk_strdup(va_arg(*app, const char*));
Security_Client->ealg = tsk_strdup(va_arg(*app, const char*));
#if defined(__GNUC__)
Security_Client->port_c = (tnet_port_t)va_arg(*app, unsigned);
Security_Client->port_s = (tnet_port_t)va_arg(*app, unsigned);
#else
Security_Client->port_c = va_arg(*app, tnet_port_t);
Security_Client->port_s = va_arg(*app, tnet_port_t);
#endif
Security_Client->spi_c = va_arg(*app, uint32_t);
Security_Client->spi_s = va_arg(*app, uint32_t);
}
}
else
{

View File

@ -127,6 +127,14 @@
}
}
action parse_prot
{
if(curr_securityserver)
{
TSK_PARSER_SET_STRING(curr_securityserver->prot);
}
}
action parse_preference
{
if(curr_securityserver)
@ -156,8 +164,9 @@
spi_c = "spi-c"i EQUAL DIGIT+>tag %parse_spi_c;
ealg = "ealg"i EQUAL token>tag %parse_ealg;
alg = "alg"i EQUAL token>tag %parse_alg;
prot = "prot"i EQUAL token>tag %parse_prot;
preference = "q"i EQUAL qvalue>tag %parse_preference;
mech_parameters = (preference | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mech_parameters = (preference | prot | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mechanism_name = token>tag %parse_mech;
sec_mechanism = (mechanism_name ( SEMI mech_parameters )*) >create_securityserver %add_securityserver;
Security_Server = "Security-Server"i HCOLON sec_mechanism ( COMMA sec_mechanism )*;
@ -177,7 +186,7 @@ int tsip_header_Security_Server_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Server->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Server->mech,
Security_Server->alg ? ";alg=" : "",
@ -185,6 +194,9 @@ int tsip_header_Security_Server_tostring(const void* header, tsk_buffer_t* outpu
Security_Server->ealg ? ";ealg=" : "",
Security_Server->ealg ? Security_Server->ealg : "",
Security_Server->prot ? ";prot=" : "",
Security_Server->prot ? Security_Server->prot : "",
Security_Server->spi_c,
Security_Server->spi_s,

View File

@ -126,6 +126,14 @@
}
}
action parse_prot
{
if(curr_securityverify)
{
TSK_PARSER_SET_STRING(curr_securityverify->prot);
}
}
action parse_preference
{
if(curr_securityverify)
@ -155,8 +163,9 @@
spi_c = "spi-c"i EQUAL DIGIT+>tag %parse_spi_c;
ealg = "ealg"i EQUAL token>tag %parse_ealg;
alg = "alg"i EQUAL token>tag %parse_alg;
prot = "prot"i EQUAL token>tag %parse_prot;
preference = "q"i EQUAL qvalue>tag %parse_preference;
mech_parameters = (preference | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mech_parameters = (preference | prot | alg | ealg | spi_c | spi_s | port_c | port_s) @1 | mech_extension @0;
mechanism_name = token>tag %parse_mech;
sec_mechanism = (mechanism_name ( SEMI mech_parameters )*) >create_securityverify %add_securityverify;
Security_Verify = "Security-Verify"i HCOLON sec_mechanism ( COMMA sec_mechanism )*;
@ -176,7 +185,7 @@ int tsip_header_Security_Verify_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Verify->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Verify->mech,
Security_Verify->alg ? ";alg=" : "",
@ -184,6 +193,9 @@ int tsip_header_Security_Verify_tostring(const void* header, tsk_buffer_t* outpu
Security_Verify->ealg ? ";ealg=" : "",
Security_Verify->ealg ? Security_Verify->ealg : "",
Security_Verify->prot ? ";prot=" : "",
Security_Verify->prot ? Security_Verify->prot : "",
Security_Verify->spi_c,
Security_Verify->spi_s,

View File

@ -234,8 +234,7 @@ int tsip_challenge_get_response(tsip_challenge_t *self, const char* method, cons
In case of AKAv1-MD5 and AKAv2-MD5 the secret must be computed as per RFC 3310 + 3GPP TS 206/7/8/9.
The resulting AKA RES parameter is treated as a "password"/"secret" when calculating the response directive of RFC 2617.
*/
if(TSIP_CHALLENGE_IS_AKAv1(self) || TSIP_CHALLENGE_IS_AKAv2(self))
{
if(TSIP_CHALLENGE_IS_AKAv1(self) || TSIP_CHALLENGE_IS_AKAv2(self)){
char* akaresult = 0;
tsip_challenge_get_akares(self, TSIP_CHALLENGE_STACK(self)->password, &akaresult);
if(thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, akaresult, &ha1))
@ -244,8 +243,7 @@ int tsip_challenge_get_response(tsip_challenge_t *self, const char* method, cons
}
TSK_FREE(akaresult);
}
else
{
else{
thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, TSIP_CHALLENGE_STACK(self)->password, &ha1);
}

View File

@ -216,8 +216,7 @@ tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* m
{
challenge = item->data;
auth_hdr = tsip_challenge_create_header_authorization(challenge, request);
if(auth_hdr)
{
if(auth_hdr){
tsip_message_add_header(request, auth_hdr);
tsk_object_unref(auth_hdr), auth_hdr = 0;
}
@ -225,8 +224,7 @@ tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* m
}
/* Update CSeq */
if(!tsk_striequals(method, "ACK") && !tsk_striequals(method, "CANCEL"))
{
if(!tsk_striequals(method, "ACK") && !tsk_striequals(method, "CANCEL")){
request->CSeq->seq = ++(TSIP_DIALOG(self)->cseq_value);
}
@ -234,7 +232,7 @@ tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* m
* ==> http://betelco.blogspot.com/2008/11/proxy-and-service-route-discovery-in.html
* The dialog Routes have been copied above.
*/
if(request->type != tsip_REGISTER /*!tsk_striequals("REGISTER", method)*/)
if(request->type != tsip_REGISTER)
{ // According to the above link ==> Initial/Re/De registration do not have routes.
tsk_list_item_t* item;
if(copy_routes_start !=-1)
@ -556,6 +554,27 @@ int tsip_dialog_update(tsip_dialog_t *self, const tsip_response_t* response)
return -1;
}
int tsip_dialog_getCKIK(tsip_dialog_t *self, AKA_CK_T *ck, AKA_IK_T *ik)
{
tsk_list_item_t *item;
tsip_challenge_t *challenge;
if(!self){
return -1;
}
tsk_list_foreach(item, self->challenges)
{
if((challenge = item->data)){
memcpy(*ck, challenge->ck, AKA_CK_SIZE);
memcpy(*ik, challenge->ik, AKA_IK_SIZE);
return 0;
}
}
TSK_DEBUG_ERROR("No challenge found. Fail to set IK and CK.");
return -2;
}
int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response, int acceptNewVector)
{
int ret = -1;

View File

@ -35,8 +35,6 @@
#include "tinysip/headers/tsip_header_Path.h"
#include "tinysip/headers/tsip_header_P_Associated_URI.h"
#include "tinysip/headers/tsip_header_Min_Expires.h"
#include "tinysip/headers/tsip_header_Proxy_Require.h"
#include "tinysip/headers/tsip_header_Require.h"
#include "tinysip/headers/tsip_header_Service_Route.h"
#include "tinysip/headers/tsip_header_Supported.h"
@ -511,14 +509,18 @@ int tsip_dialog_register_Trying_2_Trying_X_423(va_list *app)
(Interval Too Brief) response.
*/
hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(message, tsip_htype_Min_Expires);
if(hdr)
{
if(hdr){
TSIP_DIALOG(self)->expires = hdr->value;
ret = send_register(self, TSIP_FALSE);
if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->secagree_mech, "ipsec-3gpp")){
tsip_transport_cleanupSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
ret = send_register(self, TSIP_TRUE);
}
else{
ret = send_register(self, TSIP_FALSE);
}
}
else
{
else{
ret = -1;
}
@ -687,16 +689,19 @@ int send_register(tsip_dialog_register_t *self, TSIP_BOOLEAN initial)
//else if(2 == 3 /* multiple registrations */){
//}
}
/* RFC 3329 - 2.3.1 Client Initiated
The client MUST add both a Require and Proxy-Require header field with the value "sec-agree" to its request.
*/
/* Create temorary SAs if initial register. */
if(TSIP_DIALOG_GET_STACK(self)->secagree_mech){
TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_REQUIRE_VA_ARGS("sec-agree"));
TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_PROXY_REQUIRE_VA_ARGS("sec-agree"));
if(initial && tsk_striequals(TSIP_DIALOG_GET_STACK(self)->secagree_mech, "ipsec-3gpp")){
tsip_transport_createTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->secagree_mech, "ipsec-3gpp")){
if(initial){
tsip_transport_createTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
}
else{
AKA_CK_T ck;
AKA_IK_T ik;
tsip_dialog_getCKIK(TSIP_DIALOG(self), &ck, &ik);
tsip_transport_startSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport, (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@
* Ragel state machine.
*/
/* #line 167 "tsip_parser_header_Security_Client.rl" */
/* #line 176 "tsip_parser_header_Security_Client.rl" */
int tsip_header_Security_Client_tostring(const void* header, tsk_buffer_t* output)
@ -59,7 +59,7 @@ int tsip_header_Security_Client_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Client->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Client->mech,
Security_Client->alg ? ";alg=" : "",
@ -67,6 +67,9 @@ int tsip_header_Security_Client_tostring(const void* header, tsk_buffer_t* outpu
Security_Client->ealg ? ";ealg=" : "",
Security_Client->ealg ? Security_Client->ealg : "",
Security_Client->prot ? ";prot=" : "",
Security_Client->prot ? Security_Client->prot : "",
Security_Client->spi_c,
Security_Client->spi_s,
@ -101,15 +104,16 @@ tsip_header_Security_Clients_L_t *tsip_header_Security_Client_parse(const char *
tsip_header_Security_Client_t *curr_securityclient = 0;
/* #line 105 "../src/headers/tsip_header_Security_Client.c" */
/* #line 108 "../src/headers/tsip_header_Security_Client.c" */
static const char _tsip_machine_parser_header_Security_Client_actions[] = {
0, 1, 0, 1, 3, 1, 4, 1,
5, 1, 6, 1, 7, 1, 8, 1,
9, 1, 10, 1, 11, 1, 12, 2,
1, 0, 2, 3, 2, 2, 4, 2,
2, 5, 2, 2, 6, 2, 2, 7,
2, 2, 8, 2, 2, 9, 2, 2,
10, 2, 2, 11, 2
9, 1, 10, 1, 11, 1, 12, 1,
13, 2, 1, 0, 2, 3, 2, 2,
4, 2, 2, 5, 2, 2, 6, 2,
2, 7, 2, 2, 8, 2, 2, 9,
2, 2, 10, 2, 2, 11, 2, 2,
12, 2
};
static const short _tsip_machine_parser_header_Security_Client_key_offsets[] = {
@ -127,15 +131,17 @@ static const short _tsip_machine_parser_header_Security_Client_key_offsets[] = {
460, 461, 481, 501, 519, 525, 526, 528,
533, 552, 553, 555, 574, 591, 611, 631,
651, 669, 675, 676, 678, 683, 702, 703,
705, 724, 741, 761, 781, 801, 820, 842,
860, 866, 867, 869, 874, 893, 894, 896,
915, 922, 940, 946, 947, 949, 954, 973,
974, 976, 995, 1002, 1020, 1026, 1027, 1029,
1034, 1055, 1056, 1058, 1079, 1085, 1092, 1099,
1106, 1111, 1117, 1123, 1129, 1135, 1155, 1175,
1194, 1216, 1234, 1240, 1241, 1243, 1248, 1267,
1268, 1270, 1289, 1296, 1314, 1320, 1321, 1323,
1328, 1347, 1348, 1350, 1369, 1376
705, 724, 741, 763, 783, 803, 822, 844,
862, 868, 869, 871, 876, 895, 896, 898,
917, 924, 942, 948, 949, 951, 956, 975,
976, 978, 997, 1004, 1024, 1044, 1062, 1068,
1069, 1071, 1076, 1095, 1096, 1098, 1117, 1134,
1152, 1158, 1159, 1161, 1166, 1187, 1188, 1190,
1211, 1217, 1224, 1231, 1238, 1243, 1249, 1255,
1261, 1267, 1287, 1307, 1326, 1348, 1366, 1372,
1373, 1375, 1380, 1399, 1400, 1402, 1421, 1428,
1446, 1452, 1453, 1455, 1460, 1479, 1480, 1482,
1501, 1508
};
static const char _tsip_machine_parser_header_Security_Client_trans_keys[] = {
@ -232,86 +238,102 @@ static const char _tsip_machine_parser_header_Security_Client_trans_keys[] = {
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 79, 111,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
59, 61, 82, 114, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 84, 116,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
45, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 67, 83, 99,
115, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 44,
59, 48, 57, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 44, 59, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 44, 48,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 33, 37, 39, 44, 59, 61,
80, 112, 126, 42, 46, 48, 57, 65,
33, 37, 39, 44, 59, 61, 79, 82,
111, 114, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 59, 61, 73, 105, 126, 42,
39, 44, 59, 61, 82, 114, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 45, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 67, 83, 99, 115, 126,
13, 32, 33, 37, 39, 44, 59, 61,
84, 116, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 79, 111, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
61, 84, 116, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 44, 59, 61, 10, 9,
32, 9, 32, 44, 59, 61, 9, 13,
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
0
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 44, 59, 48, 57, 9,
13, 32, 44, 59, 48, 57, 9, 13,
32, 44, 59, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 44, 48, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 33, 37,
39, 44, 59, 61, 80, 112, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 59, 61,
73, 105, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 0
};
static const char _tsip_machine_parser_header_Security_Client_single_lengths[] = {
@ -329,15 +351,17 @@ static const char _tsip_machine_parser_header_Security_Client_single_lengths[] =
1, 12, 12, 10, 6, 1, 2, 5,
9, 1, 2, 9, 9, 12, 12, 12,
10, 6, 1, 2, 5, 9, 1, 2,
9, 9, 12, 12, 12, 11, 14, 10,
9, 9, 14, 12, 12, 11, 14, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
11, 1, 2, 11, 6, 5, 5, 5,
5, 6, 6, 6, 6, 12, 12, 11,
14, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
9, 1, 2, 9, 5, 0
2, 9, 5, 12, 12, 10, 6, 1,
2, 5, 9, 1, 2, 9, 9, 10,
6, 1, 2, 5, 11, 1, 2, 11,
6, 5, 5, 5, 5, 6, 6, 6,
6, 12, 12, 11, 14, 10, 6, 1,
2, 5, 9, 1, 2, 9, 5, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 0
};
static const char _tsip_machine_parser_header_Security_Client_range_lengths[] = {
@ -358,12 +382,14 @@ static const char _tsip_machine_parser_header_Security_Client_range_lengths[] =
5, 4, 4, 4, 4, 4, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 0, 1, 1, 1,
0, 0, 0, 0, 0, 4, 4, 4,
4, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 1, 0
0, 5, 1, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
0, 1, 1, 1, 0, 0, 0, 0,
0, 4, 4, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 1, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 0
};
static const short _tsip_machine_parser_header_Security_Client_index_offsets[] = {
@ -381,15 +407,17 @@ static const short _tsip_machine_parser_header_Security_Client_index_offsets[] =
431, 433, 450, 467, 482, 489, 491, 494,
500, 515, 517, 520, 535, 549, 566, 583,
600, 615, 622, 624, 627, 633, 648, 650,
653, 668, 682, 699, 716, 733, 749, 768,
783, 790, 792, 795, 801, 816, 818, 821,
836, 843, 858, 865, 867, 870, 876, 891,
893, 896, 911, 918, 933, 940, 942, 945,
951, 968, 970, 973, 990, 997, 1004, 1011,
1018, 1024, 1031, 1038, 1045, 1052, 1069, 1086,
1102, 1121, 1136, 1143, 1145, 1148, 1154, 1169,
1171, 1174, 1189, 1196, 1211, 1218, 1220, 1223,
1229, 1244, 1246, 1249, 1264, 1271
653, 668, 682, 701, 718, 735, 751, 770,
785, 792, 794, 797, 803, 818, 820, 823,
838, 845, 860, 867, 869, 872, 878, 893,
895, 898, 913, 920, 937, 954, 969, 976,
978, 981, 987, 1002, 1004, 1007, 1022, 1036,
1051, 1058, 1060, 1063, 1069, 1086, 1088, 1091,
1108, 1115, 1122, 1129, 1136, 1142, 1149, 1156,
1163, 1170, 1187, 1204, 1220, 1239, 1254, 1261,
1263, 1266, 1272, 1287, 1289, 1292, 1307, 1314,
1329, 1336, 1338, 1341, 1347, 1362, 1364, 1367,
1382, 1389
};
static const unsigned char _tsip_machine_parser_header_Security_Client_indicies[] = {
@ -479,80 +507,94 @@ static const unsigned char _tsip_machine_parser_header_Security_Client_indicies[
131, 131, 131, 1, 134, 135, 134, 136,
136, 136, 137, 138, 136, 136, 136, 136,
136, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 139, 139, 42, 42, 42,
43, 44, 45, 139, 140, 139, 140, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 141, 141,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 142,
142, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 143, 44,
45, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 44, 45,
144, 145, 144, 145, 42, 42, 42, 42,
42, 1, 146, 41, 146, 42, 42, 42,
43, 44, 147, 42, 42, 42, 42, 42,
1, 148, 149, 148, 16, 28, 147, 1,
150, 1, 151, 151, 1, 151, 151, 16,
28, 147, 1, 147, 152, 147, 51, 52,
51, 51, 53, 51, 51, 51, 153, 51,
51, 1, 154, 1, 155, 155, 1, 155,
56, 155, 51, 52, 51, 51, 53, 51,
51, 51, 153, 51, 51, 1, 156, 157,
156, 158, 160, 159, 1, 161, 41, 161,
42, 42, 42, 43, 44, 162, 42, 42,
42, 42, 42, 1, 163, 164, 163, 16,
28, 162, 1, 165, 1, 166, 166, 1,
166, 166, 16, 28, 162, 1, 162, 167,
162, 51, 52, 51, 51, 53, 51, 51,
51, 168, 51, 51, 1, 169, 1, 170,
170, 1, 170, 56, 170, 51, 52, 51,
51, 53, 51, 51, 51, 168, 51, 51,
1, 171, 172, 171, 173, 175, 174, 1,
40, 41, 40, 42, 42, 42, 43, 44,
45, 176, 176, 42, 42, 42, 42, 42,
1, 40, 41, 40, 42, 42, 42, 43,
44, 45, 177, 177, 42, 42, 42, 42,
42, 1, 178, 41, 178, 42, 42, 42,
43, 44, 179, 42, 42, 42, 42, 42,
1, 180, 181, 180, 16, 28, 179, 1,
182, 1, 183, 183, 1, 183, 183, 16,
28, 179, 1, 179, 184, 179, 185, 52,
185, 185, 53, 185, 185, 185, 185, 185,
185, 1, 186, 1, 187, 187, 1, 187,
56, 187, 185, 52, 185, 185, 53, 185,
185, 185, 185, 185, 185, 1, 188, 189,
188, 190, 190, 190, 191, 192, 190, 190,
190, 190, 190, 1, 193, 41, 193, 42,
42, 42, 43, 44, 194, 42, 42, 42,
42, 42, 1, 195, 196, 195, 16, 28,
194, 1, 197, 1, 198, 198, 1, 198,
198, 16, 28, 194, 1, 194, 199, 194,
51, 52, 51, 51, 200, 201, 53, 51,
51, 51, 51, 51, 51, 1, 202, 1,
203, 203, 1, 203, 56, 203, 51, 52,
51, 51, 200, 201, 53, 51, 51, 51,
51, 51, 51, 1, 204, 205, 204, 206,
207, 208, 1, 204, 205, 204, 206, 208,
209, 1, 204, 205, 204, 206, 208, 210,
1, 204, 205, 204, 206, 208, 211, 1,
204, 205, 204, 206, 208, 1, 204, 205,
204, 206, 212, 208, 1, 204, 205, 204,
206, 213, 208, 1, 204, 205, 204, 206,
214, 208, 1, 204, 205, 204, 206, 211,
208, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 215, 215, 42, 42, 42,
42, 42, 1, 40, 41, 40, 42, 42,
42, 43, 44, 45, 140, 140, 42, 42,
42, 43, 44, 45, 216, 216, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 141, 141, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 142, 44, 45, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 143, 144,
143, 144, 42, 42, 42, 42, 42, 1,
145, 41, 145, 42, 42, 42, 43, 44,
146, 42, 42, 42, 42, 42, 1, 147,
148, 147, 16, 28, 146, 1, 149, 1,
150, 150, 1, 150, 150, 16, 28, 146,
1, 146, 151, 146, 51, 52, 51, 51,
53, 51, 51, 51, 152, 51, 51, 1,
153, 1, 154, 154, 1, 154, 56, 154,
51, 52, 51, 51, 53, 51, 51, 51,
152, 51, 51, 1, 155, 156, 155, 157,
159, 158, 1, 160, 41, 160, 42, 42,
42, 43, 44, 161, 42, 42, 42, 42,
42, 1, 162, 163, 162, 16, 28, 161,
1, 164, 1, 165, 165, 1, 165, 165,
16, 28, 161, 1, 161, 166, 161, 51,
52, 51, 51, 53, 51, 51, 51, 167,
51, 51, 1, 168, 1, 169, 169, 1,
169, 56, 169, 51, 52, 51, 51, 53,
51, 51, 51, 167, 51, 51, 1, 170,
171, 170, 172, 174, 173, 1, 175, 41,
175, 42, 42, 42, 43, 44, 176, 42,
42, 42, 42, 42, 1, 177, 178, 177,
16, 28, 176, 1, 179, 1, 180, 180,
1, 180, 180, 16, 28, 176, 1, 176,
181, 176, 51, 52, 51, 51, 182, 183,
53, 51, 51, 51, 51, 51, 51, 1,
184, 1, 185, 185, 1, 185, 56, 185,
51, 52, 51, 51, 182, 183, 53, 51,
51, 51, 51, 51, 51, 1, 186, 187,
186, 188, 189, 190, 1, 186, 187, 186,
188, 190, 191, 1, 186, 187, 186, 188,
190, 192, 1, 186, 187, 186, 188, 190,
193, 1, 186, 187, 186, 188, 190, 1,
186, 187, 186, 188, 194, 190, 1, 186,
187, 186, 188, 195, 190, 1, 186, 187,
186, 188, 196, 190, 1, 186, 187, 186,
188, 193, 190, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 197, 197, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 198, 198,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 199, 44, 45,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 200,
201, 200, 201, 42, 42, 42, 42, 42,
1, 202, 41, 202, 42, 42, 42, 43,
44, 203, 42, 42, 42, 42, 42, 1,
204, 205, 204, 16, 28, 203, 1, 206,
1, 207, 207, 1, 207, 207, 16, 28,
203, 1, 203, 208, 203, 51, 52, 51,
51, 53, 51, 51, 51, 209, 51, 51,
1, 210, 1, 211, 211, 1, 211, 56,
211, 51, 52, 51, 51, 53, 51, 51,
51, 209, 51, 51, 1, 212, 213, 212,
214, 216, 215, 1, 217, 41, 217, 42,
42, 42, 43, 44, 218, 42, 42, 42,
42, 42, 1, 219, 220, 219, 16, 28,
218, 1, 221, 1, 222, 222, 1, 222,
222, 16, 28, 218, 1, 218, 223, 218,
51, 52, 51, 51, 53, 51, 51, 51,
224, 51, 51, 1, 225, 1, 226, 226,
1, 226, 56, 226, 51, 52, 51, 51,
53, 51, 51, 51, 224, 51, 51, 1,
227, 228, 227, 229, 231, 230, 1, 1,
0
42, 42, 43, 217, 44, 45, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 218, 219, 218,
219, 42, 42, 42, 42, 42, 1, 220,
41, 220, 42, 42, 42, 43, 44, 221,
42, 42, 42, 42, 42, 1, 222, 223,
222, 16, 28, 221, 1, 224, 1, 225,
225, 1, 225, 225, 16, 28, 221, 1,
221, 226, 221, 51, 52, 51, 51, 53,
51, 51, 51, 227, 51, 51, 1, 228,
1, 229, 229, 1, 229, 56, 229, 51,
52, 51, 51, 53, 51, 51, 51, 227,
51, 51, 1, 230, 231, 230, 232, 234,
233, 1, 235, 41, 235, 42, 42, 42,
43, 44, 236, 42, 42, 42, 42, 42,
1, 237, 238, 237, 16, 28, 236, 1,
239, 1, 240, 240, 1, 240, 240, 16,
28, 236, 1, 236, 241, 236, 51, 52,
51, 51, 53, 51, 51, 51, 242, 51,
51, 1, 243, 1, 244, 244, 1, 244,
56, 244, 51, 52, 51, 51, 53, 51,
51, 51, 242, 51, 51, 1, 245, 246,
245, 247, 249, 248, 1, 1, 0
};
static const unsigned char _tsip_machine_parser_header_Security_Client_trans_targs[] = {
@ -560,11 +602,11 @@ static const unsigned char _tsip_machine_parser_header_Security_Client_trans_tar
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 21, 19, 20, 22, 51, 21,
17, 26, 22, 23, 26, 24, 25, 27,
30, 89, 101, 114, 139, 157, 28, 29,
30, 89, 101, 114, 151, 169, 28, 29,
31, 51, 30, 17, 26, 35, 31, 32,
33, 34, 36, 53, 42, 54, 37, 38,
39, 40, 41, 43, 44, 45, 46, 47,
48, 50, 52, 49, 22, 181, 55, 88,
48, 50, 52, 49, 22, 193, 55, 88,
56, 59, 57, 58, 60, 75, 61, 73,
62, 63, 71, 64, 65, 69, 66, 67,
68, 70, 72, 74, 76, 84, 77, 80,
@ -573,69 +615,75 @@ static const unsigned char _tsip_machine_parser_header_Security_Client_trans_tar
97, 100, 98, 99, 22, 51, 100, 17,
26, 102, 103, 104, 105, 109, 105, 106,
107, 108, 110, 113, 111, 112, 22, 51,
113, 17, 26, 115, 116, 117, 118, 119,
129, 120, 124, 120, 121, 122, 123, 125,
128, 126, 127, 22, 51, 17, 128, 26,
130, 134, 130, 131, 132, 133, 135, 138,
136, 137, 22, 51, 17, 138, 26, 140,
144, 140, 141, 142, 143, 145, 148, 153,
146, 147, 22, 51, 17, 149, 26, 150,
151, 152, 154, 155, 156, 158, 159, 160,
161, 171, 162, 166, 162, 163, 164, 165,
167, 170, 168, 169, 22, 51, 17, 170,
26, 172, 176, 172, 173, 174, 175, 177,
180, 178, 179, 22, 51, 17, 180, 26
113, 17, 26, 115, 139, 116, 117, 118,
119, 129, 120, 124, 120, 121, 122, 123,
125, 128, 126, 127, 22, 51, 17, 128,
26, 130, 134, 130, 131, 132, 133, 135,
138, 136, 137, 22, 51, 17, 138, 26,
140, 141, 142, 146, 142, 143, 144, 145,
147, 150, 148, 149, 22, 51, 150, 17,
26, 152, 156, 152, 153, 154, 155, 157,
160, 165, 158, 159, 22, 51, 17, 161,
26, 162, 163, 164, 166, 167, 168, 170,
171, 172, 173, 183, 174, 178, 174, 175,
176, 177, 179, 182, 180, 181, 22, 51,
17, 182, 26, 184, 188, 184, 185, 186,
187, 189, 192, 190, 191, 22, 51, 17,
192, 26
};
static const char _tsip_machine_parser_header_Security_Client_trans_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 23, 0, 0, 26, 26, 0,
26, 3, 0, 0, 0, 0, 0, 0,
0, 0, 25, 0, 0, 28, 28, 0,
28, 3, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 0, 0,
50, 50, 0, 50, 19, 0, 0, 0,
55, 55, 0, 55, 21, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 50, 21, 0, 0,
0, 0, 0, 0, 55, 23, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 44, 44, 0, 44,
15, 0, 0, 0, 50, 0, 0, 0,
0, 0, 0, 1, 0, 0, 41, 41,
0, 41, 13, 0, 0, 0, 0, 0,
0, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 32, 32, 32, 0, 7,
50, 0, 0, 0, 0, 0, 0, 1,
0, 0, 29, 29, 29, 0, 5, 50,
0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 47, 47, 47, 0, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 38, 38, 38, 0,
11, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 35, 35, 35, 0, 9
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 46, 46, 0, 46,
15, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 43, 43,
0, 43, 13, 0, 0, 0, 0, 0,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 34, 34, 34, 0,
7, 55, 0, 0, 0, 0, 0, 0,
1, 0, 0, 31, 31, 31, 0, 5,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 49, 49, 0, 49,
17, 55, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 52, 52, 52, 0,
19, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 40, 40,
40, 0, 11, 55, 0, 0, 0, 0,
0, 0, 1, 0, 0, 37, 37, 37,
0, 9
};
static const int tsip_machine_parser_header_Security_Client_start = 1;
static const int tsip_machine_parser_header_Security_Client_first_final = 181;
static const int tsip_machine_parser_header_Security_Client_first_final = 193;
static const int tsip_machine_parser_header_Security_Client_error = 0;
static const int tsip_machine_parser_header_Security_Client_en_main = 1;
/* #line 221 "tsip_parser_header_Security_Client.rl" */
/* #line 233 "tsip_parser_header_Security_Client.rl" */
/* #line 632 "../src/headers/tsip_header_Security_Client.c" */
/* #line 680 "../src/headers/tsip_header_Security_Client.c" */
{
cs = tsip_machine_parser_header_Security_Client_start;
}
/* #line 222 "tsip_parser_header_Security_Client.rl" */
/* #line 234 "tsip_parser_header_Security_Client.rl" */
/* #line 639 "../src/headers/tsip_header_Security_Client.c" */
/* #line 687 "../src/headers/tsip_header_Security_Client.c" */
{
int _klen;
unsigned int _trans;
@ -801,7 +849,7 @@ _match:
{
if(curr_securityclient)
{
TSK_PARSER_SET_DOUBLE(curr_securityclient->q);
TSK_PARSER_SET_STRING(curr_securityclient->prot);
}
}
break;
@ -810,16 +858,25 @@ _match:
{
if(curr_securityclient)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityclient));
TSK_PARSER_SET_DOUBLE(curr_securityclient->q);
}
}
break;
case 12:
/* #line 148 "tsip_parser_header_Security_Client.rl" */
/* #line 146 "tsip_parser_header_Security_Client.rl" */
{
if(curr_securityclient)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityclient));
}
}
break;
case 13:
/* #line 156 "tsip_parser_header_Security_Client.rl" */
{
}
break;
/* #line 823 "../src/headers/tsip_header_Security_Client.c" */
/* #line 880 "../src/headers/tsip_header_Security_Client.c" */
}
}
@ -832,12 +889,12 @@ _again:
_out: {}
}
/* #line 223 "tsip_parser_header_Security_Client.rl" */
/* #line 235 "tsip_parser_header_Security_Client.rl" */
if( cs <
/* #line 839 "../src/headers/tsip_header_Security_Client.c" */
181
/* #line 224 "tsip_parser_header_Security_Client.rl" */
/* #line 896 "../src/headers/tsip_header_Security_Client.c" */
193
/* #line 236 "tsip_parser_header_Security_Client.rl" */
)
{
TSK_OBJECT_SAFE_FREE(curr_securityclient);
@ -862,11 +919,29 @@ static void* tsip_header_Security_Client_create(void *self, va_list * app)
tsip_header_Security_Client_t *Security_Client = self;
if(Security_Client)
{
const char* mech = va_arg(*app, const char*);
TSIP_HEADER(Security_Client)->type = tsip_htype_Security_Client;
TSIP_HEADER(Security_Client)->tostring = tsip_header_Security_Client_tostring;
Security_Client->q = -1;
if(mech){
Security_Client->mech = tsk_strdup(mech);
Security_Client->alg = tsk_strdup(va_arg(*app, const char*));
Security_Client->prot = tsk_strdup(va_arg(*app, const char*));
Security_Client->mod = tsk_strdup(va_arg(*app, const char*));
Security_Client->ealg = tsk_strdup(va_arg(*app, const char*));
#if defined(__GNUC__)
Security_Client->port_c = (tnet_port_t)va_arg(*app, unsigned);
Security_Client->port_s = (tnet_port_t)va_arg(*app, unsigned);
#else
Security_Client->port_c = va_arg(*app, tnet_port_t);
Security_Client->port_s = va_arg(*app, tnet_port_t);
#endif
Security_Client->spi_c = va_arg(*app, uint32_t);
Security_Client->spi_s = va_arg(*app, uint32_t);
}
}
else
{

View File

@ -47,7 +47,7 @@
* Ragel state machine.
*/
/* #line 168 "tsip_parser_header_Security_Server.rl" */
/* #line 177 "tsip_parser_header_Security_Server.rl" */
int tsip_header_Security_Server_tostring(const void* header, tsk_buffer_t* output)
@ -60,7 +60,7 @@ int tsip_header_Security_Server_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Server->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Server->mech,
Security_Server->alg ? ";alg=" : "",
@ -68,6 +68,9 @@ int tsip_header_Security_Server_tostring(const void* header, tsk_buffer_t* outpu
Security_Server->ealg ? ";ealg=" : "",
Security_Server->ealg ? Security_Server->ealg : "",
Security_Server->prot ? ";prot=" : "",
Security_Server->prot ? Security_Server->prot : "",
Security_Server->spi_c,
Security_Server->spi_s,
@ -102,15 +105,16 @@ tsip_header_Security_Servers_L_t *tsip_header_Security_Server_parse(const char *
tsip_header_Security_Server_t *curr_securityserver = 0;
/* #line 106 "../src/headers/tsip_header_Security_Server.c" */
/* #line 109 "../src/headers/tsip_header_Security_Server.c" */
static const char _tsip_machine_parser_header_Security_Server_actions[] = {
0, 1, 0, 1, 3, 1, 4, 1,
5, 1, 6, 1, 7, 1, 8, 1,
9, 1, 10, 1, 11, 1, 12, 2,
1, 0, 2, 3, 2, 2, 4, 2,
2, 5, 2, 2, 6, 2, 2, 7,
2, 2, 8, 2, 2, 9, 2, 2,
10, 2, 2, 11, 2
9, 1, 10, 1, 11, 1, 12, 1,
13, 2, 1, 0, 2, 3, 2, 2,
4, 2, 2, 5, 2, 2, 6, 2,
2, 7, 2, 2, 8, 2, 2, 9,
2, 2, 10, 2, 2, 11, 2, 2,
12, 2
};
static const short _tsip_machine_parser_header_Security_Server_key_offsets[] = {
@ -128,15 +132,17 @@ static const short _tsip_machine_parser_header_Security_Server_key_offsets[] = {
460, 461, 481, 501, 519, 525, 526, 528,
533, 552, 553, 555, 574, 591, 611, 631,
651, 669, 675, 676, 678, 683, 702, 703,
705, 724, 741, 761, 781, 801, 820, 842,
860, 866, 867, 869, 874, 893, 894, 896,
915, 922, 940, 946, 947, 949, 954, 973,
974, 976, 995, 1002, 1020, 1026, 1027, 1029,
1034, 1055, 1056, 1058, 1079, 1085, 1092, 1099,
1106, 1111, 1117, 1123, 1129, 1135, 1155, 1175,
1194, 1216, 1234, 1240, 1241, 1243, 1248, 1267,
1268, 1270, 1289, 1296, 1314, 1320, 1321, 1323,
1328, 1347, 1348, 1350, 1369, 1376
705, 724, 741, 763, 783, 803, 822, 844,
862, 868, 869, 871, 876, 895, 896, 898,
917, 924, 942, 948, 949, 951, 956, 975,
976, 978, 997, 1004, 1024, 1044, 1062, 1068,
1069, 1071, 1076, 1095, 1096, 1098, 1117, 1134,
1152, 1158, 1159, 1161, 1166, 1187, 1188, 1190,
1211, 1217, 1224, 1231, 1238, 1243, 1249, 1255,
1261, 1267, 1287, 1307, 1326, 1348, 1366, 1372,
1373, 1375, 1380, 1399, 1400, 1402, 1421, 1428,
1446, 1452, 1453, 1455, 1460, 1479, 1480, 1482,
1501, 1508
};
static const char _tsip_machine_parser_header_Security_Server_trans_keys[] = {
@ -233,86 +239,102 @@ static const char _tsip_machine_parser_header_Security_Server_trans_keys[] = {
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 79, 111,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
59, 61, 82, 114, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 84, 116,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
45, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 67, 83, 99,
115, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 44,
59, 48, 57, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 44, 59, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 44, 48,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 33, 37, 39, 44, 59, 61,
80, 112, 126, 42, 46, 48, 57, 65,
33, 37, 39, 44, 59, 61, 79, 82,
111, 114, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 59, 61, 73, 105, 126, 42,
39, 44, 59, 61, 82, 114, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 45, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 67, 83, 99, 115, 126,
13, 32, 33, 37, 39, 44, 59, 61,
84, 116, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 79, 111, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
61, 84, 116, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 44, 59, 61, 10, 9,
32, 9, 32, 44, 59, 61, 9, 13,
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
0
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 44, 59, 48, 57, 9,
13, 32, 44, 59, 48, 57, 9, 13,
32, 44, 59, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 44, 48, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 33, 37,
39, 44, 59, 61, 80, 112, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 59, 61,
73, 105, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 0
};
static const char _tsip_machine_parser_header_Security_Server_single_lengths[] = {
@ -330,15 +352,17 @@ static const char _tsip_machine_parser_header_Security_Server_single_lengths[] =
1, 12, 12, 10, 6, 1, 2, 5,
9, 1, 2, 9, 9, 12, 12, 12,
10, 6, 1, 2, 5, 9, 1, 2,
9, 9, 12, 12, 12, 11, 14, 10,
9, 9, 14, 12, 12, 11, 14, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
11, 1, 2, 11, 6, 5, 5, 5,
5, 6, 6, 6, 6, 12, 12, 11,
14, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
9, 1, 2, 9, 5, 0
2, 9, 5, 12, 12, 10, 6, 1,
2, 5, 9, 1, 2, 9, 9, 10,
6, 1, 2, 5, 11, 1, 2, 11,
6, 5, 5, 5, 5, 6, 6, 6,
6, 12, 12, 11, 14, 10, 6, 1,
2, 5, 9, 1, 2, 9, 5, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 0
};
static const char _tsip_machine_parser_header_Security_Server_range_lengths[] = {
@ -359,12 +383,14 @@ static const char _tsip_machine_parser_header_Security_Server_range_lengths[] =
5, 4, 4, 4, 4, 4, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 0, 1, 1, 1,
0, 0, 0, 0, 0, 4, 4, 4,
4, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 1, 0
0, 5, 1, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
0, 1, 1, 1, 0, 0, 0, 0,
0, 4, 4, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 1, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 0
};
static const short _tsip_machine_parser_header_Security_Server_index_offsets[] = {
@ -382,15 +408,17 @@ static const short _tsip_machine_parser_header_Security_Server_index_offsets[] =
431, 433, 450, 467, 482, 489, 491, 494,
500, 515, 517, 520, 535, 549, 566, 583,
600, 615, 622, 624, 627, 633, 648, 650,
653, 668, 682, 699, 716, 733, 749, 768,
783, 790, 792, 795, 801, 816, 818, 821,
836, 843, 858, 865, 867, 870, 876, 891,
893, 896, 911, 918, 933, 940, 942, 945,
951, 968, 970, 973, 990, 997, 1004, 1011,
1018, 1024, 1031, 1038, 1045, 1052, 1069, 1086,
1102, 1121, 1136, 1143, 1145, 1148, 1154, 1169,
1171, 1174, 1189, 1196, 1211, 1218, 1220, 1223,
1229, 1244, 1246, 1249, 1264, 1271
653, 668, 682, 701, 718, 735, 751, 770,
785, 792, 794, 797, 803, 818, 820, 823,
838, 845, 860, 867, 869, 872, 878, 893,
895, 898, 913, 920, 937, 954, 969, 976,
978, 981, 987, 1002, 1004, 1007, 1022, 1036,
1051, 1058, 1060, 1063, 1069, 1086, 1088, 1091,
1108, 1115, 1122, 1129, 1136, 1142, 1149, 1156,
1163, 1170, 1187, 1204, 1220, 1239, 1254, 1261,
1263, 1266, 1272, 1287, 1289, 1292, 1307, 1314,
1329, 1336, 1338, 1341, 1347, 1362, 1364, 1367,
1382, 1389
};
static const unsigned char _tsip_machine_parser_header_Security_Server_indicies[] = {
@ -480,80 +508,94 @@ static const unsigned char _tsip_machine_parser_header_Security_Server_indicies[
131, 131, 131, 1, 134, 135, 134, 136,
136, 136, 137, 138, 136, 136, 136, 136,
136, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 139, 139, 42, 42, 42,
43, 44, 45, 139, 140, 139, 140, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 141, 141,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 142,
142, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 143, 44,
45, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 44, 45,
144, 145, 144, 145, 42, 42, 42, 42,
42, 1, 146, 41, 146, 42, 42, 42,
43, 44, 147, 42, 42, 42, 42, 42,
1, 148, 149, 148, 16, 28, 147, 1,
150, 1, 151, 151, 1, 151, 151, 16,
28, 147, 1, 147, 152, 147, 51, 52,
51, 51, 53, 51, 51, 51, 153, 51,
51, 1, 154, 1, 155, 155, 1, 155,
56, 155, 51, 52, 51, 51, 53, 51,
51, 51, 153, 51, 51, 1, 156, 157,
156, 158, 160, 159, 1, 161, 41, 161,
42, 42, 42, 43, 44, 162, 42, 42,
42, 42, 42, 1, 163, 164, 163, 16,
28, 162, 1, 165, 1, 166, 166, 1,
166, 166, 16, 28, 162, 1, 162, 167,
162, 51, 52, 51, 51, 53, 51, 51,
51, 168, 51, 51, 1, 169, 1, 170,
170, 1, 170, 56, 170, 51, 52, 51,
51, 53, 51, 51, 51, 168, 51, 51,
1, 171, 172, 171, 173, 175, 174, 1,
40, 41, 40, 42, 42, 42, 43, 44,
45, 176, 176, 42, 42, 42, 42, 42,
1, 40, 41, 40, 42, 42, 42, 43,
44, 45, 177, 177, 42, 42, 42, 42,
42, 1, 178, 41, 178, 42, 42, 42,
43, 44, 179, 42, 42, 42, 42, 42,
1, 180, 181, 180, 16, 28, 179, 1,
182, 1, 183, 183, 1, 183, 183, 16,
28, 179, 1, 179, 184, 179, 185, 52,
185, 185, 53, 185, 185, 185, 185, 185,
185, 1, 186, 1, 187, 187, 1, 187,
56, 187, 185, 52, 185, 185, 53, 185,
185, 185, 185, 185, 185, 1, 188, 189,
188, 190, 190, 190, 191, 192, 190, 190,
190, 190, 190, 1, 193, 41, 193, 42,
42, 42, 43, 44, 194, 42, 42, 42,
42, 42, 1, 195, 196, 195, 16, 28,
194, 1, 197, 1, 198, 198, 1, 198,
198, 16, 28, 194, 1, 194, 199, 194,
51, 52, 51, 51, 200, 201, 53, 51,
51, 51, 51, 51, 51, 1, 202, 1,
203, 203, 1, 203, 56, 203, 51, 52,
51, 51, 200, 201, 53, 51, 51, 51,
51, 51, 51, 1, 204, 205, 204, 206,
207, 208, 1, 204, 205, 204, 206, 208,
209, 1, 204, 205, 204, 206, 208, 210,
1, 204, 205, 204, 206, 208, 211, 1,
204, 205, 204, 206, 208, 1, 204, 205,
204, 206, 212, 208, 1, 204, 205, 204,
206, 213, 208, 1, 204, 205, 204, 206,
214, 208, 1, 204, 205, 204, 206, 211,
208, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 215, 215, 42, 42, 42,
42, 42, 1, 40, 41, 40, 42, 42,
42, 43, 44, 45, 140, 140, 42, 42,
42, 43, 44, 45, 216, 216, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 141, 141, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 142, 44, 45, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 143, 144,
143, 144, 42, 42, 42, 42, 42, 1,
145, 41, 145, 42, 42, 42, 43, 44,
146, 42, 42, 42, 42, 42, 1, 147,
148, 147, 16, 28, 146, 1, 149, 1,
150, 150, 1, 150, 150, 16, 28, 146,
1, 146, 151, 146, 51, 52, 51, 51,
53, 51, 51, 51, 152, 51, 51, 1,
153, 1, 154, 154, 1, 154, 56, 154,
51, 52, 51, 51, 53, 51, 51, 51,
152, 51, 51, 1, 155, 156, 155, 157,
159, 158, 1, 160, 41, 160, 42, 42,
42, 43, 44, 161, 42, 42, 42, 42,
42, 1, 162, 163, 162, 16, 28, 161,
1, 164, 1, 165, 165, 1, 165, 165,
16, 28, 161, 1, 161, 166, 161, 51,
52, 51, 51, 53, 51, 51, 51, 167,
51, 51, 1, 168, 1, 169, 169, 1,
169, 56, 169, 51, 52, 51, 51, 53,
51, 51, 51, 167, 51, 51, 1, 170,
171, 170, 172, 174, 173, 1, 175, 41,
175, 42, 42, 42, 43, 44, 176, 42,
42, 42, 42, 42, 1, 177, 178, 177,
16, 28, 176, 1, 179, 1, 180, 180,
1, 180, 180, 16, 28, 176, 1, 176,
181, 176, 51, 52, 51, 51, 182, 183,
53, 51, 51, 51, 51, 51, 51, 1,
184, 1, 185, 185, 1, 185, 56, 185,
51, 52, 51, 51, 182, 183, 53, 51,
51, 51, 51, 51, 51, 1, 186, 187,
186, 188, 189, 190, 1, 186, 187, 186,
188, 190, 191, 1, 186, 187, 186, 188,
190, 192, 1, 186, 187, 186, 188, 190,
193, 1, 186, 187, 186, 188, 190, 1,
186, 187, 186, 188, 194, 190, 1, 186,
187, 186, 188, 195, 190, 1, 186, 187,
186, 188, 196, 190, 1, 186, 187, 186,
188, 193, 190, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 197, 197, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 198, 198,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 199, 44, 45,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 200,
201, 200, 201, 42, 42, 42, 42, 42,
1, 202, 41, 202, 42, 42, 42, 43,
44, 203, 42, 42, 42, 42, 42, 1,
204, 205, 204, 16, 28, 203, 1, 206,
1, 207, 207, 1, 207, 207, 16, 28,
203, 1, 203, 208, 203, 51, 52, 51,
51, 53, 51, 51, 51, 209, 51, 51,
1, 210, 1, 211, 211, 1, 211, 56,
211, 51, 52, 51, 51, 53, 51, 51,
51, 209, 51, 51, 1, 212, 213, 212,
214, 216, 215, 1, 217, 41, 217, 42,
42, 42, 43, 44, 218, 42, 42, 42,
42, 42, 1, 219, 220, 219, 16, 28,
218, 1, 221, 1, 222, 222, 1, 222,
222, 16, 28, 218, 1, 218, 223, 218,
51, 52, 51, 51, 53, 51, 51, 51,
224, 51, 51, 1, 225, 1, 226, 226,
1, 226, 56, 226, 51, 52, 51, 51,
53, 51, 51, 51, 224, 51, 51, 1,
227, 228, 227, 229, 231, 230, 1, 1,
0
42, 42, 43, 217, 44, 45, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 218, 219, 218,
219, 42, 42, 42, 42, 42, 1, 220,
41, 220, 42, 42, 42, 43, 44, 221,
42, 42, 42, 42, 42, 1, 222, 223,
222, 16, 28, 221, 1, 224, 1, 225,
225, 1, 225, 225, 16, 28, 221, 1,
221, 226, 221, 51, 52, 51, 51, 53,
51, 51, 51, 227, 51, 51, 1, 228,
1, 229, 229, 1, 229, 56, 229, 51,
52, 51, 51, 53, 51, 51, 51, 227,
51, 51, 1, 230, 231, 230, 232, 234,
233, 1, 235, 41, 235, 42, 42, 42,
43, 44, 236, 42, 42, 42, 42, 42,
1, 237, 238, 237, 16, 28, 236, 1,
239, 1, 240, 240, 1, 240, 240, 16,
28, 236, 1, 236, 241, 236, 51, 52,
51, 51, 53, 51, 51, 51, 242, 51,
51, 1, 243, 1, 244, 244, 1, 244,
56, 244, 51, 52, 51, 51, 53, 51,
51, 51, 242, 51, 51, 1, 245, 246,
245, 247, 249, 248, 1, 1, 0
};
static const unsigned char _tsip_machine_parser_header_Security_Server_trans_targs[] = {
@ -561,11 +603,11 @@ static const unsigned char _tsip_machine_parser_header_Security_Server_trans_tar
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 21, 19, 20, 22, 51, 21,
17, 26, 22, 23, 26, 24, 25, 27,
30, 89, 101, 114, 139, 157, 28, 29,
30, 89, 101, 114, 151, 169, 28, 29,
31, 51, 30, 17, 26, 35, 31, 32,
33, 34, 36, 53, 42, 54, 37, 38,
39, 40, 41, 43, 44, 45, 46, 47,
48, 50, 52, 49, 22, 181, 55, 88,
48, 50, 52, 49, 22, 193, 55, 88,
56, 59, 57, 58, 60, 75, 61, 73,
62, 63, 71, 64, 65, 69, 66, 67,
68, 70, 72, 74, 76, 84, 77, 80,
@ -574,69 +616,75 @@ static const unsigned char _tsip_machine_parser_header_Security_Server_trans_tar
97, 100, 98, 99, 22, 51, 100, 17,
26, 102, 103, 104, 105, 109, 105, 106,
107, 108, 110, 113, 111, 112, 22, 51,
113, 17, 26, 115, 116, 117, 118, 119,
129, 120, 124, 120, 121, 122, 123, 125,
128, 126, 127, 22, 51, 17, 128, 26,
130, 134, 130, 131, 132, 133, 135, 138,
136, 137, 22, 51, 17, 138, 26, 140,
144, 140, 141, 142, 143, 145, 148, 153,
146, 147, 22, 51, 17, 149, 26, 150,
151, 152, 154, 155, 156, 158, 159, 160,
161, 171, 162, 166, 162, 163, 164, 165,
167, 170, 168, 169, 22, 51, 17, 170,
26, 172, 176, 172, 173, 174, 175, 177,
180, 178, 179, 22, 51, 17, 180, 26
113, 17, 26, 115, 139, 116, 117, 118,
119, 129, 120, 124, 120, 121, 122, 123,
125, 128, 126, 127, 22, 51, 17, 128,
26, 130, 134, 130, 131, 132, 133, 135,
138, 136, 137, 22, 51, 17, 138, 26,
140, 141, 142, 146, 142, 143, 144, 145,
147, 150, 148, 149, 22, 51, 150, 17,
26, 152, 156, 152, 153, 154, 155, 157,
160, 165, 158, 159, 22, 51, 17, 161,
26, 162, 163, 164, 166, 167, 168, 170,
171, 172, 173, 183, 174, 178, 174, 175,
176, 177, 179, 182, 180, 181, 22, 51,
17, 182, 26, 184, 188, 184, 185, 186,
187, 189, 192, 190, 191, 22, 51, 17,
192, 26
};
static const char _tsip_machine_parser_header_Security_Server_trans_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 23, 0, 0, 26, 26, 0,
26, 3, 0, 0, 0, 0, 0, 0,
0, 0, 25, 0, 0, 28, 28, 0,
28, 3, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 0, 0,
50, 50, 0, 50, 19, 0, 0, 0,
55, 55, 0, 55, 21, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 50, 21, 0, 0,
0, 0, 0, 0, 55, 23, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 44, 44, 0, 44,
15, 0, 0, 0, 50, 0, 0, 0,
0, 0, 0, 1, 0, 0, 41, 41,
0, 41, 13, 0, 0, 0, 0, 0,
0, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 32, 32, 32, 0, 7,
50, 0, 0, 0, 0, 0, 0, 1,
0, 0, 29, 29, 29, 0, 5, 50,
0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 47, 47, 47, 0, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 38, 38, 38, 0,
11, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 35, 35, 35, 0, 9
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 46, 46, 0, 46,
15, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 43, 43,
0, 43, 13, 0, 0, 0, 0, 0,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 34, 34, 34, 0,
7, 55, 0, 0, 0, 0, 0, 0,
1, 0, 0, 31, 31, 31, 0, 5,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 49, 49, 0, 49,
17, 55, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 52, 52, 52, 0,
19, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 40, 40,
40, 0, 11, 55, 0, 0, 0, 0,
0, 0, 1, 0, 0, 37, 37, 37,
0, 9
};
static const int tsip_machine_parser_header_Security_Server_start = 1;
static const int tsip_machine_parser_header_Security_Server_first_final = 181;
static const int tsip_machine_parser_header_Security_Server_first_final = 193;
static const int tsip_machine_parser_header_Security_Server_error = 0;
static const int tsip_machine_parser_header_Security_Server_en_main = 1;
/* #line 222 "tsip_parser_header_Security_Server.rl" */
/* #line 234 "tsip_parser_header_Security_Server.rl" */
/* #line 633 "../src/headers/tsip_header_Security_Server.c" */
/* #line 681 "../src/headers/tsip_header_Security_Server.c" */
{
cs = tsip_machine_parser_header_Security_Server_start;
}
/* #line 223 "tsip_parser_header_Security_Server.rl" */
/* #line 235 "tsip_parser_header_Security_Server.rl" */
/* #line 640 "../src/headers/tsip_header_Security_Server.c" */
/* #line 688 "../src/headers/tsip_header_Security_Server.c" */
{
int _klen;
unsigned int _trans;
@ -802,7 +850,7 @@ _match:
{
if(curr_securityserver)
{
TSK_PARSER_SET_DOUBLE(curr_securityserver->q);
TSK_PARSER_SET_STRING(curr_securityserver->prot);
}
}
break;
@ -811,16 +859,25 @@ _match:
{
if(curr_securityserver)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityserver));
TSK_PARSER_SET_DOUBLE(curr_securityserver->q);
}
}
break;
case 12:
/* #line 149 "tsip_parser_header_Security_Server.rl" */
/* #line 147 "tsip_parser_header_Security_Server.rl" */
{
if(curr_securityserver)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityserver));
}
}
break;
case 13:
/* #line 157 "tsip_parser_header_Security_Server.rl" */
{
}
break;
/* #line 824 "../src/headers/tsip_header_Security_Server.c" */
/* #line 881 "../src/headers/tsip_header_Security_Server.c" */
}
}
@ -833,12 +890,12 @@ _again:
_out: {}
}
/* #line 224 "tsip_parser_header_Security_Server.rl" */
/* #line 236 "tsip_parser_header_Security_Server.rl" */
if( cs <
/* #line 840 "../src/headers/tsip_header_Security_Server.c" */
181
/* #line 225 "tsip_parser_header_Security_Server.rl" */
/* #line 897 "../src/headers/tsip_header_Security_Server.c" */
193
/* #line 237 "tsip_parser_header_Security_Server.rl" */
)
{
TSK_OBJECT_SAFE_FREE(curr_securityserver);

View File

@ -46,7 +46,7 @@
* Ragel state machine.
*/
/* #line 167 "tsip_parser_header_Security_Verify.rl" */
/* #line 176 "tsip_parser_header_Security_Verify.rl" */
int tsip_header_Security_Verify_tostring(const void* header, tsk_buffer_t* output)
@ -59,7 +59,7 @@ int tsip_header_Security_Verify_tostring(const void* header, tsk_buffer_t* outpu
// ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
if(tsk_striequals(Security_Verify->mech, "ipsec-3gpp"))
{
tsk_buffer_appendEx(output, "%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
tsk_buffer_appendEx(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
Security_Verify->mech,
Security_Verify->alg ? ";alg=" : "",
@ -67,6 +67,9 @@ int tsip_header_Security_Verify_tostring(const void* header, tsk_buffer_t* outpu
Security_Verify->ealg ? ";ealg=" : "",
Security_Verify->ealg ? Security_Verify->ealg : "",
Security_Verify->prot ? ";prot=" : "",
Security_Verify->prot ? Security_Verify->prot : "",
Security_Verify->spi_c,
Security_Verify->spi_s,
@ -101,15 +104,16 @@ tsip_header_Security_Verifies_L_t *tsip_header_Security_Verify_parse(const char
tsip_header_Security_Verify_t *curr_securityverify = 0;
/* #line 105 "../src/headers/tsip_header_Security_Verify.c" */
/* #line 108 "../src/headers/tsip_header_Security_Verify.c" */
static const char _tsip_machine_parser_header_Security_Verify_actions[] = {
0, 1, 0, 1, 3, 1, 4, 1,
5, 1, 6, 1, 7, 1, 8, 1,
9, 1, 10, 1, 11, 1, 12, 2,
1, 0, 2, 3, 2, 2, 4, 2,
2, 5, 2, 2, 6, 2, 2, 7,
2, 2, 8, 2, 2, 9, 2, 2,
10, 2, 2, 11, 2
9, 1, 10, 1, 11, 1, 12, 1,
13, 2, 1, 0, 2, 3, 2, 2,
4, 2, 2, 5, 2, 2, 6, 2,
2, 7, 2, 2, 8, 2, 2, 9,
2, 2, 10, 2, 2, 11, 2, 2,
12, 2
};
static const short _tsip_machine_parser_header_Security_Verify_key_offsets[] = {
@ -127,15 +131,17 @@ static const short _tsip_machine_parser_header_Security_Verify_key_offsets[] = {
460, 461, 481, 501, 519, 525, 526, 528,
533, 552, 553, 555, 574, 591, 611, 631,
651, 669, 675, 676, 678, 683, 702, 703,
705, 724, 741, 761, 781, 801, 820, 842,
860, 866, 867, 869, 874, 893, 894, 896,
915, 922, 940, 946, 947, 949, 954, 973,
974, 976, 995, 1002, 1020, 1026, 1027, 1029,
1034, 1055, 1056, 1058, 1079, 1085, 1092, 1099,
1106, 1111, 1117, 1123, 1129, 1135, 1155, 1175,
1194, 1216, 1234, 1240, 1241, 1243, 1248, 1267,
1268, 1270, 1289, 1296, 1314, 1320, 1321, 1323,
1328, 1347, 1348, 1350, 1369, 1376
705, 724, 741, 763, 783, 803, 822, 844,
862, 868, 869, 871, 876, 895, 896, 898,
917, 924, 942, 948, 949, 951, 956, 975,
976, 978, 997, 1004, 1024, 1044, 1062, 1068,
1069, 1071, 1076, 1095, 1096, 1098, 1117, 1134,
1152, 1158, 1159, 1161, 1166, 1187, 1188, 1190,
1211, 1217, 1224, 1231, 1238, 1243, 1249, 1255,
1261, 1267, 1287, 1307, 1326, 1348, 1366, 1372,
1373, 1375, 1380, 1399, 1400, 1402, 1421, 1428,
1446, 1452, 1453, 1455, 1460, 1479, 1480, 1482,
1501, 1508
};
static const char _tsip_machine_parser_header_Security_Verify_trans_keys[] = {
@ -232,86 +238,102 @@ static const char _tsip_machine_parser_header_Security_Verify_trans_keys[] = {
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 79, 111,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
59, 61, 82, 114, 126, 42, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 61, 84, 116,
126, 42, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 33, 37, 39, 44,
45, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 67, 83, 99,
115, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 10, 9, 32,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 33, 37, 39,
44, 59, 61, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 44,
59, 61, 10, 9, 32, 9, 32, 44,
59, 61, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 48, 49, 91, 126, 42, 43, 45,
46, 50, 57, 65, 90, 95, 122, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 44,
59, 48, 57, 9, 13, 32, 44, 59,
48, 57, 9, 13, 32, 44, 59, 9,
13, 32, 44, 46, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 44, 48,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 33, 37, 39, 44, 59, 61,
80, 112, 126, 42, 46, 48, 57, 65,
33, 37, 39, 44, 59, 61, 79, 82,
111, 114, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 59, 61, 73, 105, 126, 42,
39, 44, 59, 61, 82, 114, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 45, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 33, 37, 39,
44, 59, 61, 67, 83, 99, 115, 126,
13, 32, 33, 37, 39, 44, 59, 61,
84, 116, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 79, 111, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
61, 84, 116, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
33, 37, 39, 44, 59, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 126,
42, 46, 48, 57, 65, 90, 95, 122,
9, 13, 32, 44, 59, 61, 10, 9,
32, 9, 32, 44, 59, 61, 9, 13,
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 33, 37, 39, 44, 59,
61, 126, 42, 46, 48, 57, 65, 90,
95, 122, 9, 13, 32, 44, 59, 61,
10, 9, 32, 9, 32, 44, 59, 61,
9, 13, 32, 33, 34, 37, 39, 91,
126, 42, 43, 45, 46, 48, 57, 65,
90, 95, 122, 10, 9, 32, 9, 13,
32, 33, 34, 37, 39, 91, 126, 42,
43, 45, 46, 48, 57, 65, 90, 95,
122, 9, 13, 32, 44, 59, 48, 57,
0
32, 33, 34, 37, 39, 48, 49, 91,
126, 42, 43, 45, 46, 50, 57, 65,
90, 95, 122, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 59, 48, 57,
9, 13, 32, 44, 59, 48, 57, 9,
13, 32, 44, 59, 48, 57, 9, 13,
32, 44, 59, 9, 13, 32, 44, 46,
59, 9, 13, 32, 44, 48, 59, 9,
13, 32, 44, 48, 59, 9, 13, 32,
44, 48, 59, 9, 13, 32, 33, 37,
39, 44, 59, 61, 80, 112, 126, 42,
46, 48, 57, 65, 90, 95, 122, 9,
13, 32, 33, 37, 39, 44, 59, 61,
73, 105, 126, 42, 46, 48, 57, 65,
90, 95, 122, 9, 13, 32, 33, 37,
39, 44, 45, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 33, 37, 39, 44, 59, 61, 67,
83, 99, 115, 126, 42, 46, 48, 57,
65, 90, 95, 122, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 9, 13, 32, 33,
37, 39, 44, 59, 61, 126, 42, 46,
48, 57, 65, 90, 95, 122, 9, 13,
32, 44, 59, 61, 10, 9, 32, 9,
32, 44, 59, 61, 9, 13, 32, 33,
34, 37, 39, 91, 126, 42, 43, 45,
46, 48, 57, 65, 90, 95, 122, 10,
9, 32, 9, 13, 32, 33, 34, 37,
39, 91, 126, 42, 43, 45, 46, 48,
57, 65, 90, 95, 122, 9, 13, 32,
44, 59, 48, 57, 0
};
static const char _tsip_machine_parser_header_Security_Verify_single_lengths[] = {
@ -329,15 +351,17 @@ static const char _tsip_machine_parser_header_Security_Verify_single_lengths[] =
1, 12, 12, 10, 6, 1, 2, 5,
9, 1, 2, 9, 9, 12, 12, 12,
10, 6, 1, 2, 5, 9, 1, 2,
9, 9, 12, 12, 12, 11, 14, 10,
9, 9, 14, 12, 12, 11, 14, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
11, 1, 2, 11, 6, 5, 5, 5,
5, 6, 6, 6, 6, 12, 12, 11,
14, 10, 6, 1, 2, 5, 9, 1,
2, 9, 5, 10, 6, 1, 2, 5,
9, 1, 2, 9, 5, 0
2, 9, 5, 12, 12, 10, 6, 1,
2, 5, 9, 1, 2, 9, 9, 10,
6, 1, 2, 5, 11, 1, 2, 11,
6, 5, 5, 5, 5, 6, 6, 6,
6, 12, 12, 11, 14, 10, 6, 1,
2, 5, 9, 1, 2, 9, 5, 10,
6, 1, 2, 5, 9, 1, 2, 9,
5, 0
};
static const char _tsip_machine_parser_header_Security_Verify_range_lengths[] = {
@ -358,12 +382,14 @@ static const char _tsip_machine_parser_header_Security_Verify_range_lengths[] =
5, 4, 4, 4, 4, 4, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 0, 1, 1, 1,
0, 0, 0, 0, 0, 4, 4, 4,
4, 4, 0, 0, 0, 0, 5, 0,
0, 5, 1, 4, 0, 0, 0, 0,
5, 0, 0, 5, 1, 0
0, 5, 1, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 4, 4,
0, 0, 0, 0, 5, 0, 0, 5,
0, 1, 1, 1, 0, 0, 0, 0,
0, 4, 4, 4, 4, 4, 0, 0,
0, 0, 5, 0, 0, 5, 1, 4,
0, 0, 0, 0, 5, 0, 0, 5,
1, 0
};
static const short _tsip_machine_parser_header_Security_Verify_index_offsets[] = {
@ -381,15 +407,17 @@ static const short _tsip_machine_parser_header_Security_Verify_index_offsets[] =
431, 433, 450, 467, 482, 489, 491, 494,
500, 515, 517, 520, 535, 549, 566, 583,
600, 615, 622, 624, 627, 633, 648, 650,
653, 668, 682, 699, 716, 733, 749, 768,
783, 790, 792, 795, 801, 816, 818, 821,
836, 843, 858, 865, 867, 870, 876, 891,
893, 896, 911, 918, 933, 940, 942, 945,
951, 968, 970, 973, 990, 997, 1004, 1011,
1018, 1024, 1031, 1038, 1045, 1052, 1069, 1086,
1102, 1121, 1136, 1143, 1145, 1148, 1154, 1169,
1171, 1174, 1189, 1196, 1211, 1218, 1220, 1223,
1229, 1244, 1246, 1249, 1264, 1271
653, 668, 682, 701, 718, 735, 751, 770,
785, 792, 794, 797, 803, 818, 820, 823,
838, 845, 860, 867, 869, 872, 878, 893,
895, 898, 913, 920, 937, 954, 969, 976,
978, 981, 987, 1002, 1004, 1007, 1022, 1036,
1051, 1058, 1060, 1063, 1069, 1086, 1088, 1091,
1108, 1115, 1122, 1129, 1136, 1142, 1149, 1156,
1163, 1170, 1187, 1204, 1220, 1239, 1254, 1261,
1263, 1266, 1272, 1287, 1289, 1292, 1307, 1314,
1329, 1336, 1338, 1341, 1347, 1362, 1364, 1367,
1382, 1389
};
static const unsigned char _tsip_machine_parser_header_Security_Verify_indicies[] = {
@ -479,80 +507,94 @@ static const unsigned char _tsip_machine_parser_header_Security_Verify_indicies[
131, 131, 131, 1, 134, 135, 134, 136,
136, 136, 137, 138, 136, 136, 136, 136,
136, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 139, 139, 42, 42, 42,
43, 44, 45, 139, 140, 139, 140, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 141, 141,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 142,
142, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 143, 44,
45, 42, 42, 42, 42, 42, 1, 40,
41, 40, 42, 42, 42, 43, 44, 45,
144, 145, 144, 145, 42, 42, 42, 42,
42, 1, 146, 41, 146, 42, 42, 42,
43, 44, 147, 42, 42, 42, 42, 42,
1, 148, 149, 148, 16, 28, 147, 1,
150, 1, 151, 151, 1, 151, 151, 16,
28, 147, 1, 147, 152, 147, 51, 52,
51, 51, 53, 51, 51, 51, 153, 51,
51, 1, 154, 1, 155, 155, 1, 155,
56, 155, 51, 52, 51, 51, 53, 51,
51, 51, 153, 51, 51, 1, 156, 157,
156, 158, 160, 159, 1, 161, 41, 161,
42, 42, 42, 43, 44, 162, 42, 42,
42, 42, 42, 1, 163, 164, 163, 16,
28, 162, 1, 165, 1, 166, 166, 1,
166, 166, 16, 28, 162, 1, 162, 167,
162, 51, 52, 51, 51, 53, 51, 51,
51, 168, 51, 51, 1, 169, 1, 170,
170, 1, 170, 56, 170, 51, 52, 51,
51, 53, 51, 51, 51, 168, 51, 51,
1, 171, 172, 171, 173, 175, 174, 1,
40, 41, 40, 42, 42, 42, 43, 44,
45, 176, 176, 42, 42, 42, 42, 42,
1, 40, 41, 40, 42, 42, 42, 43,
44, 45, 177, 177, 42, 42, 42, 42,
42, 1, 178, 41, 178, 42, 42, 42,
43, 44, 179, 42, 42, 42, 42, 42,
1, 180, 181, 180, 16, 28, 179, 1,
182, 1, 183, 183, 1, 183, 183, 16,
28, 179, 1, 179, 184, 179, 185, 52,
185, 185, 53, 185, 185, 185, 185, 185,
185, 1, 186, 1, 187, 187, 1, 187,
56, 187, 185, 52, 185, 185, 53, 185,
185, 185, 185, 185, 185, 1, 188, 189,
188, 190, 190, 190, 191, 192, 190, 190,
190, 190, 190, 1, 193, 41, 193, 42,
42, 42, 43, 44, 194, 42, 42, 42,
42, 42, 1, 195, 196, 195, 16, 28,
194, 1, 197, 1, 198, 198, 1, 198,
198, 16, 28, 194, 1, 194, 199, 194,
51, 52, 51, 51, 200, 201, 53, 51,
51, 51, 51, 51, 51, 1, 202, 1,
203, 203, 1, 203, 56, 203, 51, 52,
51, 51, 200, 201, 53, 51, 51, 51,
51, 51, 51, 1, 204, 205, 204, 206,
207, 208, 1, 204, 205, 204, 206, 208,
209, 1, 204, 205, 204, 206, 208, 210,
1, 204, 205, 204, 206, 208, 211, 1,
204, 205, 204, 206, 208, 1, 204, 205,
204, 206, 212, 208, 1, 204, 205, 204,
206, 213, 208, 1, 204, 205, 204, 206,
214, 208, 1, 204, 205, 204, 206, 211,
208, 1, 40, 41, 40, 42, 42, 42,
43, 44, 45, 215, 215, 42, 42, 42,
42, 42, 1, 40, 41, 40, 42, 42,
42, 43, 44, 45, 140, 140, 42, 42,
42, 43, 44, 45, 216, 216, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 141, 141, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 142, 44, 45, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 143, 144,
143, 144, 42, 42, 42, 42, 42, 1,
145, 41, 145, 42, 42, 42, 43, 44,
146, 42, 42, 42, 42, 42, 1, 147,
148, 147, 16, 28, 146, 1, 149, 1,
150, 150, 1, 150, 150, 16, 28, 146,
1, 146, 151, 146, 51, 52, 51, 51,
53, 51, 51, 51, 152, 51, 51, 1,
153, 1, 154, 154, 1, 154, 56, 154,
51, 52, 51, 51, 53, 51, 51, 51,
152, 51, 51, 1, 155, 156, 155, 157,
159, 158, 1, 160, 41, 160, 42, 42,
42, 43, 44, 161, 42, 42, 42, 42,
42, 1, 162, 163, 162, 16, 28, 161,
1, 164, 1, 165, 165, 1, 165, 165,
16, 28, 161, 1, 161, 166, 161, 51,
52, 51, 51, 53, 51, 51, 51, 167,
51, 51, 1, 168, 1, 169, 169, 1,
169, 56, 169, 51, 52, 51, 51, 53,
51, 51, 51, 167, 51, 51, 1, 170,
171, 170, 172, 174, 173, 1, 175, 41,
175, 42, 42, 42, 43, 44, 176, 42,
42, 42, 42, 42, 1, 177, 178, 177,
16, 28, 176, 1, 179, 1, 180, 180,
1, 180, 180, 16, 28, 176, 1, 176,
181, 176, 51, 52, 51, 51, 182, 183,
53, 51, 51, 51, 51, 51, 51, 1,
184, 1, 185, 185, 1, 185, 56, 185,
51, 52, 51, 51, 182, 183, 53, 51,
51, 51, 51, 51, 51, 1, 186, 187,
186, 188, 189, 190, 1, 186, 187, 186,
188, 190, 191, 1, 186, 187, 186, 188,
190, 192, 1, 186, 187, 186, 188, 190,
193, 1, 186, 187, 186, 188, 190, 1,
186, 187, 186, 188, 194, 190, 1, 186,
187, 186, 188, 195, 190, 1, 186, 187,
186, 188, 196, 190, 1, 186, 187, 186,
188, 193, 190, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 197, 197, 42,
42, 42, 42, 42, 1, 40, 41, 40,
42, 42, 42, 43, 44, 45, 198, 198,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 199, 44, 45,
42, 42, 42, 42, 42, 1, 40, 41,
40, 42, 42, 42, 43, 44, 45, 200,
201, 200, 201, 42, 42, 42, 42, 42,
1, 202, 41, 202, 42, 42, 42, 43,
44, 203, 42, 42, 42, 42, 42, 1,
204, 205, 204, 16, 28, 203, 1, 206,
1, 207, 207, 1, 207, 207, 16, 28,
203, 1, 203, 208, 203, 51, 52, 51,
51, 53, 51, 51, 51, 209, 51, 51,
1, 210, 1, 211, 211, 1, 211, 56,
211, 51, 52, 51, 51, 53, 51, 51,
51, 209, 51, 51, 1, 212, 213, 212,
214, 216, 215, 1, 217, 41, 217, 42,
42, 42, 43, 44, 218, 42, 42, 42,
42, 42, 1, 219, 220, 219, 16, 28,
218, 1, 221, 1, 222, 222, 1, 222,
222, 16, 28, 218, 1, 218, 223, 218,
51, 52, 51, 51, 53, 51, 51, 51,
224, 51, 51, 1, 225, 1, 226, 226,
1, 226, 56, 226, 51, 52, 51, 51,
53, 51, 51, 51, 224, 51, 51, 1,
227, 228, 227, 229, 231, 230, 1, 1,
0
42, 42, 43, 217, 44, 45, 42, 42,
42, 42, 42, 1, 40, 41, 40, 42,
42, 42, 43, 44, 45, 218, 219, 218,
219, 42, 42, 42, 42, 42, 1, 220,
41, 220, 42, 42, 42, 43, 44, 221,
42, 42, 42, 42, 42, 1, 222, 223,
222, 16, 28, 221, 1, 224, 1, 225,
225, 1, 225, 225, 16, 28, 221, 1,
221, 226, 221, 51, 52, 51, 51, 53,
51, 51, 51, 227, 51, 51, 1, 228,
1, 229, 229, 1, 229, 56, 229, 51,
52, 51, 51, 53, 51, 51, 51, 227,
51, 51, 1, 230, 231, 230, 232, 234,
233, 1, 235, 41, 235, 42, 42, 42,
43, 44, 236, 42, 42, 42, 42, 42,
1, 237, 238, 237, 16, 28, 236, 1,
239, 1, 240, 240, 1, 240, 240, 16,
28, 236, 1, 236, 241, 236, 51, 52,
51, 51, 53, 51, 51, 51, 242, 51,
51, 1, 243, 1, 244, 244, 1, 244,
56, 244, 51, 52, 51, 51, 53, 51,
51, 51, 242, 51, 51, 1, 245, 246,
245, 247, 249, 248, 1, 1, 0
};
static const unsigned char _tsip_machine_parser_header_Security_Verify_trans_targs[] = {
@ -560,11 +602,11 @@ static const unsigned char _tsip_machine_parser_header_Security_Verify_trans_tar
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 21, 19, 20, 22, 51, 21,
17, 26, 22, 23, 26, 24, 25, 27,
30, 89, 101, 114, 139, 157, 28, 29,
30, 89, 101, 114, 151, 169, 28, 29,
31, 51, 30, 17, 26, 35, 31, 32,
33, 34, 36, 53, 42, 54, 37, 38,
39, 40, 41, 43, 44, 45, 46, 47,
48, 50, 52, 49, 22, 181, 55, 88,
48, 50, 52, 49, 22, 193, 55, 88,
56, 59, 57, 58, 60, 75, 61, 73,
62, 63, 71, 64, 65, 69, 66, 67,
68, 70, 72, 74, 76, 84, 77, 80,
@ -573,69 +615,75 @@ static const unsigned char _tsip_machine_parser_header_Security_Verify_trans_tar
97, 100, 98, 99, 22, 51, 100, 17,
26, 102, 103, 104, 105, 109, 105, 106,
107, 108, 110, 113, 111, 112, 22, 51,
113, 17, 26, 115, 116, 117, 118, 119,
129, 120, 124, 120, 121, 122, 123, 125,
128, 126, 127, 22, 51, 17, 128, 26,
130, 134, 130, 131, 132, 133, 135, 138,
136, 137, 22, 51, 17, 138, 26, 140,
144, 140, 141, 142, 143, 145, 148, 153,
146, 147, 22, 51, 17, 149, 26, 150,
151, 152, 154, 155, 156, 158, 159, 160,
161, 171, 162, 166, 162, 163, 164, 165,
167, 170, 168, 169, 22, 51, 17, 170,
26, 172, 176, 172, 173, 174, 175, 177,
180, 178, 179, 22, 51, 17, 180, 26
113, 17, 26, 115, 139, 116, 117, 118,
119, 129, 120, 124, 120, 121, 122, 123,
125, 128, 126, 127, 22, 51, 17, 128,
26, 130, 134, 130, 131, 132, 133, 135,
138, 136, 137, 22, 51, 17, 138, 26,
140, 141, 142, 146, 142, 143, 144, 145,
147, 150, 148, 149, 22, 51, 150, 17,
26, 152, 156, 152, 153, 154, 155, 157,
160, 165, 158, 159, 22, 51, 17, 161,
26, 162, 163, 164, 166, 167, 168, 170,
171, 172, 173, 183, 174, 178, 174, 175,
176, 177, 179, 182, 180, 181, 22, 51,
17, 182, 26, 184, 188, 184, 185, 186,
187, 189, 192, 190, 191, 22, 51, 17,
192, 26
};
static const char _tsip_machine_parser_header_Security_Verify_trans_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 23, 0, 0, 26, 26, 0,
26, 3, 0, 0, 0, 0, 0, 0,
0, 0, 25, 0, 0, 28, 28, 0,
28, 3, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 0, 0,
50, 50, 0, 50, 19, 0, 0, 0,
55, 55, 0, 55, 21, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 50, 21, 0, 0,
0, 0, 0, 0, 55, 23, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 44, 44, 0, 44,
15, 0, 0, 0, 50, 0, 0, 0,
0, 0, 0, 1, 0, 0, 41, 41,
0, 41, 13, 0, 0, 0, 0, 0,
0, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 32, 32, 32, 0, 7,
50, 0, 0, 0, 0, 0, 0, 1,
0, 0, 29, 29, 29, 0, 5, 50,
0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 47, 47, 47, 0, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 0, 0, 0,
0, 1, 0, 0, 38, 38, 38, 0,
11, 50, 0, 0, 0, 0, 0, 0,
1, 0, 0, 35, 35, 35, 0, 9
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 46, 46, 0, 46,
15, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 43, 43,
0, 43, 13, 0, 0, 0, 0, 0,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 34, 34, 34, 0,
7, 55, 0, 0, 0, 0, 0, 0,
1, 0, 0, 31, 31, 31, 0, 5,
0, 0, 55, 0, 0, 0, 0, 0,
0, 1, 0, 0, 49, 49, 0, 49,
17, 55, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 52, 52, 52, 0,
19, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 55, 0, 0, 0,
0, 0, 0, 1, 0, 0, 40, 40,
40, 0, 11, 55, 0, 0, 0, 0,
0, 0, 1, 0, 0, 37, 37, 37,
0, 9
};
static const int tsip_machine_parser_header_Security_Verify_start = 1;
static const int tsip_machine_parser_header_Security_Verify_first_final = 181;
static const int tsip_machine_parser_header_Security_Verify_first_final = 193;
static const int tsip_machine_parser_header_Security_Verify_error = 0;
static const int tsip_machine_parser_header_Security_Verify_en_main = 1;
/* #line 221 "tsip_parser_header_Security_Verify.rl" */
/* #line 233 "tsip_parser_header_Security_Verify.rl" */
/* #line 632 "../src/headers/tsip_header_Security_Verify.c" */
/* #line 680 "../src/headers/tsip_header_Security_Verify.c" */
{
cs = tsip_machine_parser_header_Security_Verify_start;
}
/* #line 222 "tsip_parser_header_Security_Verify.rl" */
/* #line 234 "tsip_parser_header_Security_Verify.rl" */
/* #line 639 "../src/headers/tsip_header_Security_Verify.c" */
/* #line 687 "../src/headers/tsip_header_Security_Verify.c" */
{
int _klen;
unsigned int _trans;
@ -801,7 +849,7 @@ _match:
{
if(curr_securityverify)
{
TSK_PARSER_SET_DOUBLE(curr_securityverify->q);
TSK_PARSER_SET_STRING(curr_securityverify->prot);
}
}
break;
@ -810,16 +858,25 @@ _match:
{
if(curr_securityverify)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityverify));
TSK_PARSER_SET_DOUBLE(curr_securityverify->q);
}
}
break;
case 12:
/* #line 148 "tsip_parser_header_Security_Verify.rl" */
/* #line 146 "tsip_parser_header_Security_Verify.rl" */
{
if(curr_securityverify)
{
TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityverify));
}
}
break;
case 13:
/* #line 156 "tsip_parser_header_Security_Verify.rl" */
{
}
break;
/* #line 823 "../src/headers/tsip_header_Security_Verify.c" */
/* #line 880 "../src/headers/tsip_header_Security_Verify.c" */
}
}
@ -832,12 +889,12 @@ _again:
_out: {}
}
/* #line 223 "tsip_parser_header_Security_Verify.rl" */
/* #line 235 "tsip_parser_header_Security_Verify.rl" */
if( cs <
/* #line 839 "../src/headers/tsip_header_Security_Verify.c" */
181
/* #line 224 "tsip_parser_header_Security_Verify.rl" */
/* #line 896 "../src/headers/tsip_header_Security_Verify.c" */
193
/* #line 236 "tsip_parser_header_Security_Verify.rl" */
)
{
TSK_OBJECT_SAFE_FREE(curr_securityverify);

View File

@ -29,6 +29,8 @@
*/
#include "tinysip/transports/tsip_transport.h"
#include "tinysip/transports/tsip_transport_ipsec.h"
#include "tinysip/parsers/tsip_parser_uri.h"
#include "tsk_string.h"
@ -86,18 +88,15 @@ int tsip_transport_msg_update(const tsip_transport_t* self, tsip_message_t *msg)
{
tnet_ip_t ip;
tnet_port_t port;
int ret = 0;
if(tsip_transport_get_ip_n_port(self, &ip, &port)){
return -1;
}
/*
* Update the contact header.
*/
if(msg->Contact)
{
if(msg->Contact->uri && TSIP_HEADER_HAS_PARAM(msg->Contact, "doubs"))
{
/* Update the contact header.*/
if(msg->Contact){
if(msg->Contact->uri && TSIP_HEADER_HAS_PARAM(msg->Contact, "doubs")){
tsk_strupdate(&(msg->Contact->uri->scheme), self->scheme);
tsk_strupdate(&(msg->Contact->uri->host), ip);
msg->Contact->uri->port = port;
@ -106,14 +105,17 @@ int tsip_transport_msg_update(const tsip_transport_t* self, tsip_message_t *msg)
TSIP_HEADER_REMOVE_PARAM(msg->Contact, "doubs");
}
}
}
/* IPSec. */
if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)){
ret = tsip_transport_ipsec_updateMSG(TSIP_TRANSPORT_IPSEC(self), msg);
}
/*
* Sigcomp
*/
/* SigComp. */
return 0;
return ret;
}
@ -153,8 +155,7 @@ size_t tsip_transport_send(const tsip_transport_t* self, const char *branch, tsi
{
tsip_message_tostring(msg, buffer);
if(buffer->size >1300)
{
if(buffer->size >1300){
/* RFC 3261 - 18.1.1 Sending Requests (FIXME)
If a request is within 200 bytes of the path MTU, or if it is larger
than 1300 bytes and the path MTU is unknown, the request MUST be sent
@ -169,23 +170,34 @@ size_t tsip_transport_send(const tsip_transport_t* self, const char *branch, tsi
*/
}
/*if(destIP && destPort)
{
struct sockaddr_storage to;
if(tnet_sockaddr_init(destIP, destPort, tsip_transport_get_socket_type(self), &to))
{
goto bail;
}
if(tnet_transport_sendto(self->net_transport, self->connectedFD, &to, buffer->data, buffer->size))
{
ret = 0;
if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)){
tnet_fd_t fd = tsip_transport_ipsec_getFD(TSIP_TRANSPORT_IPSEC(self), TSIP_MESSAGE_IS_REQUEST(msg));
if(fd != TNET_INVALID_FD){
//struct sockaddr_storage to;
//tnet_sockaddr_init("2001:5c0:1502:1800::225", 4060, self->type, &to);
//tnet_sockfd_sendto(fd, (const struct sockaddr *)&to, buffer->data, buffer->size);
ret = tnet_sockfd_send(fd, buffer->data, buffer->size, 0);
}
}
else*/
{
if(tnet_transport_send(self->net_transport, self->connectedFD, buffer->data, buffer->size))
else{
/*if(destIP && destPort)
{
ret = 0;
struct sockaddr_storage to;
if(tnet_sockaddr_init(destIP, destPort, tsip_transport_get_socket_type(self), &to))
{
goto bail;
}
if(tnet_transport_sendto(self->net_transport, self->connectedFD, &to, buffer->data, buffer->size))
{
ret = 0;
}
}
else*/
{
if(tnet_transport_send(self->net_transport, self->connectedFD, buffer->data, buffer->size)){
ret = 0;
}
}
}

View File

@ -31,6 +31,8 @@
#include "tinysip/transports/tsip_transport.h"
#include "tinysip/headers/tsip_header_Proxy_Require.h"
#include "tinysip/headers/tsip_header_Require.h"
#include "tinysip/headers/tsip_header_Security_Client.h"
#include "tinysip/headers/tsip_header_Security_Server.h"
@ -44,41 +46,6 @@ TINYSIP_GEXTERN const void *tsip_ipsec_association_def_t;
tsk_object_new(tsip_ipsec_association_def_t, (const tsip_transport_t*)transport)
int add_Security_Client(const tsip_ipsec_association_t* association, tsip_message_t* msg)
{
tsip_header_Security_Client_t* header;
if(!association || !association->ctx || !msg){
return -1;
}
/* RFC 3329 - 2.3.1 Client Initiated
A client wishing to use the security agreement of this specification
MUST add a Security-Client header field to a request addressed to its
first-hop proxy (i.e., the destination of the request is the first-
hop proxy). This header field contains a list of all the security
mechanisms that the client supports. The client SHOULD NOT add
preference parameters to this list.
example: Security-Client: ipsec-3gpp; alg=hmac-md5-96; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
*/
header = TSIP_HEADER_SECURITY_CLIENT_CREATE_NULL();
header->mech = tsk_strdup("ipsec-3gpp");
header->alg = tsk_strdup(TIPSEC_ALG_TO_STR(association->ctx->alg));
header->ealg = tsk_strdup(TIPSEC_EALG_TO_STR(association->ctx->ealg));
header->spi_c = association->ctx->spi_uc;
header->spi_s = association->ctx->spi_us;
header->port_c = association->ctx->port_uc;
header->port_s = association->ctx->port_us;
tsip_message_add_header(msg, TSIP_HEADER(header));
TSK_OBJECT_SAFE_FREE(msg);
return 0;
}
int tsip_transport_ipsec_createTempSAs(tsip_transport_ipsec_t* self)
{
int ret = -1;
@ -153,7 +120,11 @@ int tsip_transport_ipsec_ensureTempSAs(tsip_transport_ipsec_t* self, const tsip_
/* Cleanup old Security-Verifies */
TSK_OBJECT_SAFE_FREE(self->secVerifies);
/* Match security server. */
/* RFC 3329 - 2.3.1 Client Initiated
When the client receives a response with a Security-Server header field, it MUST choose the security mechanism in the server's list
with the highest "q" value among all the mechanisms that are known to the client.
*/
for(index = 0; (ssHdr = (const tsip_header_Security_Server_t *)tsip_message_get_headerAt(r401_407, tsip_htype_Security_Server, index)); index++)
{
tsip_header_Security_Verify_t* svHdr;
@ -212,16 +183,38 @@ copy:
TSK_DEBUG_ERROR("Invalid HOST/PORT [%s/%u].", self->asso_temporary->ctx->addr_remote, self->asso_temporary->ctx->port_ps);
goto bail;
}
if((ret = tnet_sockfd_connetto(self->asso_temporary->socket_uc->fd, (const struct sockaddr *)&to))){
if((ret = tnet_sockfd_connetto(self->asso_temporary->socket_uc->fd, &to))){
TSK_DEBUG_ERROR("Failed to connect port_uc to port_ps.");
goto bail;
}
bail:
return ret;
}
int tsip_transport_ipsec_startSAs(tsip_transport_ipsec_t* self, const tipsec_key_t* ik, const tipsec_key_t* ck)
{
int ret = -1;
if(!self){
goto bail;
}
if(!self->asso_temporary){
TSK_DEBUG_ERROR("Failed to find temporary SAs");
ret = -2;
goto bail;
}
/* Promote tempSAs (temp => active) */
TSK_OBJECT_SAFE_FREE(self->asso_active); /* delete old active SAs */
self->asso_active = tsk_object_ref((void*)self->asso_temporary); /* promote */
TSK_OBJECT_SAFE_FREE(self->asso_temporary); /* delete old temp SAs */
if(!(ret = tipsec_set_keys(self->asso_active->ctx, ik, ck))){
ret = tipsec_start(self->asso_active->ctx);
}
bail:
return ret;
}
@ -244,16 +237,69 @@ bail:
int tsip_transport_ipsec_updateMSG(tsip_transport_ipsec_t* self, tsip_message_t *msg)
{
int ret = -1;
const tsip_ipsec_association_t* asso;
if(!self){
goto bail;
}
asso = self->asso_temporary ? self->asso_temporary : self->asso_active;
if(!asso || !asso->ctx){
TSK_DEBUG_ERROR("No IPSec association found.");
ret = -2;
goto bail;
}
if(TSIP_MESSAGE_IS_RESPONSE(msg)){
return 0;
}
/* Add Security-Client header */
/* Security-Client, Require, Proxy-Require and Security Verify */
switch(msg->request_type)
{
case tsip_BYE:
case tsip_INVITE:
case tsip_OPTIONS:
case tsip_REGISTER:
case tsip_SUBSCRIBE:
case tsip_NOTIFY:
case tsip_REFER:
case tsip_INFO:
case tsip_UPDATE:
case tsip_MESSAGE:
case tsip_PUBLISH:
case tsip_PRACK:
{
const tsk_list_item_t *item;
TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_SECURITY_CLIENT_VA_ARGS("ipsec-3gpp",
TIPSEC_ALG_TO_STR(asso->ctx->alg),
TIPSEC_PROTOCOL_TO_STR(asso->ctx->protocol),
TIPSEC_MODE_TO_STR(asso->ctx->mode),
TIPSEC_EALG_TO_STR(asso->ctx->ealg),
asso->ctx->port_uc,
asso->ctx->port_us,
asso->ctx->spi_uc,
asso->ctx->spi_us
));
/* RFC 3329 - 2.3.1 Client Initiated
All the subsequent SIP requests sent by the client to that server
SHOULD make use of the security mechanism initiated in the previous
step. These requests MUST contain a Security-Verify header field
that mirrors the server's list received previously in the Security-
Server header field. These requests MUST also have both a Require
and Proxy-Require header fields with the value "sec-agree".
*/
tsk_list_foreach(item, self->secVerifies){
tsip_message_add_header(msg, (const tsip_header_t*)item->data);
}
TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_REQUIRE_VA_ARGS("sec-agree"));
TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_PROXY_REQUIRE_VA_ARGS("sec-agree"));
break;
}
}
ret = 0;
/* Add Security-Server headers */
bail:
return ret;
@ -392,14 +438,15 @@ static void* tsip_ipsec_association_create(void * self, va_list * app)
const tsip_transport_t* transport = va_arg(*app, const tsip_transport_t *);
tnet_ip_t ip;
tnet_ip_t ip_local;
tnet_ip_t ip_remote;
tnet_port_t port;
/* Set transport */
association->transport = transport;
/* Get local IP and port */
tsip_transport_get_ip_n_port(transport, &ip, &port);
/* Get local IP and port. */
tsip_transport_get_ip_n_port(transport, &ip_local, &port);
/* Create IPSec context */
association->ctx = TIPSEC_CONTEXT_CREATE(
@ -411,15 +458,20 @@ static void* tsip_ipsec_association_create(void * self, va_list * app)
TIPSEC_PROTOCOL_FROM_STR(TSIP_STACK(transport->stack)->secagree_ipsec.protocol));
/* Create Both client and Server legs */
association->socket_us = TNET_SOCKET_CREATE(ip, TNET_SOCKET_PORT_ANY, transport->type);
association->socket_uc = TNET_SOCKET_CREATE(ip, TNET_SOCKET_PORT_ANY, transport->type);
association->socket_us = TNET_SOCKET_CREATE(ip_local, TNET_SOCKET_PORT_ANY, transport->type);
association->socket_uc = TNET_SOCKET_CREATE(ip_local, TNET_SOCKET_PORT_ANY, transport->type);
/* Add Both sockets to the network transport */
tsip_transport_add_socket(transport, association->socket_us->fd, 0);
tsip_transport_add_socket(transport, association->socket_uc->fd, 0);
/* Set local */
tipsec_set_local(association->ctx, ip, TSIP_STACK(transport->stack)->proxy_cscf, association->socket_uc->port, association->socket_us->port);
if(!tnet_get_peerip(transport->connectedFD, &ip_remote)){ /* Get remote IP string */
tipsec_set_local(association->ctx, ip_local, ip_remote, association->socket_uc->port, association->socket_us->port);
}
else{
tipsec_set_local(association->ctx, ip_local, TSIP_STACK(transport->stack)->proxy_cscf, association->socket_uc->port, association->socket_us->port);
}
}
return self;
}

View File

@ -376,8 +376,7 @@ int tsip_transport_ensureTempSAs(const tsip_transport_layer_t *self, const tsip_
tsk_list_foreach(item, self->transports)
{
transport = item->data;
if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type))
{
if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
ret = tsip_transport_ipsec_ensureTempSAs(TSIP_TRANSPORT_IPSEC(transport), r401_407, expires);
break;
}
@ -387,6 +386,30 @@ bail:
return ret;
}
int tsip_transport_startSAs(const tsip_transport_layer_t* self, const void* ik, const void* ck)
{
int ret = -1;
tsk_list_item_t *item;
tsip_transport_t* transport;
if(!self){
goto bail;
}
tsk_list_foreach(item, self->transports)
{
transport = item->data;
if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
ret = tsip_transport_ipsec_startSAs(TSIP_TRANSPORT_IPSEC(transport), (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
break;
}
}
bail:
return ret;
}
int tsip_transport_cleanupSAs(const tsip_transport_layer_t *self)
{
int ret = -1;

View File

@ -140,7 +140,7 @@ void test_stack()
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
TSIP_STACK_SET_PRIVACY("header;id"),
*/
/*
tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@ericsson.com"),
@ -156,8 +156,8 @@ void test_stack()
TSIP_STACK_SET_DEVICE_ID("DD1289FA-C3D7-47bd-A40D-F1F1B2CC5FFC"),
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
TSIP_STACK_SET_PRIVACY("header;id"),
/*
*/
tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@ims.inexbee.com"),
@ -166,7 +166,7 @@ void test_stack()
TSIP_STACK_SET_REALM("sip:ims.inexbee.com"), // FIXME: without sip:
TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
//TSIP_STACK_SET_DISCOVERY_NAPTR(1),
TSIP_STACK_SET_PROXY_CSCF("pcscf.ims.inexbee.com", "tcp", 1),
TSIP_STACK_SET_PROXY_CSCF("pcscf.ims.inexbee.com", "udp", 1),
//TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
TSIP_STACK_SET_PROXY_CSCF_PORT(4060),
TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"),
@ -174,12 +174,11 @@ void test_stack()
TSIP_STACK_SET_DEVICE_ID("DD1289FA-C3D7-47bd-A40D-F1F1B2CC5FFC"),
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
TSIP_STACK_SET_PRIVACY("header;id"),
*/
TSIP_STACK_SET_NULL());
tsip_operation_handle_t *op = TSIP_OPERATION_CREATE(stack,
TSIP_OPERATION_SET_PARAM("expires", "30"),
TSIP_OPERATION_SET_PARAM("expires", "300"),
TSIP_OPERATION_SET_NULL());
@ -194,7 +193,7 @@ void test_stack()
tsip_register(stack, op);
tsk_thread_sleep(2000);
/*tsk_thread_sleep(2000);
{
tsip_operation_handle_t *op2 = TSIP_OPERATION_CREATE(stack,
@ -205,7 +204,7 @@ void test_stack()
TSIP_OPERATION_SET_NULL());
tsip_subscribe(stack, op2);
}
}*/
//{
// tsip_operation_handle_t *op3 = TSIP_OPERATION_CREATE(stack,

View File

@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(DOUBANGO_HOME)\thirdparties\win32\include&quot;;&quot;$(DOUBANGO_HOME)\tinySAK\src&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TINYIPSEC_EXPORTS"
PreprocessorDefinitions="DEBUG_LEVEL=DEBUG_LEVEL_INFO;WIN32;_DEBUG;_WINDOWS;_USRDLL;TINYIPSEC_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"