From 4a5d807e0523ac8f59bd4878be3e1ab15fe9c237 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 30 Apr 2008 13:32:21 +0000 Subject: [PATCH] case insensitive in auth method checking (e.g. DIGEST). should authenticate against voipswitch now. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@918 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/plug-in/uac_auth/UACAuth.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/plug-in/uac_auth/UACAuth.cpp b/core/plug-in/uac_auth/UACAuth.cpp index 995787dd..a279fc3e 100644 --- a/core/plug-in/uac_auth/UACAuth.cpp +++ b/core/plug-in/uac_auth/UACAuth.cpp @@ -32,6 +32,9 @@ #include +#include +#include + #define MOD_NAME "uac_auth" EXPORT_SESSION_EVENT_HANDLER_FACTORY(UACAuthFactory, MOD_NAME); @@ -245,7 +248,10 @@ string UACAuth::find_attribute(const string& name, const string& header) { 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; }