From: Michael Jerris Date: Wed, 11 Feb 2009 16:15:46 +0000 (+0000) Subject: Thu Jan 8 10:34:22 CST 2009 Pekka Pessi X-Git-Tag: v1.0.3~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3e2fcdbb5504279062c407c6b413ede3f7c9a70;p=thirdparty%2Ffreeswitch.git Thu Jan 8 10:34:22 CST 2009 Pekka Pessi * sip_security.c: allow multiple WWW-Authenticate and Authorization headers git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11775 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 7f67e07f81..46695c387c 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Feb 11 10:14:53 CST 2009 +Wed Feb 11 10:15:25 CST 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c b/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c index 744535e3d7..c6f655fce3 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c +++ b/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c @@ -128,7 +128,7 @@ */ msg_hclass_t sip_authorization_class[] = -SIP_HEADER_CLASS_AUTH(authorization, "Authorization", single); +SIP_HEADER_CLASS_AUTH(authorization, "Authorization", append); issize_t sip_authorization_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen) { @@ -309,7 +309,7 @@ issize_t sip_proxy_authorization_e(char b[], isize_t bsiz, sip_header_t const *h */ msg_hclass_t sip_www_authenticate_class[] = -SIP_HEADER_CLASS_AUTH(www_authenticate, "WWW-Authenticate", single); +SIP_HEADER_CLASS_AUTH(www_authenticate, "WWW-Authenticate", append); issize_t sip_www_authenticate_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen) { diff --git a/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c b/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c index c469540f6b..7c79310dd7 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c +++ b/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c @@ -128,6 +128,7 @@ static int test_identity(void) sip = sip_object(msg); + TEST_1(sip); TEST_1(!sip_alert_info(sip)); TEST_1(!sip_reply_to(sip)); TEST_1(!sip_p_asserted_identity(sip)); @@ -2283,6 +2284,8 @@ static int test_www_authenticate(void) sip_www_authenticate_t *www; su_home_t *home; char const *s; + msg_t *msg; sip_t *sip; + BEGIN(); TEST_1(home = su_home_create()); @@ -2300,6 +2303,29 @@ static int test_www_authenticate(void) TEST_1(strlen(s) >= 128); su_home_unref(home); + + TEST_1( + msg = read_message( + MSG_DO_EXTRACT_COPY, + "SIP/2.0 401 Unauthorized" "\r\n" + "Date: Wed, 07 Jan 2009 22:24:39 GMT" "\r\n" + "WWW-Authenticate: Kerberos realm=\"SIP Communications Service\", targetname=\"sip/OCS1.flux.local\", version=3" "\r\n" + "WWW-Authenticate: NTLM realm=\"SIP Communications Service\", targetname=\"OCS1.flux.local\", version=3" "\r\n" + "From: ;epid=1234567890;tag=48BXgr379e85j" "\r\n" + "To: ;transport=tls;tag=B57737091022903031FF204696B79CC4" "\r\n" + "Call-ID: cf12f708-57ac-122c-ad90-6f23d7babf4f" "\r\n" + "CSeq: 109565202 REGISTER" "\r\n" + "Via: SIP/2.0/TLS 192.168.43.1:5069;branch=z9hG4bK47ZUrFK0v5eQa;received=192.168.43.1;ms-received-port=54059;ms-received-cid=E500" "\r\n" + "Content-Length: 0" "\r\n")); + TEST_1(sip = sip_object(msg)); + + TEST_1(www = sip->sip_www_authenticate); + TEST_S(www->au_scheme, "Kerberos"); + TEST_1(www = www->au_next); + TEST_S(www->au_scheme, "NTLM"); + + msg_destroy(msg); + END(); }