summaryrefslogtreecommitdiff
path: root/src/kdm.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-29 21:08:31 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-29 21:08:31 +0100
commitcccab9e0c03bf03e51a8924c05b6e5ed74d94e99 (patch)
tree7b9dd44ba94737703e5bbb6249f10ee56fa8d8be /src/kdm.cc
parent56295f9d82c74b967b234ac89a5600d5cff1b641 (diff)
Fix signing of KDMs.
Diffstat (limited to 'src/kdm.cc')
-rw-r--r--src/kdm.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kdm.cc b/src/kdm.cc
index 79dc57e1..80d64441 100644
--- a/src/kdm.cc
+++ b/src/kdm.cc
@@ -153,7 +153,6 @@ KDM::KDM (
shared_ptr<cxml::Node> root (new cxml::Node (doc->get_root_node ()));
xmlpp::Node* signature = root->node_child("Signature")->node();
signer->add_signature_value (signature, "ds");
- doc->write_to_file_formatted ("/home/carl/foo.xml", "UTF-8");
_xml_kdm->signature = xml::Signature (shared_ptr<cxml::Node> (new cxml::Node (signature)));
}
@@ -181,14 +180,20 @@ void
KDM::as_xml (boost::filesystem::path path) const
{
shared_ptr<xmlpp::Document> doc = _xml_kdm->as_xml ();
- doc->write_to_file_formatted (path.string(), "UTF-8");
+ /* This must *not* be the _formatted version, otherwise the signature
+ will be wrong.
+ */
+ doc->write_to_file (path.string(), "UTF-8");
}
string
KDM::as_xml () const
{
shared_ptr<xmlpp::Document> doc = _xml_kdm->as_xml ();
- return doc->write_to_string_formatted ("UTF-8");
+ /* This must *not* be the _formatted version, otherwise the signature
+ will be wrong.
+ */
+ return doc->write_to_string ("UTF-8");
}
KDMKey::KDMKey (