summaryrefslogtreecommitdiff
path: root/paramiko/ber.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2004-04-05 19:36:40 +0000
committerRobey Pointer <robey@lag.net>2004-04-05 19:36:40 +0000
commitc6d5ba9c5225b119bd718b4fbc1523dc9b3a3926 (patch)
treed611d1a1d8d82ede5af4a172b3e382ce2a22cb5d /paramiko/ber.py
parent70faf02f3eb9ecd6d33f23881fca9b9057ff297f (diff)
downloadparamiko-c6d5ba9c5225b119bd718b4fbc1523dc9b3a3926.tar.gz
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-40]
add dss key generation too, and fix some bugs added the ability to generate dss keys and write private dss key files, similar to rsa. in the process, fixed a couple of bugs with ber encoding and writing password-encrypted key files. the key has to be padded to the iblock size of the cipher -- it's very difficult to determine how the others do this, so i just add random bytes to the end. fixed the simple demo to use Transport's (host, port) constructor for simplicity, and fixed a bug where the standard demo's DSS login wouldn't work. also, move the common logfile setup crap into util so all the demos can just call that one.
Diffstat (limited to 'paramiko/ber.py')
-rw-r--r--paramiko/ber.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paramiko/ber.py b/paramiko/ber.py
index dc04c1a5..c03d1a88 100644
--- a/paramiko/ber.py
+++ b/paramiko/ber.py
@@ -67,7 +67,7 @@ class BER(object):
t = size & 0x7f
if self.idx + t > len(self.content):
return None
- size = self.inflate_long(self.content[self.idx : self.idx + t], True)
+ size = util.inflate_long(self.content[self.idx : self.idx + t], True)
self.idx += t
if self.idx + size > len(self.content):
# can't fit
@@ -116,7 +116,7 @@ class BER(object):
elif type(x) is str:
self.encode_tlv(4, x)
elif (type(x) is list) or (type(x) is tuple):
- self.encode_tlv(30, self.encode_sequence(x))
+ self.encode_tlv(0x30, self.encode_sequence(x))
else:
raise BERException('Unknown type for encoding: %s' % repr(type(x)))