Fix nonfunctional send-problem-report.
[dcpomatic.git] / src / lib / config.cc
index 64d794b365fae6fd65d9b87eddfd4875cc7cd0e8..43a3e63c924d170517267c0b8f371b6aa6798235 100644 (file)
@@ -91,14 +91,13 @@ Config::set_defaults ()
        _mail_port = 25;
        _mail_user = "";
        _mail_password = "";
-       _kdm_subject = _("KDM delivery");
        _kdm_from = "";
        _kdm_cc = "";
        _kdm_bcc = "";
        _check_for_updates = false;
        _check_for_test_updates = false;
        _maximum_j2k_bandwidth = 250000000;
-       _log_types = Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR;
+       _log_types = LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR;
        _automatic_audio_analysis = false;
 #ifdef DCPOMATIC_WINDOWS
        _win32_console = false;
@@ -122,14 +121,29 @@ Config::restore_defaults ()
        Config::instance()->changed ();
 }
 
+shared_ptr<dcp::CertificateChain>
+Config::create_certificate_chain ()
+{
+       return shared_ptr<dcp::CertificateChain> (
+               new dcp::CertificateChain (
+                       openssl_path(),
+                       "dcpomatic.com",
+                       "dcpomatic.com",
+                       ".dcpomatic.smpte-430-2.ROOT",
+                       ".dcpomatic.smpte-430-2.INTERMEDIATE",
+                       "CS.dcpomatic.smpte-430-2.LEAF"
+                       )
+               );
+}
+
 void
 Config::read ()
 {
        if (!have_existing ()) {
                /* Make a new set of signing certificates and key */
-               _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
+               _signer_chain = create_certificate_chain ();
                /* And similar for decryption of KDMs */
-               _decryption_chain.reset (new dcp::CertificateChain (openssl_path ()));
+               _decryption_chain = create_certificate_chain ();
                write ();
                return;
        }
@@ -234,7 +248,7 @@ Config::read ()
        _maximum_j2k_bandwidth = f.optional_number_child<int> ("MaximumJ2KBandwidth").get_value_or (250000000);
        _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
 
-       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR);
+       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
        _automatic_audio_analysis = f.optional_bool_child ("AutomaticAudioAnalysis").get_value_or (false);
 #ifdef DCPOMATIC_WINDOWS
        _win32_console = f.optional_bool_child ("Win32Console").get_value_or (false);
@@ -256,7 +270,7 @@ Config::read ()
                _signer_chain = c;
        } else {
                /* Make a new set of signing certificates and key */
-               _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
+               _signer_chain = create_certificate_chain ();
        }
 
        cxml::NodePtr decryption = f.optional_node_child ("Decryption");
@@ -268,7 +282,7 @@ Config::read ()
                c->set_key (decryption->string_child ("PrivateKey"));
                _decryption_chain = c;
        } else {
-               _decryption_chain.reset (new dcp::CertificateChain (openssl_path ()));
+               _decryption_chain = create_certificate_chain ();
        }
 }
 
@@ -443,6 +457,8 @@ Config::changed (Property what)
 void
 Config::set_kdm_email_to_default ()
 {
+       _kdm_subject = _("KDM delivery: $CPL_NAME");
+
        _kdm_email = _(
                "Dear Projectionist\n\n"
                "Please find attached KDMs for $CPL_NAME.\n\n"