Skip to content

Commit 7c18cbb

Browse files
committed
Remove uses of keyid_hash_algorithms
PR #1014 removed uses of keyid_hash_algorithms in favour of using the calculated keyid values from the metadata. A few instances of this removal were unintentionally reintroduced in PR #1016, when changing to explicitly passing a list of hash algorithms rather than changing securesystemslib settings values. This change removes uneccessary uses of keyid_hash_algorithms. Signed-off-by: Joshua Lock <jlock@vmware.com>
1 parent c4617ff commit 7c18cbb

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

tuf/client/updater.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,7 @@ def _import_delegations(self, parent_role):
952952
# We specify the keyid to ensure that it's the correct keyid
953953
# for the key.
954954
try:
955-
key, _ = securesystemslib.keys.format_metadata_to_key(keyinfo, keyid,
956-
keyid_hash_algorithms=keyinfo['keyid_hash_algorithms'])
955+
key, _ = securesystemslib.keys.format_metadata_to_key(keyinfo, keyid)
957956

958957
tuf.keydb.add_key(key, repository_name=self.repository_name)
959958

tuf/keydb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def create_keydb_from_root_metadata(root_metadata, repository_name='default'):
123123
# All other keyids returned are ignored.
124124

125125
key_dict, _ = securesystemslib.keys.format_metadata_to_key(key_metadata,
126-
keyid, keyid_hash_algorithms=key_metadata['keyid_hash_algorithms'])
126+
keyid)
127127

128128
# Make sure to update key_dict['keyid'] to use one of the other valid
129129
# keyids, otherwise add_key() will have no reference to it.

tuf/repository_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def _load_top_level_metadata(repository, top_level_filenames, repository_name):
652652

653653
# Use the keyid found in the delegation
654654
key_object, _ = securesystemslib.keys.format_metadata_to_key(key_metadata,
655-
keyid, keyid_hash_algorithms=key_metadata['keyid_hash_algorithms'])
655+
keyid)
656656

657657
# Add 'key_object' to the list of recognized keys. Keys may be shared,
658658
# so do not raise an exception if 'key_object' has already been loaded.

0 commit comments

Comments
 (0)