X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8a646d926c4bfb1848cbd660e5218dea04a1bd63..04303ceb59b364aaff2c53a4b738481c68ded866:/contrib/kh2reg.py diff --git a/contrib/kh2reg.py b/contrib/kh2reg.py index 98f4868c..4e881861 100755 --- a/contrib/kh2reg.py +++ b/contrib/kh2reg.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -# $Id: kh2reg.py,v 1.3 2003/10/21 13:26:12 jacob Exp $ +# $Id$ # Convert OpenSSH known_hosts and known_hosts2 files to "new format" PuTTY # host keys. # usage: @@ -87,7 +87,7 @@ for line in fileinput.input(args): # is second field entirely decimal digits? if re.match (r"\d*$", fields[1]): - # Treat as SSH1-type host key. + # Treat as SSH-1-type host key. # Format: hostpat bits10 exp10 mod10 comment... # (PuTTY doesn't store the number of bits.) magicnumbers = map (long, fields[2:4]) @@ -95,7 +95,7 @@ for line in fileinput.input(args): else: - # Treat as SSH2-type host key. + # Treat as SSH-2-type host key. # Format: hostpat keytype keyblob64 comment... sshkeytype, blob = fields[1], base64.decodestring (fields[2]) @@ -128,6 +128,9 @@ for line in fileinput.input(args): sys.stderr.write("Skipping wildcard host pattern '%s'\n" % host) continue + elif re.match (r"\|", host): + sys.stderr.write("Skipping hashed hostname '%s'\n" % host) + continue else: # Slightly bizarre key format: 'type@port:hostname' # As far as I know, the input never specifies a port.