summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/client.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-06-21 01:00:17 (GMT)
committerGuido van Rossum <guido@python.org>1995-06-21 01:00:17 (GMT)
commit45babef8c28f7756bc751bda0f261fc68a7b1e18 (patch)
tree7d392dd78c21635871d101603a40fe7ae623e995 /Demo/pdist/client.py
parent37a291180c7340f6e748ea3584beb5b8023fa2e7 (diff)
downloadcpython-45babef8c28f7756bc751bda0f261fc68a7b1e18.zip
cpython-45babef8c28f7756bc751bda0f261fc68a7b1e18.tar.gz
cpython-45babef8c28f7756bc751bda0f261fc68a7b1e18.tar.bz2
security stuff added
Diffstat (limited to 'Demo/pdist/client.py')
-rwxr-xr-xDemo/pdist/client.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py
index 4b5cfc5..b644180 100755
--- a/Demo/pdist/client.py
+++ b/Demo/pdist/client.py
@@ -120,6 +120,23 @@ class Client:
self._wf.flush()
+from security import Security
+
+
+class SecureClient(Client, Security):
+
+ def __init__(self, *args):
+ import string
+ apply(Client.__init__, (self,) + args)
+ Security.__init__(self)
+ line = self._rf.readline()
+ challenge = string.atoi(string.strip(firstline))
+ response = self._encode_challenge(challenge)
+ line = `long(response)`
+ if line[-1] in 'Ll': line = line[:-1]
+ self._wf.write(line + '\n')
+ self._wf.flush()
+
class _stub:
"""Helper class for Client -- each instance serves as a method of the client."""