summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-10-10 10:11:24 +0100
committerCarl Hetherington <cth@carlh.net>2013-10-10 10:11:24 +0100
commit9394dad74a8439f8230eb6aa21b639f3e10cbb2a (patch)
treea07d0292f0dfa4c6796386fba1e870a00b501970
parent55f5142794f423e70daa4d5b3a4602029172a127 (diff)
Write encryption test all to the right place. Some more XML writes unformatted to fix digests.
-rw-r--r--src/cpl.cc3
-rw-r--r--src/dcp.cc7
-rw-r--r--test/encryption_test.cc10
3 files changed, 11 insertions, 9 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 74cdd784..2ce75cef 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -237,7 +237,8 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Sig
signer->sign (root, interop);
}
- doc.write_to_file_formatted (p.string (), "UTF-8");
+ /* This must not be the _formatted version otherwise signature digests will be wrong */
+ doc.write_to_file (p.string (), "UTF-8");
_digest = make_digest (p.string (), 0);
_length = boost::filesystem::file_size (p.string ());
diff --git a/src/dcp.cc b/src/dcp.cc
index 48ee7c56..3d64a8b7 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -124,7 +124,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
signer->sign (pkl, interop);
}
- doc.write_to_file_formatted (p.string (), "UTF-8");
+ doc.write_to_file (p.string (), "UTF-8");
return p.string ();
}
@@ -138,7 +138,7 @@ DCP::write_volindex () const
xmlpp::Document doc;
xmlpp::Element* root = doc.create_root_node ("VolumeIndex", "http://www.smpte-ra.org/schemas/429-9/2007/AM");
root->add_child("Index")->add_child_text ("1");
- doc.write_to_file_formatted (p.string (), "UTF-8");
+ doc.write_to_file (p.string (), "UTF-8");
}
void
@@ -191,7 +191,8 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata
(*i)->write_to_assetmap (asset_list);
}
- doc.write_to_file_formatted (p.string (), "UTF-8");
+ /* This must not be the _formatted version otherwise signature digests will be wrong */
+ doc.write_to_file (p.string (), "UTF-8");
}
void
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index d0bac5f3..dc49562c 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -54,8 +54,8 @@ BOOST_AUTO_TEST_CASE (encryption)
xml_metadata.creator = "OpenDCP 0.0.25";
xml_metadata.issue_date = "2012-07-17T04:45:18+00:00";
- boost::filesystem::remove_all ("build/test/bar");
- boost::filesystem::create_directories ("build/test/bar");
+ boost::filesystem::remove_all ("build/test/DCP/bar");
+ boost::filesystem::create_directories ("build/test/DCP/bar");
libdcp::DCP d ("build/test/DCP/bar");
libdcp::CertificateChain chain;
@@ -70,11 +70,11 @@ BOOST_AUTO_TEST_CASE (encryption)
)
);
- shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/bar", "A Test DCP", libdcp::FEATURE, 24, 24));
+ shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/DCP/bar", "A Test DCP", libdcp::FEATURE, 24, 24));
libdcp::Key key;
- shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/bar", "video.mxf"));
+ shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/DCP/bar", "video.mxf"));
mp->set_progress (&d.Progress);
mp->set_edit_rate (24);
mp->set_intrinsic_duration (24);
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE (encryption)
mp->set_key (key);
mp->create (j2c);
- shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/bar", "audio.mxf"));
+ shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/DCP/bar", "audio.mxf"));
ms->set_progress (&d.Progress);
ms->set_edit_rate (24);
ms->set_intrinsic_duration (24);