summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-12-02 12:52:00 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-12-02 12:52:00 +0000
commit50ea21132b763d773daeaf87e5968e8257265ad0 (patch)
treec48916d9011a8c8e5419755379ef465626932050 /apps
parent7b90826ae11314dd41e0ec18d69eae3422c006ad (diff)
downloadrockbox-50ea21132b763d773daeaf87e5968e8257265ad0.zip
rockbox-50ea21132b763d773daeaf87e5968e8257265ad0.tar.gz
rockbox-50ea21132b763d773daeaf87e5968e8257265ad0.tar.bz2
rockbox-50ea21132b763d773daeaf87e5968e8257265ad0.tar.xz
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
Diffstat (limited to 'apps')
-rw-r--r--apps/metadata/asf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/metadata/asf.c b/apps/metadata/asf.c
index 65c99f4..c938cc6 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(&current.guid, &asf_guid_content_encryption)
+ || asf_guid_match(&current.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);