Issue #985 new

Patch: Case issue for the string md5

Anonymous created an issue

Since this Trac doesn't seem to accept attachments, you can get the patch from this non-expiring pastebin: http://zlin.dk/p/?NDdmZDRj

Reported by philantrop@exherbo.org

Comments (1)

  1. Anonymous

    Any chance to get this really trivial fix in? Here's the patch in text format to show how simple it really is:

    From 5624ca873e2423b82a64336ac8de2b36d0d7b128 Mon Sep 17 00:00:00 2001
    From: Wulf C. Krueger <philantrop@exherbo.org>
    Date: Sun, 7 Feb 2010 17:36:20 +0100
    Subject: [PATCH 1/2] Fix a case issue for the md5 string.
    
    ---
     cherrypy/lib/httpauth.py |    5 +++--
     1 files changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/cherrypy/lib/httpauth.py b/cherrypy/lib/httpauth.py
    index 083f4c5..9000d71 100644
    --- a/cherrypy/lib/httpauth.py
    +++ b/cherrypy/lib/httpauth.py
    @@ -75,7 +75,7 @@ MD5_SESS = "MD5-sess"
     AUTH = "auth"
     AUTH_INT = "auth-int"
     
    -SUPPORTED_ALGORITHM = (MD5, MD5_SESS)
    +SUPPORTED_ALGORITHM = ('md5', MD5, MD5_SESS)
     SUPPORTED_QOP = (AUTH, AUTH_INT)
     
     ################################################################################
    @@ -83,6 +83,7 @@ SUPPORTED_QOP = (AUTH, AUTH_INT)
     #
     DIGEST_AUTH_ENCODERS = {
         MD5: lambda val: md5(val).hexdigest(),
    +    'md5': lambda val:md5(val).hexdigest(),
         MD5_SESS: lambda val: md5(val).hexdigest(),
     #    SHA: lambda val: sha(val).hexdigest(),
     }
    @@ -224,7 +225,7 @@ def _A1(params, password):
         algorithm = params.get ("algorithm", MD5)
         H = DIGEST_AUTH_ENCODERS[algorithm]
     
    -    if algorithm == MD5:
    +    if algorithm in (MD5, 'md5'):
             # If the "algorithm" directive's value is "MD5" or is
             # unspecified, then A1 is:
             # A1 = unq(username-value) ":" unq(realm-value) ":" passwd
    -- 
    1.6.6.1
    
  2. Log in to comment