Commit c5602849 authored by Simona-Marinela Prodea's avatar Simona-Marinela Prodea Committed by Jean-Baptiste Kempf

dcp: ignore prefixes in XML nodes

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c62a68c5
......@@ -99,13 +99,13 @@ int KDM::Parse()
msg_Dbg( this->p_demux, "parsing KDM..." );
/* read first node and check if it is a KDM */
if( ! ( ( XML_READER_STARTELEM == XmlFile::ReadNextNode( this->p_xmlReader, s_node ) ) && ( s_node == s_root_node ) ) )
if( ! ( ( XML_READER_STARTELEM == XmlFile::ReadNextNode( this->p_demux, this->p_xmlReader, s_node ) ) && ( s_node == s_root_node ) ) )
{
msg_Err( this->p_demux, "not a valid XML KDM" );
goto error;
}
while( ( type = XmlFile::ReadNextNode( this->p_xmlReader, s_node ) ) > 0 )
while( ( type = XmlFile::ReadNextNode( this->p_demux, this->p_xmlReader, s_node ) ) > 0 )
if( type == XML_READER_STARTELEM && s_node == "AuthenticatedPrivate" )
{
_p_key_list = new (nothrow) AESKeyList;
......@@ -146,12 +146,12 @@ int KDM::ParsePrivate( const string _s_node, int _i_type )
goto error;
/* loop on EncryptedKey nodes */
while( ( i_type = XmlFile::ReadNextNode( this->p_xmlReader, s_node ) ) > 0 )
while( ( i_type = XmlFile::ReadNextNode( this->p_demux, this->p_xmlReader, s_node ) ) > 0 )
{
switch( i_type )
{
case XML_READER_STARTELEM:
if( s_node != "enc:EncryptedKey" )
if( s_node != "EncryptedKey" )
goto error;
p_key = new (nothrow) AESKey( this->p_demux );
if( unlikely( p_key == NULL ) )
......@@ -192,17 +192,17 @@ int AESKey::Parse( xml_reader_t *p_xml_reader, string _s_node, int _i_type)
if( _i_type != XML_READER_STARTELEM)
goto error;
if( _s_node != "enc:EncryptedKey" )
if( _s_node != "EncryptedKey" )
goto error;
while( ( i_type = XmlFile::ReadNextNode( p_xml_reader, s_node ) ) > 0 )
while( ( i_type = XmlFile::ReadNextNode( this->p_demux, p_xml_reader, s_node ) ) > 0 )
{
switch( i_type )
{
case XML_READER_STARTELEM:
if( s_node == "enc:CipherValue" )
if( s_node == "CipherValue" )
{
if( XmlFile::ReadEndNode( p_xml_reader, s_node, i_type, s_value ) )
if( XmlFile::ReadEndNode( this->p_demux, p_xml_reader, s_node, i_type, s_value ) )
goto error;
if( this->decryptRSA( s_value ) )
return VLC_EGENERIC;
......
This diff is collapsed.
......@@ -60,15 +60,6 @@ typedef enum {
TRACK_SUBTITLE
} TrackType_t;
typedef enum {
XML_UNKNOWN = 0,
XML_ASSETMAP,
XML_CPL,
XML_PKL,
XML_SUB,
} XmlType_t;
class Asset;
class AssetList: public std::list<Asset *> {};
class PKL;
......@@ -122,17 +113,16 @@ public:
p_demux(p_demux), s_path(s_path),
p_stream(NULL),
p_xml(NULL),
p_xmlReader(NULL),
type(XML_UNKNOWN) {}
p_xmlReader(NULL) {}
virtual ~XmlFile( );
virtual int Parse() = 0;
static int ReadNextNode( xml_reader_t *p_xmlReader, string& s_node );
static int ReadEndNode( xml_reader_t *p_xmlReader, string s_node, int i_type, string &s_value );
static int ReadNextNode( demux_t *p_demux, xml_reader_t *p_xmlReader, string& s_node );
static int ReadEndNode( demux_t *p_demux, xml_reader_t *p_xmlReader, string s_node, int i_type, string &s_value );
bool IsCPL() { return type == XML_CPL; }
int isCPL();
protected:
demux_t *p_demux;
string s_path;
......@@ -143,8 +133,6 @@ protected:
int OpenXml();
void CloseXml();
XmlType_t type;
};
class Chunk {
......@@ -262,7 +250,9 @@ private:
class CPL : public XmlFile
{
public:
CPL(demux_t *, string, AssetList*);
CPL(demux_t * p_demux, string s_path, AssetList *_asset_list)
: XmlFile(p_demux, s_path), asset_list( _asset_list)
{};
~CPL();
virtual int Parse();
......@@ -291,8 +281,9 @@ private :
class PKL : public XmlFile
{
public:
PKL ( demux_t * p_demux, string s_path, AssetList *asset_list,
string s_dcp_path);
PKL( demux_t * p_demux, string s_path, AssetList *_asset_list, string s )
: XmlFile( p_demux, s_path ), asset_list( _asset_list ), s_dcp_path( s )
{};
~PKL();
virtual int Parse();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment