ascmitc / mhl

ASC Media Hash List
MIT License
58 stars 8 forks source link

A missing MHL in a History produces no warning during verification, and is not updated in the Chain file #119

Closed jmccdev closed 6 months ago

jmccdev commented 2 years ago

The data used for this is under /sources/106_chain_file/106a/ and /sources/106_chain_file/106b/ within the dataset on the G-Drive: https://drive.google.com/drive/folders/1PrAPczRFBQsVfjakbX-fqnDVHsAD-kd1

For 106a, the newest MHL file, 0002_16421225_Day001_2022-02-09_045418.mhl, was manually deleted. I ran the create command on the same root directory afterward:

$ ascmhl create -h md5 16421225_Day001/

There is no error message printed about the missing 0002 MHL. A new 0002 MHL is created and appended to the chain file.

$ cat ascmhl_chain.xml 
<?xml version="1.0" encoding="UTF-8"?>
<ascmhldirectory xmlns="urn:ASC:MHL:DIRECTORY:v2.0">
  <hashlist sequencer="1">
    <path>0001_16421225_Day001_2022-02-09_045325.mhl</path>
    <c4>c45W2waQd5KzDipR3jpy18UxhXQ8QRDXmjixVi7YxKQqGtnmJq4JT6vZgAYQzv8j8UXwgrLKNUNUhwz7hJ4tXtHh1M</c4>
  </hashlist>
  <hashlist sequencer="2">
    <path>0002_16421225_Day001_2022-02-09_045418.mhl</path>
    <c4>c43wCRs6nubsstfVgZsWoFhG4MWcmLD8NXW2gb5KmdNeHHFv44vYHg7kx3E8U3PE8E15Jvjbsyvdo9kgt7MEMYUR5m</c4>
  </hashlist>
  <hashlist sequencer="2">
    <path>0002_16421225_Day001_2022-02-15_180908.mhl</path>
    <c4>c41boAUUzEoWsLmuPkZR8qr7W3bpH4Dr2r9qwEQie67uUdqXJuKVS9HQFdsEai6DespcuCVBUr4CGChXxAHsDBTc24</c4>
  </hashlist>
</ascmhldirectory>

For 106b, the oldest MHL file, 0001_16421225_Day001_2022-02-09_045325.mhl, was manually deleted. I ran the create command on the same root directory afterward:

$ ascmhl create -h md5 16421225_Day001/

There is no error message printed about the missing 0001* MHL. It remains referenced in the chain file.

$ cat 16421225_Day001/ascmhl/ascmhl_chain.xml 
<?xml version="1.0" encoding="UTF-8"?>
<ascmhldirectory xmlns="urn:ASC:MHL:DIRECTORY:v2.0">
  <hashlist sequencer="1">
    <path>0001_16421225_Day001_2022-02-09_045325.mhl</path>
    <c4>c45W2waQd5KzDipR3jpy18UxhXQ8QRDXmjixVi7YxKQqGtnmJq4JT6vZgAYQzv8j8UXwgrLKNUNUhwz7hJ4tXtHh1M</c4>
  </hashlist>
  <hashlist sequencer="2">
    <path>0002_16421225_Day001_2022-02-09_045418.mhl</path>
    <c4>c43wCRs6nubsstfVgZsWoFhG4MWcmLD8NXW2gb5KmdNeHHFv44vYHg7kx3E8U3PE8E15Jvjbsyvdo9kgt7MEMYUR5m</c4>
  </hashlist>
  <hashlist sequencer="3">
    <path>0003_16421225_Day001_2022-02-15_181135.mhl</path>
    <c4>c45EsJnwcVsJ3HgpnYhXDWYtJVc5d2pZ7v7BtNzAG2zJYyLfm1ejXhCPQPHLt8WBrjLkTGf6txK5Ndw3Bdk3UHHiS1</c4>
  </hashlist>
</ascmhldirectory>
ptrpfn commented 2 years ago

That should actually be caught by a full verification the chain file. Currently the completeness of ASC MHL files and their consistency (hashes) are not verified against the chain file. That's a TBD.

There is already an issue #22 for the verification of chain files.

ptrpfn commented 6 months ago

Fixed in v1.0 (see https://github.com/ascmitc/mhl/releases/tag/v1.0 for details)