Skip to content

Commit

Permalink
epub: Bail if rights.xml or encryption.xml are present (not DRM-free …
Browse files Browse the repository at this point in the history
…EPUB).
  • Loading branch information
ccxvii committed May 5, 2015
1 parent 7a04cf3 commit 2b3bd1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/html/epub-doc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2b3bd1b

Please sign in to comment.