[SR-Dev] TLS patch for the TM module

Andrei Pelinescu-Onciul andrei at iptel.org
Thu May 21 12:44:13 CEST 2009


On May 21, 2009 at 08:23, Nils Ohlmeier <lists at ohlmeier.org> wrote:
> Hi,
> 
> while testing TLS at SIPit 24 I encoutered the following problem:
> 
> Two UAs were successfully registered via TLS connections and they had
> Contacts with just IP addresses and the transport parameter set to TLS.
> If one UA tried to call the other the INVITE was rejected by the TM
> module with the following log message:
> 
> ERROR: uri2dst: bad transport  for sips uri: 3
> 
> So when I looked up which is transport 3 I was surprised to see the 3 is
> actually TLS. Which is absolutely the right transport for a SIPS URI.
> The if condition before this error message checks if the transport is
> equal to TCP. This makes no sense to me.

"transport=tls" in a sips uri is deprecated, while "transport=tcp" or
 "transport=sctp" are allowed.
> 
> Thus I assume that this if condition was just a typo and created the
> attached patch which fixes this issue in 3 places in ut.h.

According to the rfc, tcp and sctp should be allowed.
We don't loose anything if we allow also "tls", even if its deprecated,
so we should change the if()s to proto!=PROTO_UDP.

Andrei

> 
> Please let me know if I can commit the attached patch.
> 
> Cheers
>   Nils

> Index: ut.h
> ===================================================================
> RCS file: /cvsroot/ser/sip_router/modules/tm/ut.h,v
> retrieving revision 1.26
> diff -a -u -r1.26 ut.h
> --- ut.h	11 Aug 2008 17:41:16 -0000	1.26
> +++ ut.h	21 May 2009 08:13:24 -0000
> @@ -123,7 +123,7 @@
>  	}
>  	
>  	if (parsed_uri.type==SIPS_URI_T){
> -		if ((parsed_uri.proto!=PROTO_TCP) && (parsed_uri.proto!=PROTO_NONE)){
> +		if ((parsed_uri.proto!=PROTO_TLS) && (parsed_uri.proto!=PROTO_NONE)){
>  			LOG(L_ERR, "ERROR: uri2proxy: bad transport  for sips uri: %d\n",
>  					parsed_uri.proto);
>  			return 0;
> @@ -181,7 +181,7 @@
>  	}
>  	
>  	if (parsed_uri.type==SIPS_URI_T){
> -		if ((parsed_uri.proto!=PROTO_TCP) && (parsed_uri.proto!=PROTO_NONE)){
> +		if ((parsed_uri.proto!=PROTO_TLS) && (parsed_uri.proto!=PROTO_NONE)){
>  			LOG(L_ERR, "ERROR: get_uri_send_info: bad transport  for"
>  						" sips uri: %d\n", parsed_uri.proto);
>  			return -1;
> @@ -254,7 +254,7 @@
>  	}
>  	
>  	if (parsed_uri.type==SIPS_URI_T){
> -		if ((parsed_uri.proto!=PROTO_TCP) && (parsed_uri.proto!=PROTO_NONE)){
> +		if ((parsed_uri.proto!=PROTO_TLS) && (parsed_uri.proto!=PROTO_NONE)){
>  			LOG(L_ERR, "ERROR: uri2dst: bad transport  for sips uri: %d\n",
>  					parsed_uri.proto);
>  			return 0;

> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




More information about the sr-dev mailing list