[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kioslave/http
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-09-24 17:22:56
Message-ID: 20040924172256.8A962990D () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

Change the order of authentications to the following:
Negotiate > Digest > NTLM > Basic


  M +8 -3      http.cc   1.626
  M +1 -1      http.h   1.164


--- kdelibs/kioslave/http/http.cc  #1.625:1.626
@@ -2386,9 +2386,9 @@ bool HTTPProtocol::httpOpen()
       if ( checkCachedAuthentication( info ) && !info.digestInfo.isEmpty() )
       {
-        Authentication = info.digestInfo.startsWith("Basic") ? AUTH_Basic : \
info.digestInfo.startsWith("NTLM") ? AUTH_NTLM : AUTH_Digest ; +        \
Authentication = info.digestInfo.startsWith("Basic") ? AUTH_Basic : \
info.digestInfo.startsWith("NTLM") ? AUTH_NTLM : \
info.digestInfo.startsWith("Negotiate") ? AUTH_Negotiate : AUTH_Digest ;  \
m_state.user   = info.username;  m_state.passwd = info.password;
         m_strRealm = info.realmValue;
-        if ( Authentication != AUTH_NTLM ) // don't use the cached challenge
+        if ( Authentication != AUTH_NTLM && Authentication != AUTH_Negotiate ) // \
don't use the cached challenge  m_strAuthorization = info.digestInfo;
       }
@@ -3419,5 +3419,5 @@ bool HTTPProtocol::readHeader()
         {
            // for NTLM Authentication we have to keep the connection open!
-           if ( (Authentication == AUTH_NTLM) && (m_prevResponseCode != 0) )
+           if ( (Authentication == AUTH_NTLM) && (m_strAuthorization.length() > 4) )
            {
              m_bKeepAlive = true;
@@ -4851,4 +4851,5 @@ void HTTPProtocol::configAuth( char *p, 
     memcpy((void *)p, "NTLM", 4); // Correct for upper-case variations.
     p += 4;
+    m_strRealm = "NTLM"; // set a dummy realm
   }
 #endif
@@ -5319,4 +5320,6 @@ QString HTTPProtocol::createNegotiateAut
   if (GSS_ERROR(major_status)) {
     kdDebug(7113) << "(" << m_pid << ") gss_import_name failed: " << \
gssError(major_status, minor_status) << endl; +    // reset the auth string so that \
subsequent methods aren't confused +    m_strAuthorization = QString::null;
     return QString::null;
   }
@@ -5337,4 +5340,6 @@ QString HTTPProtocol::createNegotiateAut
       ctx = GSS_C_NO_CONTEXT;
     }
+    // reset the auth string so that subsequent methods aren't confused
+    m_strAuthorization = QString::null;
     return QString::null;
   }

--- kdelibs/kioslave/http/http.h  #1.163:1.164
@@ -59,5 +59,5 @@ public:
 
   /** Authorization method used **/
-  enum HTTP_AUTH   {AUTH_None, AUTH_Basic, AUTH_Digest, AUTH_Negotiate, AUTH_NTLM};
+  enum HTTP_AUTH   {AUTH_None, AUTH_Basic, AUTH_NTLM, AUTH_Digest, AUTH_Negotiate};
 
   /** HTTP / DAV method **/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic