diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-01-19 00:05:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-19 00:10:24 +0100 |
| commit | 37631b4d5e07eddbf052c1cff315d6a98b3bcb73 (patch) | |
| tree | 546879f1ee943523ad6bce3cb79ede2e274baf60 /test | |
| parent | 49b30838def07c225481def5e54458c22f6ceece (diff) | |
Bv2.1 9.2: PKL must be signed if it contains encrypted assets.
Diffstat (limited to 'test')
| -rw-r--r-- | test/verify_test.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc index 265529bb..f0c6b644 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -196,6 +196,7 @@ void check_verify_result (vector<boost::filesystem::path> dir, vector<dcp::VerificationNote> test_notes) { auto notes = dcp::verify ({dir}, &stage, &progress, xsd_test); + dump_notes (notes); BOOST_REQUIRE_EQUAL (notes.size(), test_notes.size()); } @@ -2577,3 +2578,47 @@ BOOST_AUTO_TEST_CASE (verify_encrypted_cpl_is_signed) }); } + +BOOST_AUTO_TEST_CASE (verify_encrypted_pkl_is_signed) +{ + boost::filesystem::path dir = "build/test/verify_encrypted_pkl_is_signed"; + prepare_directory (dir); + for (auto i: boost::filesystem::directory_iterator("test/ref/DCP/encryption_test")) { + boost::filesystem::copy_file (i.path(), dir / i.path().filename()); + } + + { + Editor e (dir / "pkl_93182bd2-b1e8-41a3-b5c8-6e6564273bff.xml"); + e.delete_lines ("<dsig:Signature", "</dsig:Signature>"); + } + + check_verify_result ( + {dir}, + { + { dcp::VerificationNote::VERIFY_BV21_ERROR, dcp::VerificationNote::PKL_ANNOTATION_TEXT_DOES_NOT_MATCH_CPL_CONTENT_TITLE_TEXT }, + { dcp::VerificationNote::VERIFY_ERROR, dcp::VerificationNote::MISSING_FFEC_IN_FEATURE }, + { dcp::VerificationNote::VERIFY_ERROR, dcp::VerificationNote::MISSING_FFMC_IN_FEATURE }, + { dcp::VerificationNote::VERIFY_WARNING, dcp::VerificationNote::MISSING_FFOC }, + { dcp::VerificationNote::VERIFY_WARNING, dcp::VerificationNote::MISSING_LFOC }, + { dcp::VerificationNote::VERIFY_WARNING, dcp::VerificationNote::MISSING_CPL_METADATA }, + { dcp::VerificationNote::VERIFY_BV21_ERROR, dcp::VerificationNote::PKL_WITH_ENCRYPTED_CONTENT_NOT_SIGNED } + }); +} + + +BOOST_AUTO_TEST_CASE (verify_unencrypted_pkl_can_be_unsigned) +{ + boost::filesystem::path dir = "build/test/verify_unencrypted_pkl_can_be_unsigned"; + prepare_directory (dir); + for (auto i: boost::filesystem::directory_iterator("test/ref/DCP/dcp_test1")) { + boost::filesystem::copy_file (i.path(), dir / i.path().filename()); + } + + { + Editor e (dir / "pkl_2b9b857f-ab4a-440e-a313-1ace0f1cfc95.xml"); + e.delete_lines ("<dsig:Signature", "</dsig:Signature>"); + } + + check_verify_result ({dir}, {}); +} + |
