From 50ea21132b763d773daeaf87e5968e8257265ad0 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 2 Dec 2007 12:52:00 +0000 Subject: ASF/WMA: Check if the file is encrypted. If so, don't try to play it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15867 a1c6a512-1295-4272-9138-f99709370657 --- apps/metadata/asf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/metadata/asf.c b/apps/metadata/asf.c index 65c99f4b07..c938cc6d0e 100644 --- a/apps/metadata/asf.c +++ b/apps/metadata/asf.c @@ -58,7 +58,8 @@ enum asf_error_e { ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */ ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */ ASF_ERROR_SEEKABLE = -9, /* file not seekable */ - ASF_ERROR_SEEK = -10 /* file is seekable but seeking failed */ + ASF_ERROR_SEEK = -10, /* file is seekable but seeking failed */ + ASF_ERROR_ENCRYPTED = -11 /* file is encrypted */ }; static const guid_t asf_guid_null = @@ -89,6 +90,12 @@ static const guid_t asf_guid_content_description = static const guid_t asf_guid_extended_content_description = {0xD2D0A440, 0xE307, 0x11D2, {0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50}}; +static const guid_t asf_guid_content_encryption = +{0x2211b3fb, 0xbd23, 0x11d2, {0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e}}; + +static const guid_t asf_guid_extended_content_encryption = +{0x298ae614, 0x2622, 0x4c17, {0xb9, 0x35, 0xda, 0xe0, 0x7e, 0xe9, 0x28, 0x9c}}; + /* stream type guids */ static const guid_t asf_guid_stream_type_audio = @@ -462,6 +469,10 @@ static int asf_parse_header(int fd, struct mp3entry* id3, } lseek(fd, bytesleft, SEEK_CUR); + } else if (asf_guid_match(¤t.guid, &asf_guid_content_encryption) + || asf_guid_match(¤t.guid, &asf_guid_extended_content_encryption)) { + //DEBUGF("File is encrypted\n"); + return ASF_ERROR_ENCRYPTED; } else { //DEBUGF("Skipping %d bytes of object\n",(int)(current.size - 24)); lseek(fd,current.size - 24,SEEK_CUR); -- cgit v1.2.3