From 23445cd543c69113f4f82bce7362d6fc20cc0bfa Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Fri, 22 Nov 2013 17:11:25 +0100 Subject: [PATCH 1/1] demux: asf: reject DRM'ed files Keep #8241 open ??? --- modules/demux/asf/asf.c | 11 +++++++++++ modules/demux/asf/libasf.c | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c index befcf59107..a8563be74b 100644 --- a/modules/demux/asf/asf.c +++ b/modules/demux/asf/asf.c @@ -755,6 +755,17 @@ static int DemuxInit( demux_t *p_demux ) goto error; } + if ( ASF_FindObject( p_sys->p_root->p_hdr, + &asf_object_content_encryption_guid, 0 ) != NULL + || ASF_FindObject( p_sys->p_root->p_hdr, + &asf_object_extended_content_encryption_guid, 0 ) != NULL + || ASF_FindObject( p_sys->p_root->p_hdr, + &asf_object_advanced_content_encryption_guid, 0 ) != NULL ) + { + msg_Warn( p_demux, "ASF plugin discarded (DRM encumbered content)" ); + goto error; + } + p_sys->i_track = ASF_CountObject( p_sys->p_root->p_hdr, &asf_object_stream_properties_guid ); if( p_sys->i_track <= 0 ) diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c index 79b109079c..9170e20aa0 100644 --- a/modules/demux/asf/libasf.c +++ b/modules/demux/asf/libasf.c @@ -1241,6 +1241,13 @@ static void ASF_FreeObject_marker( asf_object_t *p_obj) FREENULL( p_mk->name ); } +static int ASF_ReadObject_Raw(stream_t *s, asf_object_t *p_obj) +{ + VLC_UNUSED(s); + VLC_UNUSED(p_obj); + return VLC_SUCCESS; +} + #if 0 static int ASF_ReadObject_XXX(stream_t *s, asf_object_t *p_obj) { @@ -1318,6 +1325,12 @@ static const struct { &asf_object_extended_content_description, ASF_OBJECT_OTHER, ASF_ReadObject_extended_content_description, ASF_FreeObject_extended_content_description }, + { &asf_object_content_encryption_guid, ASF_OBJECT_OTHER, + ASF_ReadObject_Raw, ASF_FreeObject_Null }, + { &asf_object_advanced_content_encryption_guid, ASF_OBJECT_OTHER, + ASF_ReadObject_Raw, ASF_FreeObject_Null }, + { &asf_object_extended_content_encryption_guid, ASF_OBJECT_OTHER, + ASF_ReadObject_Raw, ASF_FreeObject_Null }, { &asf_object_null_guid, 0, NULL, NULL } }; @@ -1468,6 +1481,9 @@ static const struct { &asf_object_advanced_mutual_exclusion, "Advanced Mutual Exclusion" }, { &asf_object_stream_prioritization, "Stream Prioritization" }, { &asf_object_extended_content_description, "Extended content description"}, + { &asf_object_content_encryption_guid, "Content Encryption"}, + { &asf_object_advanced_content_encryption_guid, "Advanced Content Encryption"}, + { &asf_object_extended_content_encryption_guid, "Entended Content Encryption"}, { NULL, "Unknown" }, }; -- 2.39.2