summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-11 20:14:20 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-11 20:14:20 +0100
commit4ca880c8c6f2ba2bfbdf8be8abae08daa5991775 (patch)
tree8697e42eb9650f1247e4256ad90afef7ce19cf0b
parentc81be5abba47034760db125156bf80d9fcbdfc39 (diff)
DeviceListDescription is optional.
-rw-r--r--src/encrypted_kdm.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc
index c3d8a618..5b596b80 100644
--- a/src/encrypted_kdm.cc
+++ b/src/encrypted_kdm.cc
@@ -269,7 +269,7 @@ public:
AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
: device_list_identifier (node->string_child ("DeviceListIdentifier").substr (9))
- , device_list_description (node->string_child ("DeviceListDescription"))
+ , device_list_description (node->optional_string_child ("DeviceListDescription"))
, certificate_thumbprint (node->node_child("DeviceList")->string_child ("CertificateThumbprint"))
{
@@ -278,14 +278,16 @@ public:
void as_xml (xmlpp::Element* node) const
{
node->add_child ("DeviceListIdentifier")->add_child_text ("urn:uuid:" + device_list_identifier);
- node->add_child ("DeviceListDescription")->add_child_text (device_list_description);
+ if (device_list_description) {
+ node->add_child ("DeviceListDescription")->add_child_text (device_list_description.get());
+ }
xmlpp::Element* device_list = node->add_child ("DeviceList");
device_list->add_child("CertificateThumbprint")->add_child_text (certificate_thumbprint);
}
/** DeviceListIdentifier without the urn:uuid: prefix */
string device_list_identifier;
- string device_list_description;
+ boost::optional<string> device_list_description;
string certificate_thumbprint;
};