Skip to content

Commit 47f39d5

Browse files
committed
Sort the leaves of the merkle tree for deterministic tree generation
Signed-off-by: marinamoore <[email protected]>
1 parent 69f8688 commit 47f39d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tuf/repository_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ def build_merkle_tree(fileinfodict):
16621662
# leaf contains snapshot information for a single metadata file.
16631663
leaves = []
16641664
nodes = []
1665-
for name, contents in fileinfodict.items():
1665+
for name, contents in sorted(fileinfodict.items()):
16661666
if name.endswith(".json"):
16671667
name = os.path.splitext(name)[0]
16681668
leaves.append(Leaf(name, contents))

0 commit comments

Comments
 (0)