Skip to content

Commit

Permalink
Removed data parameter from to_string/to_file
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibling committed Jan 1, 2024
1 parent 5dc620e commit e0477ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sshkey_tools/signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def sign_file(self, path: str):
signable = self.get_signable_file(path)
self.fields.signature.sign(signable)

def to_string(self, data):
def to_string(self):
content = self.fields.bytes_out()
content = b64encode(content)
file_content = b"-----BEGIN SSH SIGNATURE-----\n"
Expand All @@ -235,7 +235,7 @@ def to_string(self, data):

return file_content

def to_file(self, data, path: str):
def to_file(self, path: str):
with open(path, 'wb') as f:
f.write(self.to_string(data))
f.write(self.to_string())

2 changes: 1 addition & 1 deletion validate_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# ecdsa_pub.verify(ecdsa_signable, ecdsa_sign.fields.signature.value)
# ecdsa_pub.to_file('testkeys/ecdsa.txt.sig2')
rsa_pub.verify(rsa_signable, rsa_sign.fields.signature.value)
rsa_sign.to_file(rsa_data, 'testkeys/rsa.txt.sig2')
rsa_sign.to_file('testkeys/rsa.txt.sig2')
# except:
# print("RSA validation failed")

Expand Down

0 comments on commit e0477ba

Please sign in to comment.