From 3adf49eea65c2c015ae0b5bc7f066a599faf3933 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Jan 2013 20:11:25 +0000 Subject: Some work on encryption / signing. --- .../402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml | 30 +++++++++++ .../63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml | 39 +++++++++++++++ test/ref/DCP/bar/ASSETMAP.xml | 55 +++++++++++++++++++++ test/ref/DCP/bar/VOLINDEX.xml | 4 ++ test/ref/DCP/bar/audio.mxf | Bin 0 -> 308398 bytes test/ref/DCP/bar/video.mxf | Bin 0 -> 28840 bytes .../81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml | 39 +++++++++++++++ test/ref/DCP/foo/ASSETMAP.xml | 55 +++++++++++++++++++++ test/ref/DCP/foo/VOLINDEX.xml | 4 ++ test/ref/DCP/foo/audio.mxf | Bin 0 -> 305326 bytes .../df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml | 30 +++++++++++ test/ref/DCP/foo/video.mxf | Bin 0 -> 26080 bytes test/tests.cc | 31 ++++++++++-- 13 files changed, 284 insertions(+), 3 deletions(-) create mode 100644 test/ref/DCP/bar/402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml create mode 100644 test/ref/DCP/bar/63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml create mode 100644 test/ref/DCP/bar/ASSETMAP.xml create mode 100644 test/ref/DCP/bar/VOLINDEX.xml create mode 100644 test/ref/DCP/bar/audio.mxf create mode 100644 test/ref/DCP/bar/video.mxf create mode 100644 test/ref/DCP/foo/81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml create mode 100644 test/ref/DCP/foo/ASSETMAP.xml create mode 100644 test/ref/DCP/foo/VOLINDEX.xml create mode 100644 test/ref/DCP/foo/audio.mxf create mode 100644 test/ref/DCP/foo/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml create mode 100644 test/ref/DCP/foo/video.mxf (limited to 'test') diff --git a/test/ref/DCP/bar/402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml b/test/ref/DCP/bar/402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml new file mode 100644 index 00000000..a87f9e27 --- /dev/null +++ b/test/ref/DCP/bar/402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml @@ -0,0 +1,30 @@ + + + urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0 + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + OpenDCP 0.0.25 + + + urn:uuid:2b9b857f-ab4a-440e-a313-1ace0f1cfc95 + video.mxf + fTMi9Xvr8NzuRhm7LmSTk6k1HYo= + 28840 + application/mxf + + + urn:uuid:aa3fb133-0d18-4083-a039-e441b0788e79 + audio.mxf + 2MlsntiFrekkQvwbRPLC2XEMU78= + 308398 + application/mxf + + + urn:uuid:63c3aece-c581-4603-b612-75e43f0c0430 + l/g+bdCKF6ofhedin5qrLcObS1E= + 1526 + text/xml + + + diff --git a/test/ref/DCP/bar/63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml b/test/ref/DCP/bar/63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml new file mode 100644 index 00000000..43edb1b3 --- /dev/null +++ b/test/ref/DCP/bar/63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml @@ -0,0 +1,39 @@ + + + urn:uuid:63c3aece-c581-4603-b612-75e43f0c0430 + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + A Test DCP + feature + + urn:uri:63c3aece-c581-4603-b612-75e43f0c0430_2012-07-17T04:45:18+00:00 + 63c3aece-c581-4603-b612-75e43f0c0430_2012-07-17T04:45:18+00:00 + + + + + urn:uuid:7d861d35-c775-48e6-a4f8-fbfdbfc1556a + + + urn:uuid:2b9b857f-ab4a-440e-a313-1ace0f1cfc95 + video.mxf + 24 1 + 24 + 0 + 24 + 24 1 + 32 32 + + + urn:uuid:aa3fb133-0d18-4083-a039-e441b0788e79 + audio.mxf + 24 1 + 24 + 0 + 24 + + + + + diff --git a/test/ref/DCP/bar/ASSETMAP.xml b/test/ref/DCP/bar/ASSETMAP.xml new file mode 100644 index 00000000..359f453f --- /dev/null +++ b/test/ref/DCP/bar/ASSETMAP.xml @@ -0,0 +1,55 @@ + + + urn:uuid:58f161a5-16d1-4896-93df-52a5a330082f + OpenDCP 0.0.25 + 1 + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + + + urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0 + true + + + 402c5a88-2512-4465-9c0b-cfa687dbc5d0_pkl.xml + 1 + 0 + 1049 + + + + + urn:uuid:63c3aece-c581-4603-b612-75e43f0c0430 + + + 63c3aece-c581-4603-b612-75e43f0c0430_cpl.xml + 1 + 0 + 1526 + + + + + urn:uuid:2b9b857f-ab4a-440e-a313-1ace0f1cfc95 + + + video.mxf + 1 + 0 + 28840 + + + + + urn:uuid:aa3fb133-0d18-4083-a039-e441b0788e79 + + + audio.mxf + 1 + 0 + 308398 + + + + + diff --git a/test/ref/DCP/bar/VOLINDEX.xml b/test/ref/DCP/bar/VOLINDEX.xml new file mode 100644 index 00000000..f66c004a --- /dev/null +++ b/test/ref/DCP/bar/VOLINDEX.xml @@ -0,0 +1,4 @@ + + + 1 + diff --git a/test/ref/DCP/bar/audio.mxf b/test/ref/DCP/bar/audio.mxf new file mode 100644 index 00000000..1188e5fc Binary files /dev/null and b/test/ref/DCP/bar/audio.mxf differ diff --git a/test/ref/DCP/bar/video.mxf b/test/ref/DCP/bar/video.mxf new file mode 100644 index 00000000..20eb6f4a Binary files /dev/null and b/test/ref/DCP/bar/video.mxf differ diff --git a/test/ref/DCP/foo/81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml b/test/ref/DCP/foo/81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml new file mode 100644 index 00000000..59d50075 --- /dev/null +++ b/test/ref/DCP/foo/81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml @@ -0,0 +1,39 @@ + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + A Test DCP + feature + + urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00 + 81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00 + + + + + urn:uuid:379fa64c-ad71-46cf-bef7-b45624006610 + + + urn:uuid:d36f4bb3-c4fa-4a95-9915-6fec3110cd71 + video.mxf + 24 1 + 24 + 0 + 24 + 24 1 + 32 32 + + + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 + audio.mxf + 24 1 + 24 + 0 + 24 + + + + + diff --git a/test/ref/DCP/foo/ASSETMAP.xml b/test/ref/DCP/foo/ASSETMAP.xml new file mode 100644 index 00000000..defe18da --- /dev/null +++ b/test/ref/DCP/foo/ASSETMAP.xml @@ -0,0 +1,55 @@ + + + urn:uuid:b135d5cf-d180-43d8-b0b3-7373737b73bf + OpenDCP 0.0.25 + 1 + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + + + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb + true + + + df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml + 1 + 0 + 1049 + + + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + + + 81fb54df-e1bf-4647-8788-ea7ba154375b_cpl.xml + 1 + 0 + 1526 + + + + + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 + + + audio.mxf + 1 + 0 + 305326 + + + + + urn:uuid:d36f4bb3-c4fa-4a95-9915-6fec3110cd71 + + + video.mxf + 1 + 0 + 26080 + + + + + diff --git a/test/ref/DCP/foo/VOLINDEX.xml b/test/ref/DCP/foo/VOLINDEX.xml new file mode 100644 index 00000000..f66c004a --- /dev/null +++ b/test/ref/DCP/foo/VOLINDEX.xml @@ -0,0 +1,4 @@ + + + 1 + diff --git a/test/ref/DCP/foo/audio.mxf b/test/ref/DCP/foo/audio.mxf new file mode 100644 index 00000000..9bc735af Binary files /dev/null and b/test/ref/DCP/foo/audio.mxf differ diff --git a/test/ref/DCP/foo/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml b/test/ref/DCP/foo/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml new file mode 100644 index 00000000..7a8ec697 --- /dev/null +++ b/test/ref/DCP/foo/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml @@ -0,0 +1,30 @@ + + + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + OpenDCP 0.0.25 + + + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 + audio.mxf + +qImGHkt/XouNaJ1V/+7BtcB4VU= + 305326 + application/mxf + + + urn:uuid:d36f4bb3-c4fa-4a95-9915-6fec3110cd71 + video.mxf + E2vhyxdJQhEzSQZdp31w84ZZpfk= + 26080 + application/mxf + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + TTn7vvdUQi/G+KaW1Pym/DjxULM= + 1526 + text/xml + + + diff --git a/test/ref/DCP/foo/video.mxf b/test/ref/DCP/foo/video.mxf new file mode 100644 index 00000000..645fb85a Binary files /dev/null and b/test/ref/DCP/foo/video.mxf differ diff --git a/test/tests.cc b/test/tests.cc index a842fa4d..71796f72 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -29,12 +29,14 @@ #include "picture_asset.h" #include "sound_asset.h" #include "reel.h" +#include "certificates.h" #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE libdcp_test #include using std::string; +using std::cout; using std::vector; using std::list; using boost::shared_ptr; @@ -109,7 +111,7 @@ BOOST_AUTO_TEST_CASE (error_test) BOOST_AUTO_TEST_CASE (read_dcp) { - libdcp::DCP d ("test/ref/DCP"); + libdcp::DCP d ("test/ref/DCP/foo"); d.read (); list > cpls = d.cpls (); @@ -607,7 +609,7 @@ BOOST_AUTO_TEST_CASE (encryption) 24, 32, 32, - false + true )); shared_ptr ms (new libdcp::SoundAsset ( @@ -618,7 +620,7 @@ BOOST_AUTO_TEST_CASE (encryption) 24, 24, 2, - false + true )); cpl->add_reel (shared_ptr (new libdcp::Reel (mp, ms, shared_ptr ()))); @@ -626,3 +628,26 @@ BOOST_AUTO_TEST_CASE (encryption) d.write_xml (); } + +BOOST_AUTO_TEST_CASE (certificates) +{ + libdcp::CertificateChain c ("test/data/certificate_chain"); + BOOST_CHECK_EQUAL (c._certificates.size(), 3); + + BOOST_CHECK_EQUAL ( + c.root()->issuer(), + "/O=example.org/OU=example.org/CN=.smpte-430-2.ROOT.NOT_FOR_PRODUCTION/dnQualifier=rTeK7x+nopFkyphflooz6p2ZM7A=" + ); + + BOOST_CHECK_EQUAL ( + libdcp::Certificate::name_for_xml (c.root()->issuer()), + "dnQualifier=rTeK7x+nopFkyphflooz6p2ZM7A=,CN=.smpte-430-2.ROOT.NOT_FOR_PRODUCTION,OU=example.org,O=example.org" + ); + + BOOST_CHECK_EQUAL (c.root()->serial(), "5"); + + BOOST_CHECK_EQUAL ( + libdcp::Certificate::name_for_xml (c.root()->subject()), + "dnQualifier=rTeK7x+nopFkyphflooz6p2ZM7A=,CN=.smpte-430-2.ROOT.NOT_FOR_PRODUCTION,OU=example.org,O=example.org" + ); +} -- cgit v1.2.3