summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-12-29 17:01:01 +0100
committerCarl Hetherington <cth@carlh.net>2024-12-30 14:29:26 +0100
commitae974e61591442a54738d8690bbfcf956ed2a063 (patch)
tree925a82a143ab0906c507979bce452908e51500fe
parentdcc552b9edfdead0736cdf54ada4a6a479e09016 (diff)
Don't give some inappropriate verification errors on encrypted assets (DoM #2916).v1.10.2
We would give some errors about the XML even though we can't read the XML.
-rw-r--r--src/verify.cc14
-rw-r--r--test/verify_test.cc37
2 files changed, 46 insertions, 5 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 68f838cf..6a4dba7d 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -689,7 +689,8 @@ verify_smpte_timed_text_asset (
{
if (asset->language()) {
verify_language_tag(context, *asset->language());
- } else {
+ } else if (asset->raw_xml()) {
+ /* Raise this error only if we can access the raw XML (i.e. the asset was unencrypted or has been decrypted) */
context.bv21_error(VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE, *asset->file());
}
@@ -710,10 +711,13 @@ verify_smpte_timed_text_asset (
context.bv21_error(VerificationNote::Code::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES, raw_convert<string>(total_size), asset->file().get());
}
- if (!asset->start_time()) {
- context.bv21_error(VerificationNote::Code::MISSING_SUBTITLE_START_TIME, asset->file().get());
- } else if (asset->start_time() != Time()) {
- context.bv21_error(VerificationNote::Code::INVALID_SUBTITLE_START_TIME, asset->file().get());
+ if (asset->raw_xml()) {
+ /* Raise these errors only if we can access the raw XML (i.e. the asset was unencrypted or has been decrypted) */
+ if (!asset->start_time()) {
+ context.bv21_error(VerificationNote::Code::MISSING_SUBTITLE_START_TIME, asset->file().get());
+ } else if (asset->start_time() != Time()) {
+ context.bv21_error(VerificationNote::Code::INVALID_SUBTITLE_START_TIME, asset->file().get());
+ }
}
if (reel_asset_duration && *reel_asset_duration != asset->intrinsic_duration()) {
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 72e84f29..b3534d97 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -5798,6 +5798,43 @@ BOOST_AUTO_TEST_CASE(verify_encrypted_smpte_dcp)
}
+/** Check that we don't get any strange errors when verifying encrypted DCPs without a KDM (DoM #2916) */
+BOOST_AUTO_TEST_CASE(verify_encrypted_smpte_dcp_without_kdm)
+{
+ auto const dir = path("build/test/verify_encrypted_smpte_dcp_without_kdm");
+ dcp::Key key;
+ auto key_id = dcp::make_uuid();
+ auto cpl = dcp_with_text<dcp::ReelSMPTETextAsset>(dcp::TextType::OPEN_SUBTITLE, dir, {{ 4 * 24, 5 * 24 }}, key, key_id);
+
+ path const pkl_file = find_file(dir, "pkl_");
+ path const cpl_file = find_file(dir, "cpl_");
+
+ check_verify_result(
+ { dir },
+ {},
+ {
+ ok(dcp::VerificationNote::Code::MATCHING_PKL_ANNOTATION_TEXT_WITH_CPL, cpl),
+ ok(dcp::VerificationNote::Code::MATCHING_CPL_HASHES, cpl),
+ ok(dcp::VerificationNote::Code::ALL_ENCRYPTED, cpl),
+ ok(dcp::VerificationNote::Code::VALID_CONTENT_KIND, string{"trailer"}, cpl),
+ ok(dcp::VerificationNote::Code::VALID_CONTENT_VERSION_LABEL_TEXT, cpl->content_version()->label_text, cpl),
+ ok(dcp::VerificationNote::Code::VALID_CPL_ANNOTATION_TEXT, string{"hello"}, cpl),
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED
+ ).set_cpl_id(cpl->id()),
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED
+ ).set_cpl_id(cpl->id()),
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED
+ ).set_cpl_id(cpl->id()),
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::MISSING_CPL_METADATA, canonical(cpl_file)
+ ).set_cpl_id(cpl->id()),
+ });
+}
+
+
BOOST_AUTO_TEST_CASE(verify_invalid_sound_bit_depth)
{
auto const dir = private_test / "data" / "16_bit_audio";