Author: sayer
Date: 2008-04-30 15:32:21 +0200 (Wed, 30 Apr 2008)
New Revision: 918

Modified:
   trunk/core/plug-in/uac_auth/UACAuth.cpp
Log:
case insensitive in auth method checking (e.g. DIGEST). should authenticate 
against voipswitch now.

Modified: trunk/core/plug-in/uac_auth/UACAuth.cpp
===================================================================
--- trunk/core/plug-in/uac_auth/UACAuth.cpp     2008-04-30 00:29:08 UTC (rev 
917)
+++ trunk/core/plug-in/uac_auth/UACAuth.cpp     2008-04-30 13:32:21 UTC (rev 
918)
@@ -32,6 +32,9 @@
 
 #include <map>
 
+#include <cctype>
+#include <algorithm>
+
 #define MOD_NAME "uac_auth"
 
 EXPORT_SESSION_EVENT_HANDLER_FACTORY(UACAuthFactory, MOD_NAME);
@@ -245,7 +248,10 @@
 
 bool UACAuth::parse_header(const string& auth_hdr, UACAuthDigestChallenge& 
challenge) {
   size_t p = auth_hdr.find_first_not_of(' ');
-  if (auth_hdr.substr(p, 6) != "Digest") {
+  string method = auth_hdr.substr(p, 6);
+  std::transform(method.begin(), method.end(), method.begin(), 
+                (int(*)(int)) toupper);
+  if (method != "DIGEST") {
     ERROR("only Digest auth supported\n");
     return false;
   }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to