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 | |
| parent | ce9ca273648d879a4aee700593b757147336d884 (diff) | |
Always sign DCPs (#1760).
| -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 | ||||
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 1 | ||||
| -rw-r--r-- | src/wx/dcp_panel.cc | 26 | ||||
| -rw-r--r-- | src/wx/dcp_panel.h | 2 |
8 files changed, 7 insertions, 61 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()); diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 857359117..90025c5bc 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -102,7 +102,6 @@ main (int argc, char* argv[]) film->set_dcp_content_type (cc.dcp_content_type); film->set_interop (cc.standard == dcp::INTEROP); film->set_use_isdcf_name (!cc.no_use_isdcf_name); - film->set_signed (!cc.no_sign); film->set_encrypted (cc.encrypt); film->set_three_d (cc.threed); if (cc.fourk) { diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index c3cfc91d4..d8ddd1bca 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -97,7 +97,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> v _dcp_content_type_label = create_label (_panel, _("Content Type"), true); _dcp_content_type = new wxChoice (_panel, wxID_ANY); - _signed = new CheckBox (_panel, _("Signed")); _encrypted = new CheckBox (_panel, _("Encrypted")); wxClientDC dc (_panel); @@ -134,7 +133,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> v _edit_isdcf_button->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); _copy_isdcf_name_button->Bind(wxEVT_BUTTON, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this)); _dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::dcp_content_type_changed, this)); - _signed->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::signed_toggled, this)); _encrypted->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::encrypted_toggled, this)); _edit_key->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_key_clicked, this)); _reel_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::reel_type_changed, this)); @@ -203,12 +201,6 @@ DCPPanel::add_to_grid () _grid->Add (_dcp_content_type, wxGBPosition (r, 1)); ++r; - _signed->Show (full); - if (full) { - _grid->Add (_signed, wxGBPosition (r, 0), wxGBSpan (1, 2)); - ++r; - } - _grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; @@ -298,16 +290,6 @@ DCPPanel::j2k_bandwidth_changed () } void -DCPPanel::signed_toggled () -{ - if (!_film) { - return; - } - - _film->set_signed (_signed->GetValue ()); -} - -void DCPPanel::encrypted_toggled () { if (!_film) { @@ -425,18 +407,12 @@ DCPPanel::film_changed (int p) checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ())); setup_dcp_name (); break; - case Film::SIGNED: - checked_set (_signed, _film->is_signed ()); - break; case Film::ENCRYPTED: checked_set (_encrypted, _film->encrypted ()); if (_film->encrypted ()) { - _film->set_signed (true); - _signed->Enable (false); _key->Enable (_generally_sensitive); _edit_key->Enable (_generally_sensitive); } else { - _signed->Enable (_generally_sensitive); _key->Enable (false); _edit_key->Enable (false); } @@ -641,7 +617,6 @@ DCPPanel::set_film (shared_ptr<Film> film) film_changed (Film::DCP_CONTENT_TYPE); film_changed (Film::CONTAINER); film_changed (Film::RESOLUTION); - film_changed (Film::SIGNED); film_changed (Film::ENCRYPTED); film_changed (Film::KEY); film_changed (Film::J2K_BANDWIDTH); @@ -680,7 +655,6 @@ DCPPanel::setup_sensitivity () if (_film && _film->encrypted ()) { si = false; } - _signed->Enable (si); _encrypted->Enable (_generally_sensitive); _key->Enable (_generally_sensitive && _film && _film->encrypted ()); diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 887ae7c77..69fc65532 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -72,7 +72,6 @@ private: void resolution_changed (); void three_d_changed (); void standard_changed (); - void signed_toggled (); void encrypted_toggled (); void edit_key_clicked (); void audio_processor_changed (); @@ -139,7 +138,6 @@ private: wxChoice* _resolution; wxStaticText* _standard_label; wxChoice* _standard; - wxCheckBox* _signed; wxCheckBox* _encrypted; wxStaticText* _key_label; wxStaticText* _key; |
