You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition, this specification defines that the following files must not be encrypted: META-INF/license.lcpl.
Navigation Documents referenced in any Package Document from the Publication (all Publication Resources listed in the Publication manifest with the "nav" property)
NCX documents referenced in any Package Document from the Publication (all Publication Resources listed in the Publication manifest with the media type “application/x-dtbncx+xml”)
Cover images (all Publication Resources listed in the Publication manifest with the "cover-image" property)
Note media-type="text/xml" instead of application/x-dtbncx+xml => the Go code does not consider the manifest item as the NCX, goes on to encrypt the resource.
Possible solution: discover the NCX via the spine@toc="ncx" indirection, which indirectly references the manifest item id="ncx". This feels heavy-handed, but this is a viable workaround for badly-authored EPUB2 publications (assuming media-type="application/x-dtbncx+xml" is mandatory for NCX, I must admit I haven't checked the specification).
Other solution: fix reading systems (e.g. Thorium, which currently fails to open the publication), by either ignoring the encrypted NCX, or by implementing a delayed parsing strategy (I think ReadiumSDK C/C++ code implemented an alternative codepath to wait for LCP passphrase before starting the parsing of core resources such as NCX/NavDoc or Cover Image)
Other solution: do nothing. Content creators / publishers have the responsibility to fix their publications (the reality is that many "legacy" publications exist and will never be updated).
Other solution: the Go code rejects such publication when it detects that there is an inconsistency
... or alternatively the Go code patches the incorrect media-type (bad idea I think, not just because it would break resource-level signatures, but also because this is not the responsibility of the LCP encryptor)
The LCP specification:
https://github.com/readium/lcp-specs/blob/master/releases/lcp/latest.md#21-encrypted-resources
To reproduce:
LSD:
https://lsd-test.edrlab.org/licenses/999806a1-62cd-4f95-a455-6fd9099929c7/status
LCP license:
https://front-test.edrlab.org/api/v1/licenses/999806a1-62cd-4f95-a455-6fd9099929c7
EPUB download link:
https://lcp-test.edrlab.org/contents/1957d6ca-12b3-4918-baa5-41810a2e9e8e
content.opf
:Note
media-type="text/xml"
instead ofapplication/x-dtbncx+xml
=> the Go code does not consider the manifest item as the NCX, goes on to encrypt the resource.Code references:
readium-lcp-server/epub/reader.go
Lines 170 to 192 in de6e238
readium-lcp-server/epub/epub.go
Line 26 in de6e238
The text was updated successfully, but these errors were encountered: