Skip to content

Commit

Permalink
make hashes lowercase on import from XML for improved robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrpfn committed Sep 24, 2024
1 parent ac0188f commit 2658f25
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ascmhl/hashlist_xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ def parse(file_path):
else:
# find right hash entry and set structure hash
entry = current_object.find_hash_entry_for_format(tag)
entry.structure_hash_string = element.text
entry.structure_hash_string = (
element.text.lower()
) # lower() for improved robustness for uppercase hashes in manifests (which is actually covered in the spec unambiguously)

else:
entry = MHLHashEntry(tag, element.text, element.attrib.get("action"), hash_date)
entry = MHLHashEntry(
tag, element.text.lower(), element.attrib.get("action"), hash_date
) # lower() for improved robustness for uppercase hashes in manifests (which is actually covered in the spec unambiguously)
current_object.append_hash_entry(entry)

elif tag == "hash" or tag == "directoryhash":
Expand Down

0 comments on commit 2658f25

Please sign in to comment.