From 3efbc8af3f71d47faaa38f9e20092bcfa08c3713 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 24 Feb 2024 21:46:50 +0100 Subject: Allow building with libxml++-4.0 and C++17. --- src/encrypted_kdm.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc index 5b33e3f6..d1089c0b 100644 --- a/src/encrypted_kdm.cc +++ b/src/encrypted_kdm.cc @@ -44,6 +44,7 @@ #include "file.h" #include "util.h" #include +#include #include #include #include @@ -229,9 +230,9 @@ public: } } - void as_xml (xmlpp::Element* node, map& references) const + void as_xml (xmlpp::Element* node, map& references) const { - references["ID_AuthenticatedPrivate"] = node->set_attribute ("Id", "ID_AuthenticatedPrivate"); + references["ID_AuthenticatedPrivate"] = dynamic_cast(node->set_attribute("Id", "ID_AuthenticatedPrivate")); for (auto i: encrypted_key) { auto encrypted_key = cxml::add_child(node, "EncryptedKey", string("enc")); @@ -517,9 +518,9 @@ public: } - void as_xml (xmlpp::Element* node, map& references) const + void as_xml (xmlpp::Element* node, map& references) const { - references["ID_AuthenticatedPublic"] = node->set_attribute ("Id", "ID_AuthenticatedPublic"); + references["ID_AuthenticatedPublic"] = dynamic_cast(node->set_attribute("Id", "ID_AuthenticatedPublic")); cxml::add_text_child(node, "MessageId", "urn:uuid:" + message_id); cxml::add_text_child(node, "MessageType", "http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type"); @@ -567,7 +568,7 @@ public: auto root = document->create_root_node("DCinemaSecurityMessage", "http://www.smpte-ra.org/schemas/430-3/2006/ETM"); root->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "ds"); root->set_namespace_declaration ("http://www.w3.org/2001/04/xmlenc#", "enc"); - map references; + map references; authenticated_public.as_xml(cxml::add_child(root, "AuthenticatedPublic"), references); authenticated_private.as_xml(cxml::add_child(root, "AuthenticatedPrivate"), references); signature.as_xml(cxml::add_child(root, "Signature", string("ds"))); -- cgit v1.2.3