[CalendarServer-changes] [12620] twext/trunk/twext/who/opendirectory/_service.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:17:12 PDT 2014


Revision: 12620
          http://trac.calendarserver.org//changeset/12620
Author:   sagen at apple.com
Date:     2014-02-08 10:48:36 -0800 (Sat, 08 Feb 2014)
Log Message:
-----------
Send the proper response string to OD digest auth

Modified Paths:
--------------
    twext/trunk/twext/who/opendirectory/_service.py

Modified: twext/trunk/twext/who/opendirectory/_service.py
===================================================================
--- twext/trunk/twext/who/opendirectory/_service.py	2014-02-08 03:47:48 UTC (rev 12619)
+++ twext/trunk/twext/who/opendirectory/_service.py	2014-02-08 18:48:36 UTC (rev 12620)
@@ -673,25 +673,41 @@
             )
         )
 
-        print("username = {0!r}".format(username))
-        print("realm = {0!r}".format(realm))
-        print("uri = {0!r}".format(uri))
-        print("nonce = {0!r}".format(nonce))
-        print("cnonce = {0!r}".format(cnonce))
-        print("algorithm = {0!r}".format(algorithm))
-        print("nc = {0!r}".format(nc))
-        print("qop = {0!r}".format(qop))
-        print("response = {0!r}".format(response))
-        print("method = {0!r}".format(method))
-        print("challenge = {0!r}".format(challenge))
+        if qop:
+            responseArg = (
+                'username="%s",realm="%s",algorithm=%s,'
+                'nonce="%s",cnonce="%s",nc=%s,qop=%s,'
+                'digest-uri="%s",response=%s'
+                % (
+                    username, realm, algorithm, nonce, cnonce, nc, qop,
+                    uri, response
+                )
+            )
+        else:
+            responseArg = (
+                'Digest username="%s", uri="%s", response=%s'
+                % (username, uri, response)
+            )
 
+        # print("username = {0!r}".format(username))
+        # print("realm = {0!r}".format(realm))
+        # print("uri = {0!r}".format(uri))
+        # print("nonce = {0!r}".format(nonce))
+        # print("cnonce = {0!r}".format(cnonce))
+        # print("algorithm = {0!r}".format(algorithm))
+        # print("nc = {0!r}".format(nc))
+        # print("qop = {0!r}".format(qop))
+        # print("response = {0!r}".format(response))
+        # print("method = {0!r}".format(method))
+        # print("challenge = {0!r}".format(challenge))
+
         result, m1, m2, error = self._odRecord.verifyExtendedWithAuthenticationType_authenticationItems_continueItems_context_error_(
             ODAuthMethod.digestMD5.value,
-            [username, challenge, response, method],
+            [username, challenge, responseArg, method],
             None, None, None
         )
 
-        print(result, m1, m2, error)
+        # print(result, m1, m2, error)
 
         if error:
             return succeed(False)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/f28177be/attachment.html>


More information about the calendarserver-changes mailing list