1
# -*- test-case-name: twisted.test.test_newcred -*-
2
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
3
# See LICENSE for details.
6
Outdated, deprecated functionality related to challenge-based authentication.
8
Seek a solution to your problem elsewhere. This module is deprecated.
12
import random, warnings
14
from twisted.python.hashlib import md5
15
from twisted.cred.error import Unauthorized
18
def respond(challenge, password):
19
"""Respond to a challenge.
20
This is useful for challenge/response authentication.
23
"twisted.cred.util.respond is deprecated since Twisted 8.3.",
24
category=PendingDeprecationWarning,
28
hashedPassword = m.digest()
30
m.update(hashedPassword)
32
doubleHashedPassword = m.digest()
33
return doubleHashedPassword
36
"""I return some random data.
39
"twisted.cred.util.challenge is deprecated since Twisted 8.3.",
40
category=PendingDeprecationWarning,
43
for x in range(random.randrange(15,25)):
44
crap = crap + chr(random.randint(65,90))
45
crap = md5(crap).digest()