feat: downgrade RSC-004 (cannot decrypt resource) to INFO #1136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unless I'm missing something, the spec doesn’t say that a reading system MUST or SHOULD support EPUB encryption.
EPUBCheck currently cannot decrypt encrypted or obfuscated resources. Previously, it reported any attempt to read an encrypted resource as an error, RSC-004. Internally, the code declared obfuscated resources as readable, even if it cannot practically read it, to not report obfuscated fonts as errors.
This is problematic for resources that EPUBCheck will try to parse deeper down the validation workflow (like SVG). The resource is declared as readable, so EPUBCheck tries to parse it, and fails with a
NullPointerException
(issue #1077).The inability to read encrypted or obfuscated resources is a limitation of EPUBCheck. EPUBCheck should:
This PR tries to do that by downgrading the severity of RSC-004 to
USAGE
. It also updates the de-encryption filters to accurately report that they cannot read the content. Validation of encrypted or obfuscated resource will then abort early, before trying to parse the content.Obfuscated fonts, which are likely the most common usage of obfuscation, will keep on not being reported as warnings (see issue #220). The only difference is that they will now trigger the RSC-004 usage message.
Fixes #1077