Always sign DCPs (#1760).
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2020 00:11:18 +0000 (02:11 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2020 15:09:15 +0000 (17:09 +0200)
src/lib/create_cli.cc
src/lib/create_cli.h
src/lib/film.cc
src/lib/film.h
src/lib/writer.cc
src/tools/dcpomatic_create.cc
src/wx/dcp_panel.cc
src/wx/dcp_panel.h

index b670282b4717a0bfcbc3988b391a55cd1f5d1bcb..aec12e59edbc6d0668082796a824a8aa93766f5e 100644 (file)
@@ -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") {
index 01e8e66335f32ec8519f0b9549742a690147f80c..97e0910567686bb8251d6abcb30f3442f18d2bb1 100644 (file)
@@ -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;
index 2f631bd89c02173abba3fc0910289d92fc401208..2aaeafca668382d0ae0042a3190b98b19ab0d8de 100644 (file)
@@ -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
@@ -1204,13 +1201,6 @@ Film::cpls () const
        return out;
 }
 
-void
-Film::set_signed (bool s)
-{
-       ChangeSignaller<Film> ch (this, SIGNED);
-       _signed = s;
-}
-
 void
 Film::set_encrypted (bool e)
 {
@@ -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;
index 5bf6c55f7b12a7898dd6afe62f24e3b7b9886f97..ea60b461d426be369606e8be9ef9438da52c5105 100644 (file)
@@ -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
index 699f220c4df31fdef6dfbae02086515119e60fd6..8682437b37888682959a96bf0cd286f9d6ac29f9 100644 (file)
@@ -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());
index 857359117c3c64309b2c4a35f0c1fcba452bfa5f..90025c5bc5f4702310ee0632a17751c2839e6d31 100644 (file)
@@ -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) {
index c3cfc91d4cb25564e5ccb19ccdeabd7a37f21a56..d8ddd1bca1be538e3dddc9ca500f82770ce06b37 100644 (file)
@@ -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;
 
@@ -297,16 +289,6 @@ DCPPanel::j2k_bandwidth_changed ()
        _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000);
 }
 
-void
-DCPPanel::signed_toggled ()
-{
-       if (!_film) {
-               return;
-       }
-
-       _film->set_signed (_signed->GetValue ());
-}
-
 void
 DCPPanel::encrypted_toggled ()
 {
@@ -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 ());
index 887ae7c77e552c81aad307deb7a963f58fbbca08..69fc65532fdc4e3d046ece232d6dd9bb0bd2c62d 100644 (file)
@@ -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;