#include "server.h"
#include "filter.h"
#include "ratio.h"
+#include "types.h"
#include "dcp_content_type.h"
#include "cinema_sound_processor.h"
#include "colour_conversion.h"
#include "cross.h"
#include "raw_convert.h"
#include <dcp/colour_matrix.h>
-#include <dcp/signer.h>
#include <dcp/certificate_chain.h>
#include <libcxml/cxml.h>
#include <glib.h>
_num_local_encoding_threads = max (2U, boost::thread::hardware_concurrency ());
_server_port_base = 6192;
_use_any_servers = true;
+ _servers.clear ();
+ _tms_protocol = PROTOCOL_SCP;
+ _tms_ip = "";
_tms_path = ".";
+ _tms_user = "";
+ _tms_password = "";
_cinema_sound_processor = CinemaSoundProcessor::from_id (N_("dolby_cp750"));
_allow_any_dcp_frame_rate = false;
+ _language = optional<string> ();
_default_still_length = 10;
_default_container = Ratio::from_id ("185");
_default_dcp_content_type = DCPContentType::from_isdcf_name ("FTR");
_default_j2k_bandwidth = 100000000;
_default_audio_delay = 0;
+ _mail_server = "";
_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;
{
if (!boost::filesystem::exists (file ())) {
/* Make a new set of signing certificates and key */
- _signer.reset (new dcp::Signer (openssl_path ()));
+ _signer.reset (new dcp::CertificateChain (openssl_path ()));
/* And decryption keys */
make_decryption_keys ();
return;
}
}
+ _tms_protocol = static_cast<Protocol> (f.optional_number_child<int> ("TMSProtocol").get_value_or (static_cast<int> (PROTOCOL_SCP)));
_tms_ip = f.string_child ("TMSIP");
_tms_path = f.string_child ("TMSPath");
_tms_user = f.string_child ("TMSUser");
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 */
list<cxml::NodePtr> certificates = signer->node_children ("Certificate");
for (list<cxml::NodePtr>::const_iterator i = certificates.begin(); i != certificates.end(); ++i) {
- signer_chain.add (dcp::Certificate ((*i)->content ()));
+ c->add (dcp::Certificate ((*i)->content ()));
}
-
- _signer.reset (new dcp::Signer (signer_chain, signer->string_child ("PrivateKey")));
+ c->set_key (signer->string_child ("PrivateKey"));
+ _signer = c;
} else {
/* Make a new set of signing certificates and key */
- _signer.reset (new dcp::Signer (openssl_path ()));
+ _signer.reset (new dcp::CertificateChain (openssl_path ()));
}
if (f.optional_string_child ("DecryptionCertificate")) {
void
Config::make_decryption_keys ()
{
- boost::filesystem::path p = dcp::make_certificate_chain (openssl_path ());
- _decryption_certificate = dcp::Certificate (dcp::file_to_string (p / "leaf.signed.pem"));
- _decryption_private_key = dcp::file_to_string (p / "leaf.key");
- boost::filesystem::remove_all (p);
+ dcp::CertificateChain c (openssl_path ());
+ _decryption_certificate = c.leaf ();
+ _decryption_private_key = c.key().get ();
}
/** @return Filename to write configuration to */
root->add_child("Server")->add_child_text (*i);
}
+ root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (_tms_protocol));
root->add_child("TMSIP")->add_child_text (_tms_ip);
root->add_child("TMSPath")->add_child_text (_tms_path);
root->add_child("TMSUser")->add_child_text (_tms_user);
#endif
xmlpp::Element* signer = root->add_child ("Signer");
- dcp::CertificateChain::List certs = _signer->certificates().root_to_leaf ();
+ dcp::CertificateChain::List certs = _signer->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 ());
+ signer->add_child("PrivateKey")->add_child_text (_signer->key().get ());
root->add_child("DecryptionCertificate")->add_child_text (_decryption_certificate.certificate (true));
root->add_child("DecryptionPrivateKey")->add_child_text (_decryption_private_key);
}
void
-Config::changed ()
+Config::changed (Property what)
{
- Changed ();
+ Changed (what);
}
void