readium / readium-sdk

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

Load failure for encrypted EPUB3 Navigation Document, Content Filter Chain out of date with late registration of Content Module #262

Open danielweck opened 7 years ago

danielweck commented 7 years ago

Support for encrypted NavDoc was introduced here: https://github.com/readium/readium-sdk/commit/bdcbdc6d18d83bc50c62ab0c69d0b0e84a3f26e2#diff-db92dd69cdd7ce3a59e70ae293050d98 ...but this only works for EPUB Containers/Packages loaded (unpacked) after the Content Filter registration. Unfortunately the LCP Content Module sub-system requires loading of the License which occurs after the EPUB is opened, so the Content Filter registration occurs too late. As a result the Nav Doc cannot be parsed because of its scrambled encrypted byte stream. LibXml does not crash (fails silently).

I am fixing this now (update: fixed, see comment below)

Also see: https://github.com/readium/readium-sdk/issues/221

danielweck commented 7 years ago

Fixed in feature/lsd branch: https://github.com/readium/readium-sdk/commit/d42485f0577511eb3f745e5a8f60959a9e397c6f

danielweck commented 7 years ago

On the client side (LCP content module): https://github.com/readium/readium-lcp-client/commit/d354426021d154aa8d2aaff41e904dcc80bf575d

danielweck commented 7 years ago

@mmenu-mantano @jmgeffroy CC-ing you guys as I know you looked into the encrypted NavDoc issue :)

danielweck commented 7 years ago

Reminder, fixed in feature/lcp: https://github.com/readium/readium-sdk/commit/d42485f0577511eb3f745e5a8f60959a9e397c6f

...and recently API slightly changed to address the same problem with Media Overlays (encrypted SMIL files): https://github.com/readium/readium-sdk/commit/24e004ae197e3bd90a5c5c1e67901810396e7d6e

See related issue: https://github.com/readium/readium-sdk/issues/272