diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-06 01:02:38 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-06 01:02:38 +0000 |
| commit | 6fe4ee0c270eb88b046294895ee164ba4853c577 (patch) | |
| tree | 3f63b397b8b448248edc90badfe04655de7fff3d /src | |
| parent | b7257aefd5e7c3904e34b78b384c7577751df812 (diff) | |
Check CPL hash in the PKL on verify.
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/verify.cc b/src/verify.cc index 984cdf4a..bd61124c 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -115,6 +115,15 @@ dcp::verify (vector<boost::filesystem::path> directories, function<void (string, BOOST_FOREACH (shared_ptr<CPL> cpl, dcp->cpls()) { stage ("Checking CPL", cpl->file()); + + /* Check that the CPL's hash corresponds to the PKL */ + BOOST_FOREACH (shared_ptr<PKL> i, dcp->pkls()) { + optional<string> h = i->hash(cpl->id()); + if (h && make_digest(Data(*cpl->file())) != *h) { + notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, "CPL hash is incorrect.")); + } + } + BOOST_FOREACH (shared_ptr<Reel> reel, cpl->reels()) { stage ("Checking reel", optional<boost::filesystem::path>()); if (reel->main_picture()) { |
