diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-12-31 21:59:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-07 22:39:54 +0100 |
| commit | b5b43edd57380a8dea82188cfb4bdd977623c934 (patch) | |
| tree | c812bc75cb4275ca747fd3e30d6d5031789d5fb2 /src | |
| parent | 363aee4c9c019c69022aa8e54fccf47682f5e247 (diff) | |
Cleanup: extract verify_pkl().
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/verify.cc b/src/verify.cc index eb44fc25..2cfd283e 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1606,6 +1606,26 @@ verify_cpl( } +static +void +verify_pkl( + shared_ptr<const DCP> dcp, + shared_ptr<const PKL> pkl, + boost::filesystem::path xsd_dtd_directory, + vector<VerificationNote>& notes + ) +{ + validate_xml(pkl->file().get(), xsd_dtd_directory, notes); + if (pkl_has_encrypted_assets(dcp, pkl)) { + cxml::Document doc("PackingList"); + doc.read_file(pkl->file().get()); + if (!doc.optional_node_child("Signature")) { + notes.push_back({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT, pkl->id(), pkl->file().get()}); + } + } +} + + vector<VerificationNote> dcp::verify ( vector<boost::filesystem::path> directories, @@ -1666,15 +1686,8 @@ dcp::verify ( } for (auto pkl: dcp->pkls()) { - stage ("Checking PKL", pkl->file()); - validate_xml (pkl->file().get(), *xsd_dtd_directory, notes); - if (pkl_has_encrypted_assets(dcp, pkl)) { - cxml::Document doc ("PackingList"); - doc.read_file (pkl->file().get()); - if (!doc.optional_node_child("Signature")) { - notes.push_back ({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT, pkl->id(), pkl->file().get()}); - } - } + stage("Checking PKL", pkl->file()); + verify_pkl(dcp, pkl, *xsd_dtd_directory, notes); } if (dcp->asset_map_path()) { |
