summaryrefslogtreecommitdiff
path: root/source/html/epub-doc.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-05-05 20:21:18 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-05-05 20:55:53 +0200
commit2b3bd1b7dbbf13f82b70587676809f189354c77a (patch)
tree22b96944ac5affe33f317df1baff7d3a96eb079a /source/html/epub-doc.c
parent7a04cf3e3a23cff52214e2045e93ef44066d5de5 (diff)
downloadmupdf-2b3bd1b7dbbf13f82b70587676809f189354c77a.tar.xz
epub: Bail if rights.xml or encryption.xml are present (not DRM-free EPUB).
Diffstat (limited to 'source/html/epub-doc.c')
-rw-r--r--source/html/epub-doc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
index e77770ac..b7b24c42 100644
--- a/source/html/epub-doc.c
+++ b/source/html/epub-doc.c
@@ -203,6 +203,11 @@ epub_parse_header(fz_context *ctx, epub_document *doc)
char ncx[2048], s[2048];
epub_chapter *head, *tail;
+ if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml"))
+ fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
+ if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml"))
+ fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
+
/* parse META-INF/container.xml to find OPF */
buf = fz_read_archive_entry(ctx, zip, "META-INF/container.xml");