Rename Config::_signer to Config::_signer_chain.
authorCarl Hetherington <cth@carlh.net>
Thu, 30 Jul 2015 10:02:16 +0000 (11:02 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 30 Jul 2015 10:02:16 +0000 (11:02 +0100)
src/lib/config.cc
src/lib/config.h
src/lib/film.cc
src/lib/writer.cc
src/wx/config_dialog.cc

index b75791a45e96c52992d2bacdb39a8b6db742e045..7e3de966b4bfc79a40cc3d64508c74a47fbe2c27 100644 (file)
@@ -120,7 +120,7 @@ Config::read ()
 {
        if (!boost::filesystem::exists (file ())) {
                /* Make a new set of signing certificates and key */
-               _signer.reset (new dcp::CertificateChain (openssl_path ()));
+               _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
                /* And decryption keys */
                make_decryption_keys ();
                return;
@@ -233,7 +233,6 @@ Config::read ()
        }
 
        cxml::NodePtr signer = f.optional_node_child ("Signer");
-       dcp::CertificateChain signer_chain;
        if (signer) {
                shared_ptr<dcp::CertificateChain> c (new dcp::CertificateChain ());
                /* Read the signing certificates and private key in from the config file */
@@ -242,10 +241,10 @@ Config::read ()
                        c->add (dcp::Certificate ((*i)->content ()));
                }
                c->set_key (signer->string_child ("PrivateKey"));
-               _signer = c;
+               _signer_chain = c;
        } else {
                /* Make a new set of signing certificates and key */
-               _signer.reset (new dcp::CertificateChain (openssl_path ()));
+               _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
        }
 
        if (f.optional_string_child ("DecryptionCertificate")) {
@@ -379,11 +378,11 @@ Config::write () const
 #endif
 
        xmlpp::Element* signer = root->add_child ("Signer");
-       dcp::CertificateChain::List certs = _signer->root_to_leaf ();
+       dcp::CertificateChain::List certs = _signer_chain->root_to_leaf ();
        for (dcp::CertificateChain::List::const_iterator i = certs.begin(); i != certs.end(); ++i) {
                signer->add_child("Certificate")->add_child_text (i->certificate (true));
        }
-       signer->add_child("PrivateKey")->add_child_text (_signer->key().get ());
+       signer->add_child("PrivateKey")->add_child_text (_signer_chain->key().get ());
 
        root->add_child("DecryptionCertificate")->add_child_text (_decryption_certificate.certificate (true));
        root->add_child("DecryptionPrivateKey")->add_child_text (_decryption_private_key);
index 913c2abc3913fc11444b82ab14bfbbe35d5f74b8..573d2b29277953a08161ed297b6e9216a3b07a58 100644 (file)
@@ -199,8 +199,8 @@ public:
                return _kdm_email;
        }
 
-       boost::shared_ptr<const dcp::CertificateChain> signer () const {
-               return _signer;
+       boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
+               return _signer_chain;
        }
 
        dcp::Certificate decryption_certificate () const {
@@ -376,8 +376,8 @@ public:
 
        void reset_kdm_email ();
 
-       void set_signer (boost::shared_ptr<const dcp::CertificateChain> s) {
-               maybe_set (_signer, s);
+       void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
+               maybe_set (_signer_chain, s);
        }
 
        void set_decryption_certificate (dcp::Certificate c) {
@@ -489,7 +489,7 @@ private:
        std::string _kdm_cc;
        std::string _kdm_bcc;
        std::string _kdm_email;
-       boost::shared_ptr<const dcp::CertificateChain> _signer;
+       boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
        dcp::Certificate _decryption_certificate;
        std::string _decryption_private_key;
        /** true to check for updates on startup */
index 548c51796f4c10352a8a17aed9c4fa5da8b5206b..4de7a12a51734a774e0d0c38da257d69e10d3290 100644 (file)
@@ -1063,7 +1063,7 @@ Film::make_kdm (
        ) const
 {
        shared_ptr<const dcp::CPL> cpl (new dcp::CPL (cpl_file));
-       shared_ptr<const dcp::CertificateChain> signer = Config::instance()->signer();
+       shared_ptr<const dcp::CertificateChain> signer = Config::instance()->signer_chain ();
        if (!signer->valid ()) {
                throw InvalidSignerError ();
        }
index 7b2cfa3d215fdf528f19224125dc700db43a8cf0..e6043951ce6dda617f58b944e3d8d962bc199e40 100644 (file)
@@ -143,7 +143,7 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
        }
 
        /* Check that the signer is OK if we need one */
-       if (_film->is_signed() && !Config::instance()->signer()->valid ()) {
+       if (_film->is_signed() && !Config::instance()->signer_chain()->valid ()) {
                throw InvalidSignerError ();
        }
 
@@ -599,7 +599,7 @@ Writer::finish ()
 
        shared_ptr<const dcp::CertificateChain> signer;
        if (_film->is_signed ()) {
-               signer = Config::instance()->signer ();
+               signer = Config::instance()->signer_chain ();
                /* We did check earlier, but check again here to be on the safe side */
                if (!signer->valid ()) {
                        throw InvalidSignerError ();
index da3d85bef15dbd459da8d5cbc10d3eef712b37c7..da6a94bbe17b458bff2c8c89f6d7b9a07c8a080e 100644 (file)
@@ -682,7 +682,7 @@ private:
 
        void config_changed ()
        {
-               _signer.reset (new dcp::CertificateChain (*Config::instance()->signer().get ()));
+               _signer.reset (new dcp::CertificateChain (*Config::instance()->signer_chain().get ()));
 
                update_certificate_list ();
                update_signer_private_key ();
@@ -699,7 +699,7 @@ private:
                        try {
                                dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ())));
                                _signer->add (c);
-                               Config::instance()->set_signer (_signer);
+                               Config::instance()->set_signer_chain (_signer);
                                update_certificate_list ();
                        } catch (dcp::MiscError& e) {
                                error_dialog (_panel, wxString::Format (_("Could not read certificate file (%s)"), e.what ()));
@@ -720,7 +720,7 @@ private:
 
                _certificates->DeleteItem (i);
                _signer->remove (i);
-               Config::instance()->set_signer (_signer);
+               Config::instance()->set_signer_chain (_signer);
 
                update_sensitivity ();
        }
@@ -750,7 +750,7 @@ private:
 
        void remake_certificates ()
        {
-               shared_ptr<const dcp::CertificateChain> chain = Config::instance()->signer();
+               shared_ptr<const dcp::CertificateChain> chain = Config::instance()->signer_chain ();
 
                string intermediate_common_name;
                if (chain->root_to_leaf().size() >= 3) {
@@ -781,7 +781,7 @@ private:
                                        )
                                );
 
-                       Config::instance()->set_signer (_signer);
+                       Config::instance()->set_signer_chain (_signer);
                        update_certificate_list ();
                        update_signer_private_key ();
                }
@@ -812,7 +812,7 @@ private:
                                }
 
                                _signer->set_key (dcp::file_to_string (p));
-                               Config::instance()->set_signer (_signer);
+                               Config::instance()->set_signer_chain (_signer);
                                update_signer_private_key ();
                        } catch (dcp::MiscError& e) {
                                error_dialog (_panel, wxString::Format (_("Could not read certificate file (%s)"), e.what ()));