Skip to content

Commit bc8a95f

Browse files
committed
Sort the leaves of the merkle tree for deterministic tree generation
Signed-off-by: marinamoore <mnm678@gmail.com>
1 parent 52c8df7 commit bc8a95f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tuf/repository_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ def build_merkle_tree(fileinfodict):
16401640
# leaf contains snapshot information for a single metadata file.
16411641
leaves = []
16421642
nodes = []
1643-
for name, contents in fileinfodict.items():
1643+
for name, contents in sorted(fileinfodict.items()):
16441644
if name.endswith(".json"):
16451645
name = os.path.splitext(name)[0]
16461646
leaves.append(Leaf(name, contents))

0 commit comments

Comments
 (0)