summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-20 23:38:07 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-20 23:38:07 +0100
commit26f6ead44ff6bcb259c1755f91beb0a9e3eee988 (patch)
tree00a3afe3375208ce7cd8f2650fefd368467fc5aa /src
parente52f18d28d90c9deba31a441d566db94be0571b2 (diff)
Allow loading of EncryptedKDMs from strings.
Diffstat (limited to 'src')
-rw-r--r--src/encrypted_kdm.cc7
-rw-r--r--src/encrypted_kdm.h6
-rw-r--r--src/util.h2
3 files changed, 6 insertions, 9 deletions
diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc
index d7cdd8dd..93852fb6 100644
--- a/src/encrypted_kdm.cc
+++ b/src/encrypted_kdm.cc
@@ -484,10 +484,11 @@ public:
}
}
-EncryptedKDM::EncryptedKDM (boost::filesystem::path file)
- : _data (new data::EncryptedKDMData (shared_ptr<cxml::Node> (new cxml::Document ("DCinemaSecurityMessage", file))))
+EncryptedKDM::EncryptedKDM (string s)
{
-
+ shared_ptr<cxml::Document> doc (new cxml::Document ("DCinemaSecurityMessage"));
+ doc->read_string (s);
+ _data = new data::EncryptedKDMData (doc);
}
EncryptedKDM::EncryptedKDM (
diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h
index 0d459d5a..1fcd37f4 100644
--- a/src/encrypted_kdm.h
+++ b/src/encrypted_kdm.h
@@ -52,11 +52,7 @@ class Certificate;
class EncryptedKDM
{
public:
- /** Read a KDM from an XML file.
- * @param file XML file to read.
- */
- EncryptedKDM (boost::filesystem::path file);
-
+ EncryptedKDM (std::string);
EncryptedKDM (EncryptedKDM const & kdm);
EncryptedKDM & operator= (EncryptedKDM const &);
~EncryptedKDM ();
diff --git a/src/util.h b/src/util.h
index d3843e3d..857f872f 100644
--- a/src/util.h
+++ b/src/util.h
@@ -88,7 +88,7 @@ extern void add_signer (xmlpp::Element* parent, CertificateChain const & certifi
extern int base64_decode (std::string const & in, unsigned char* out, int out_length);
extern boost::optional<boost::filesystem::path> relative_to_root (boost::filesystem::path root, boost::filesystem::path file);
extern FILE * fopen_boost (boost::filesystem::path, std::string);
-extern std::string file_to_string (boost::filesystem::path, uintmax_t max_length = 4096);
+extern std::string file_to_string (boost::filesystem::path, uintmax_t max_length = 65536);
extern std::string private_key_fingerprint (std::string key);
template <class F, class T>