Skip to content

Commit

Permalink
tools/tinyssh-convert fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janmojzis committed May 15, 2021
1 parent a46acb1 commit 21cc10f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/tinyssh-convert
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Parser:
"""

if (4 > len(self.data)):
raise Exception("unable to parse OpenSSH key: bad ssh-num {text}")
raise Exception(f"unable to parse OpenSSH key: bad ssh-num {text}")

num = struct.unpack('>I', self.data[:4])[0]
self.data = self.data[4:]
Expand All @@ -55,7 +55,7 @@ class Parser:
num = self.parse_num(text)

if (num > len(self.data)):
raise Exception("unable to parse OpenSSH key: bad ssh-string {text}")
raise Exception(f"unable to parse OpenSSH key: bad ssh-string {text}")

ret = self.data[:num]
self.data = self.data[num:]
Expand Down Expand Up @@ -145,9 +145,9 @@ if __name__ == "__main__":
if sklen != 64:
raise Exception(f"unable to parse OpenSSH key: secret-key length={sklen}: not 64")

os.umask(0o022)
os.umask(0o0022)
os.mkdir(d)
os.chdir(d)
writesync("ed25519.pk", pk)
os.umask(0o077)
os.umask(0o0077)
writesync(".ed25519.sk", sk)

0 comments on commit 21cc10f

Please sign in to comment.