diff --git a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java index 10d1f58c7..5a2bfc21c 100644 --- a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java +++ b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java @@ -293,7 +293,7 @@ private void initialize() severities.put(MessageId.RSC_001, Severity.ERROR); severities.put(MessageId.RSC_002, Severity.FATAL); severities.put(MessageId.RSC_003, Severity.ERROR); - severities.put(MessageId.RSC_004, Severity.ERROR); + severities.put(MessageId.RSC_004, Severity.INFO); severities.put(MessageId.RSC_005, Severity.ERROR); severities.put(MessageId.RSC_006, Severity.ERROR); severities.put(MessageId.RSC_006b, Severity.USAGE); diff --git a/src/main/java/com/adobe/epubcheck/ocf/AdobeFontManglingFilter.java b/src/main/java/com/adobe/epubcheck/ocf/AdobeFontManglingFilter.java index 773007dc0..fd2aeb32f 100644 --- a/src/main/java/com/adobe/epubcheck/ocf/AdobeFontManglingFilter.java +++ b/src/main/java/com/adobe/epubcheck/ocf/AdobeFontManglingFilter.java @@ -13,10 +13,9 @@ public AdobeFontManglingFilter(String Uid) public boolean canDecrypt() { - //FIXME we force return true to not issue a false-positive warning (see Issue 220) - // ultimately, we need to pass the concatenated publication IDs (encryption key) + //TODO we need to pass the concatenated publication IDs (encryption key) // and implement de-obfuscation. - return true; + return false; // return uniqueIdentifier != null; } diff --git a/src/main/java/com/adobe/epubcheck/ocf/IDPFFontManglingFilter.java b/src/main/java/com/adobe/epubcheck/ocf/IDPFFontManglingFilter.java index db39bbc62..12a4a374f 100644 --- a/src/main/java/com/adobe/epubcheck/ocf/IDPFFontManglingFilter.java +++ b/src/main/java/com/adobe/epubcheck/ocf/IDPFFontManglingFilter.java @@ -13,10 +13,9 @@ public IDPFFontManglingFilter(String Uid) public boolean canDecrypt() { - //FIXME we force return true to not issue a false-positive warning (see Issue 220) - // ultimately, we need to pass the concatenated publication IDs (encryption key) + // TODO we need to pass the concatenated publication IDs (encryption key) // and implement de-obfuscation. - return true; + return false; // return uniqueIdentifier != null; } diff --git a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java index c14299ab1..9e9b06cb2 100644 --- a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java +++ b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java @@ -1412,7 +1412,7 @@ public void testDuplicateResources() @Test public void testEncryption_Unknown(){ - expectedErrors.add(MessageId.RSC_004); + expectedInfos.add(MessageId.RSC_004); testValidateDocument("invalid/encryption-unknown"); } @@ -1472,4 +1472,11 @@ public void testEncryption_DuplicateIDs() Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005); testValidateDocument("invalid/encryption-duplicate-ids"); } + + @Test + public void testObfuscatedSVG() + { + expectedInfos.add(MessageId.RSC_004); + testValidateDocument("valid/container-obfuscation-svg-valid"); + } } diff --git a/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java b/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java index 5e3a42296..b3a2a99bb 100644 --- a/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java +++ b/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java @@ -198,6 +198,7 @@ public void testValidateEPUB30Issue289() @Test public void testValidateEPUB30FontObfuscation() { + Collections.addAll(expectedInfos, MessageId.RSC_004); testValidateDocument("valid/font-obfuscation.epub"); } diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/content_001.xhtml b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/content_001.xhtml new file mode 100644 index 000000000..601da6e51 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/content_001.xhtml @@ -0,0 +1,12 @@ + + + + + Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ a smiling emoji + + diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/emoji.svg b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/emoji.svg new file mode 100644 index 000000000..a38e26d9e Binary files /dev/null and b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/emoji.svg differ diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/nav.xhtml new file mode 100644 index 000000000..fb044b8c6 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/nav.xhtml @@ -0,0 +1,19 @@ + + + + + Minimal Nav + + + + + + diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/package.opf b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/package.opf new file mode 100644 index 000000000..9f4ba40d7 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/EPUB/package.opf @@ -0,0 +1,17 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/container.xml b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/container.xml new file mode 100644 index 000000000..8da9fbae4 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/encryption.xml b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/encryption.xml new file mode 100644 index 000000000..d172242b5 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/META-INF/encryption.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/mimetype b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/mimetype new file mode 100644 index 000000000..57ef03f24 --- /dev/null +++ b/src/test/resources/30/expanded/valid/container-obfuscation-svg-valid/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json index b086c4410..b6e112978 100644 --- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json @@ -320,5 +320,17 @@ "context" : null } ], "suggestion" : null + }, { + "ID" : "RSC-004", + "severity" : "INFO", + "message" : "File \"OEBPS/fonts/ChaparralPro-Regular.otf\" could not be decrypted.", + "additionalLocations" : 0, + "locations" : [ { + "path" : "font_encryption_adobe.epub", + "line" : -1, + "column" : -1, + "context" : null + } ], + "suggestion" : null } ] } diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json index e857173a7..6e88651f3 100644 --- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json @@ -7,7 +7,7 @@ "checkDate" : "09-05-2014 03:17:17", "elapsedTime" : 25, "nFatal" : 0, - "nError" : 2, + "nError" : 1, "nWarning" : 0, "nUsage" : 6 }, @@ -322,7 +322,7 @@ "suggestion" : null }, { "ID" : "RSC-004", - "severity" : "ERROR", + "severity" : "INFO", "message" : "File \"OEBPS/fonts/ChaparralPro-Regular.otf\" could not be decrypted.", "additionalLocations" : 0, "locations" : [ { diff --git a/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_encryption_binary_content.epub_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_encryption_binary_content.epub_expected_results.xml index e3cc159f8..83ba8e107 100644 --- a/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_encryption_binary_content.epub_expected_results.xml +++ b/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_encryption_binary_content.epub_expected_results.xml @@ -12,7 +12,6 @@ 2.0.1 Not well-formed - RSC-004, ERROR, [File 'OEBPS/Text/pdfMigration.html' could not be decrypted.], epub20_encryption_binary_content.epub RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (24-67) RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (30-82) RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (36-81) diff --git a/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_minimal_encryption.epub_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_minimal_encryption.epub_expected_results.xml index 651ed2452..e51c1f0e3 100644 --- a/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_minimal_encryption.epub_expected_results.xml +++ b/src/test/resources/com/adobe/epubcheck/test/encryption/epub20_minimal_encryption.epub_expected_results.xml @@ -12,7 +12,6 @@ 2.0.1 Not well-formed - RSC-004, ERROR, [File 'OEBPS/Text/pdfMigration.html' could not be decrypted.], epub20_minimal_encryption.epub RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (24-67) RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (30-82) RSC-012, ERROR, [Fragment identifier is not defined.], OEBPS/toc.ncx (36-81)