2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3
# See LICENSE for details.
8
Utility functions for authorization.
10
These are currently for challenge-response shared secret authentication.
12
Maintainer: U{Glyph Lefkowitz<mailto:glyph@twistedmatrix.com>}
14
Stability: semi-stable
22
from twisted.cred.error import Unauthorized
24
def respond(challenge, password):
25
"""Respond to a challenge.
26
This is useful for challenge/response authentication.
30
hashedPassword = m.digest()
32
m.update(hashedPassword)
34
doubleHashedPassword = m.digest()
35
return doubleHashedPassword
38
"""I return some random data.
41
for x in range(random.randrange(15,25)):
42
crap = crap + chr(random.randint(65,90))
43
crap = md5.new(crap).digest()