readium / readium-sdk

A C++ ePub renderer SDK
BSD 3-Clause "New" or "Revised" License
388 stars 164 forks source link

XML I/O error : Attempt to load network entity #277

Closed danielweck closed 7 years ago

danielweck commented 7 years ago

Despite this fix: https://github.com/readium/readium-sdk/commit/ae7c0b85a4274886c7545283571ea37610ec39c1

...it seems that NCX (XML) documents with the following DOCTYPE declaration:

<?xml version="1.0"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx/">

...result in the following message: I/O error : Attempt to load network entity http://www.daisy.org/z3986/2005/ncx-2005-1.dtd

...which seems to be benign with clear EPUBs (error is ignored), but blocking / fatal with encrypted EPUBs (not sure why yet).

danielweck commented 7 years ago

I encrypted the test EPUB myself using the standard LCP Go server implementation. The protected EPUB opens fine the standard Readium SDK Launcher. My conclusion is that the I/O Error message is a benign libxml warning due to the XML_PARSE_RECOVER | XML_PARSE_DTDATTR | XML_PARSE_NONET flags, and that the culprit is in the private LCP server implementation.