'Parses the server challenge.
Splits the challenge into a dictionary of directives with values.
@return: challenge directives and their values.
@rtype: C{dict} of C{str} to C{str}.'

def _parse(self, challenge):

    s = challenge
    paramDict = {}
    cur = 0
    remainingParams = True
    while remainingParams:
        middle = s.index('=', cur)
        name = s[cur:middle].lstrip()
        middle += 1
        if (s[middle:(middle + 1)] == '"'):
            middle += 1
            end = s.index('"', middle)
            value = s[middle:end]
            cur = (s.find(',', end) + 1)
            if (cur == 0):
                remainingParams = False
        else:
            end = s.find(',', middle)
            if (end == (-1)):
                value = s[middle:].rstrip()
                remainingParams = False
            else:
                value = s[middle:end].rstrip()
            cur = (end + 1)
        paramDict[name] = value
    for param in ('qop', 'cipher'):
        if (param in paramDict):
            paramDict[param] = paramDict[param].split(',')
    return paramDict
