]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Thu Jan 8 10:34:22 CST 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:15:46 +0000 (16:15 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:15:46 +0000 (16:15 +0000)
  * 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

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c
libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c

index 7f67e07f811ec64189d4ebf1727666d26ac40317..46695c387cef497f506c8d01beae6a655ca124f6 100644 (file)
@@ -1 +1 @@
-Wed Feb 11 10:14:53 CST 2009
+Wed Feb 11 10:15:25 CST 2009
index 744535e3d7bd6574d5be96c842136cf38b31b0d8..c6f655fce3bf5bb13647c7fe4cdc0a6b87d526e7 100644 (file)
  */
 
 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)
 {
index c469540f6b638d03d1746e08051b613c9525df28..7c79310dd77d681a8ec0ccf998dfc9bda2526d53 100644 (file)
@@ -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: <sip:192.168.43.1:5069>;epid=1234567890;tag=48BXgr379e85j" "\r\n"
+      "To: <sip:1234@192.168.43.20:5061>;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();
 }