diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-06-08 02:11:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-06-08 17:09:15 +0200 |
| commit | 8755ef75cb001cf7fba230ffa98fb40eb2547849 (patch) | |
| tree | a6884e631d07c0d01e57dab6b9612f584b202426 /src/lib | |
| parent | ce9ca273648d879a4aee700593b757147336d884 (diff) | |
Always sign DCPs (#1760).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/create_cli.cc | 3 | ||||
| -rw-r--r-- | src/lib/create_cli.h | 1 | ||||
| -rw-r--r-- | src/lib/film.cc | 11 | ||||
| -rw-r--r-- | src/lib/film.h | 8 | ||||
| -rw-r--r-- | src/lib/writer.cc | 16 |
5 files changed, 7 insertions, 32 deletions
diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index b670282b4..aec12e59e 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -81,7 +81,6 @@ CreateCLI::CreateCLI (int argc, char* argv[]) , still_length (10) , standard (dcp::SMPTE) , no_use_isdcf_name (false) - , no_sign (false) , fourk (false) { string dcp_content_type_string = "TST"; @@ -113,8 +112,6 @@ CreateCLI::CreateCLI (int argc, char* argv[]) encrypt = claimed = true; } else if (a == "--no-use-isdcf-name") { no_use_isdcf_name = claimed = true; - } else if (a == "--no-sign") { - no_sign = claimed = true; } else if (a == "--threed") { threed = claimed = true; } else if (a == "--left-eye") { diff --git a/src/lib/create_cli.h b/src/lib/create_cli.h index 01e8e6633..97e091056 100644 --- a/src/lib/create_cli.h +++ b/src/lib/create_cli.h @@ -48,7 +48,6 @@ public: int still_length; dcp::Standard standard; bool no_use_isdcf_name; - bool no_sign; boost::optional<boost::filesystem::path> config_dir; boost::optional<boost::filesystem::path> output_dir; boost::optional<std::string> error; diff --git a/src/lib/film.cc b/src/lib/film.cc index 2f631bd89..2aaeafca6 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -148,7 +148,6 @@ Film::Film (optional<boost::filesystem::path> dir) , _dcp_content_type (Config::instance()->default_dcp_content_type ()) , _container (Config::instance()->default_container ()) , _resolution (RESOLUTION_2K) - , _signed (true) , _encrypted (false) , _context_id (dcp::make_uuid ()) , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) @@ -447,7 +446,6 @@ Film::metadata (bool with_content_paths) const root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0"); root->add_child("Sequence")->add_child_text (_sequence ? "1" : "0"); root->add_child("Interop")->add_child_text (_interop ? "1" : "0"); - root->add_child("Signed")->add_child_text (_signed ? "1" : "0"); root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0"); root->add_child("Key")->add_child_text (_key.hex ()); root->add_child("ContextID")->add_child_text (_context_id); @@ -567,7 +565,6 @@ Film::read_metadata (optional<boost::filesystem::path> path) _resolution = string_to_resolution (f.string_child ("Resolution")); _j2k_bandwidth = f.number_child<int> ("J2KBandwidth"); _video_frame_rate = f.number_child<int> ("VideoFrameRate"); - _signed = f.optional_bool_child("Signed").get_value_or (true); _encrypted = f.bool_child ("Encrypted"); _audio_channels = f.number_child<int> ("AudioChannels"); /* We used to allow odd numbers (and zero) channels, but it's just not worth @@ -1205,13 +1202,6 @@ Film::cpls () const } void -Film::set_signed (bool s) -{ - ChangeSignaller<Film> ch (this, SIGNED); - _signed = s; -} - -void Film::set_encrypted (bool e) { ChangeSignaller<Film> ch (this, ENCRYPTED); @@ -1757,7 +1747,6 @@ Film::use_template (string name) _resolution = _template_film->_resolution; _j2k_bandwidth = _template_film->_j2k_bandwidth; _video_frame_rate = _template_film->_video_frame_rate; - _signed = _template_film->_signed; _encrypted = _template_film->_encrypted; _audio_channels = _template_film->_audio_channels; _sequence = _template_film->_sequence; diff --git a/src/lib/film.h b/src/lib/film.h index 5bf6c55f7..ea60b461d 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -211,7 +211,6 @@ public: DCP_CONTENT_TYPE, CONTAINER, RESOLUTION, - SIGNED, ENCRYPTED, KEY, J2K_BANDWIDTH, @@ -259,11 +258,6 @@ public: return _resolution; } - /* signed is a reserved word */ - bool is_signed () const { - return _signed; - } - bool encrypted () const { return _encrypted; } @@ -352,7 +346,6 @@ public: void set_dcp_content_type (DCPContentType const *); void set_container (Ratio const *, bool user_explicit = true); void set_resolution (Resolution, bool user_explicit = true); - void set_signed (bool); void set_encrypted (bool); void set_key (dcp::Key key); void set_j2k_bandwidth (int); @@ -431,7 +424,6 @@ private: Ratio const * _container; /** DCP resolution (2K or 4K) */ Resolution _resolution; - bool _signed; bool _encrypted; dcp::Key _key; /** context ID used when encrypting picture assets; we keep it so that we can diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 699f220c4..8682437b3 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -98,9 +98,9 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j) _caption_reels[i] = _reels.begin (); } - /* Check that the signer is OK if we need one */ + /* Check that the signer is OK */ string reason; - if (_film->is_signed() && !Config::instance()->signer_chain()->valid(&reason)) { + if (!Config::instance()->signer_chain()->valid(&reason)) { throw InvalidSignerError (reason); } } @@ -570,13 +570,11 @@ Writer::finish () cpl->set_content_version_label_text (_film->content_version()); shared_ptr<const dcp::CertificateChain> signer; - if (_film->is_signed ()) { - signer = Config::instance()->signer_chain (); - /* We did check earlier, but check again here to be on the safe side */ - string reason; - if (!signer->valid (&reason)) { - throw InvalidSignerError (reason); - } + signer = Config::instance()->signer_chain (); + /* We did check earlier, but check again here to be on the safe side */ + string reason; + if (!signer->valid (&reason)) { + throw InvalidSignerError (reason); } dcp.write_xml (_film->interop () ? dcp::INTEROP : dcp::SMPTE, meta, signer, Config::instance()->dcp_metadata_filename_format()); |
