Hack in scope attribute to Atmos KeyType tags.
authorCarl Hetherington <cth@carlh.net>
Wed, 4 Nov 2015 11:57:05 +0000 (11:57 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 Nov 2015 11:57:05 +0000 (11:57 +0000)
src/encrypted_kdm.cc

index 7ee28d1afd9356ba78d8c8e59e33863a03b14ceb..8ecee9f0af126cedea5c06bcfd88296c7349651b 100644 (file)
@@ -231,8 +231,13 @@ public:
 
        void as_xml (xmlpp::Element* node) const
        {
-               node->add_child("KeyType")->add_child_text (key_type);
+               xmlpp::Element* type = node->add_child("KeyType");
+               type->add_child_text (key_type);
                node->add_child("KeyId")->add_child_text ("urn:uuid:" + key_id);
+               /* XXX: this feels like a bit of a hack */
+               if (key_type == "MDEK") {
+                       type->set_attribute ("scope", "http://www.dolby.com/cp850/2012/KDM#kdm-key-type");
+               }
        }
 
        string key_type;