Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
c5602849
Commit
c5602849
authored
May 14, 2014
by
Simona-Marinela Prodea
Committed by
Jean-Baptiste Kempf
May 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dcp: ignore prefixes in XML nodes
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
c62a68c5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
178 additions
and
136 deletions
+178
-136
modules/access/dcp/dcpdecrypt.cpp
modules/access/dcp/dcpdecrypt.cpp
+8
-8
modules/access/dcp/dcpparser.cpp
modules/access/dcp/dcpparser.cpp
+160
-109
modules/access/dcp/dcpparser.h
modules/access/dcp/dcpparser.h
+10
-19
No files found.
modules/access/dcp/dcpdecrypt.cpp
View file @
c5602849
...
...
@@ -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
;
...
...
modules/access/dcp/dcpparser.cpp
View file @
c5602849
This diff is collapsed.
Click to expand it.
modules/access/dcp/dcpparser.h
View file @
c5602849
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment