Try quoting openssl calls.
[libdcp.git] / src / dcp.cc
index 03d1598d6dc8d396269d17ec3b91d9da931be869..3d64a8b7d5ea228608f3bbd03c1784c45708e980 100644 (file)
@@ -67,7 +67,7 @@ DCP::DCP (boost::filesystem::path directory)
 }
 
 void
-DCP::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<Signer> signer) const
+DCP::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Signer> signer) const
 {
        for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
                (*i)->write_xml (interop, metadata, signer);
@@ -81,7 +81,7 @@ DCP::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<Signer> s
 }
 
 std::string
-DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, shared_ptr<Signer> signer) const
+DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, shared_ptr<const Signer> signer) const
 {
        assert (!_cpls.empty ());
        
@@ -124,7 +124,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
                signer->sign (pkl, interop);
        }
                
-       doc.write_to_file_formatted (p.string (), "UTF-8");
+       doc.write_to_file (p.string (), "UTF-8");
        return p.string ();
 }
 
@@ -138,7 +138,7 @@ DCP::write_volindex () const
        xmlpp::Document doc;
        xmlpp::Element* root = doc.create_root_node ("VolumeIndex", "http://www.smpte-ra.org/schemas/429-9/2007/AM");
        root->add_child("Index")->add_child_text ("1");
-       doc.write_to_file_formatted (p.string (), "UTF-8");
+       doc.write_to_file (p.string (), "UTF-8");
 }
 
 void
@@ -191,7 +191,8 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata
                (*i)->write_to_assetmap (asset_list);
        }
 
-       doc.write_to_file_formatted (p.string (), "UTF-8");
+       /* This must not be the _formatted version otherwise signature digests will be wrong */
+       doc.write_to_file (p.string (), "UTF-8");
 }
 
 void