mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
kh2reg: stop using deprecated base64.decodestring.
Python 3 gave me a warning that I should have been using decodebytes instead.
This commit is contained in:
parent
143f8a2d10
commit
1efded20a1
@ -73,8 +73,8 @@ class HMAC(object):
|
|||||||
def openssh_hashed_host_match(hashed_host, try_host):
|
def openssh_hashed_host_match(hashed_host, try_host):
|
||||||
if hashed_host.startswith(b'|1|'):
|
if hashed_host.startswith(b'|1|'):
|
||||||
salt, expected = hashed_host[3:].split(b'|')
|
salt, expected = hashed_host[3:].split(b'|')
|
||||||
salt = base64.decodestring(salt)
|
salt = base64.decodebytes(salt)
|
||||||
expected = base64.decodestring(expected)
|
expected = base64.decodebytes(expected)
|
||||||
mac = HMAC(hashlib.sha1, 64)
|
mac = HMAC(hashlib.sha1, 64)
|
||||||
else:
|
else:
|
||||||
return False # unrecognised magic number prefix
|
return False # unrecognised magic number prefix
|
||||||
@ -232,7 +232,7 @@ def handle_line(line, output_formatter, try_hosts):
|
|||||||
|
|
||||||
# Treat as SSH-2-type host key.
|
# Treat as SSH-2-type host key.
|
||||||
# Format: hostpat keytype keyblob64 comment...
|
# Format: hostpat keytype keyblob64 comment...
|
||||||
sshkeytype, blob = fields[1], base64.decodestring(
|
sshkeytype, blob = fields[1], base64.decodebytes(
|
||||||
fields[2].encode("ASCII"))
|
fields[2].encode("ASCII"))
|
||||||
|
|
||||||
# 'blob' consists of a number of
|
# 'blob' consists of a number of
|
||||||
|
Loading…
Reference in New Issue
Block a user