Skip to content

Commit

Permalink
Pass canonicalized bytest to sslib signature funcs
Browse files Browse the repository at this point in the history
secure-systems-lab/securesystemslib#162 removes data
canonicalization and encoding from signature creation/verification
functions and leaves it to the caller.

This commit changes invocation of sslib signature
creation/verification functions to pass the pre-canonicalized and
-encoded bytes representation of a signable instead of its
dictionary representation, which aligns with the way it calls
gpg signature creation/verification functions.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
  • Loading branch information
lukpueh committed Sep 3, 2019
1 parent 9c374a9 commit 864d4e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions in_toto/models/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def sign(self, key):
securesystemslib.formats.KEY_SCHEMA.check_match(key)

signature = securesystemslib.keys.create_signature(key,
self.signed.signable_dict)
self.signed.signable_bytes)

self.signatures.append(signature)

Expand Down Expand Up @@ -268,7 +268,7 @@ def verify_signature(self, verification_key):

elif securesystemslib.formats.SIGNATURE_SCHEMA.matches(signature):
valid = securesystemslib.keys.verify_signature(
verification_key, signature, self.signed.signable_dict)
verification_key, signature, self.signed.signable_bytes)

else:
valid = False
Expand Down

0 comments on commit 864d4e2

Please sign in to comment.