diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-09-29 21:08:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-09-29 21:08:31 +0100 |
| commit | cccab9e0c03bf03e51a8924c05b6e5ed74d94e99 (patch) | |
| tree | 7b9dd44ba94737703e5bbb6249f10ee56fa8d8be /src/kdm.cc | |
| parent | 56295f9d82c74b967b234ac89a5600d5cff1b641 (diff) | |
Fix signing of KDMs.
Diffstat (limited to 'src/kdm.cc')
| -rw-r--r-- | src/kdm.cc | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 ( |
