Nicer default labels in certificate chains.
authorCarl Hetherington <cth@carlh.net>
Fri, 9 Oct 2015 15:32:42 +0000 (16:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 9 Oct 2015 15:32:42 +0000 (16:32 +0100)
ChangeLog
src/lib/config.cc
src/lib/config.h

index 8ed18b7c17b69a481cbc9f20b6df3332650e5c07..a37851a1063fd00392622f2c53da7e22e34cbb95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-10-09  c.hetherington  <cth@carlh.net>
 
+       * Create certificate chains with nicer default
+       organizational unit etc.
+
        * Various improvements to server GUI.
 
        * Package main DCP-o-matic, server and batch
index f00d8d1e5cf9a69bd745d06352f69e0a48dab1ab..07c9b9c89bbea19047657e4eb48ecde503be4597 100644 (file)
@@ -122,14 +122,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;
        }
@@ -256,7 +271,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 +283,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 ();
        }
 }
 
index 579527975db2153892302d32232215b974f77da5..9c1f231611e33b5e5b77a03004ac3311886b9c42 100644 (file)
@@ -452,6 +452,7 @@ private:
        void read ();
        void set_defaults ();
        void set_kdm_email_to_default ();
+       boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
 
        template <class T>
        void maybe_set (T& member, T new_value) {