Skip to content

Epubcheck 5.2.1 java.lang.IllegalArgumentException for the same EncryptedData twice #1607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JackieFei opened this issue Apr 14, 2025 · 1 comment
Assignees
Labels
status: accepted Ready to be further processed type: bug The issue describes a bug

Comments

@JackieFei
Copy link

Hi,

rename IllegalArgumentException.zip to .epub

This is a sample subset epub from my customer, and seems to be made by Adobe InDesign 17.3, then modified by calibre:186.

Epubcheck 5.2.1 throw a Exception :

java.lang.IllegalArgumentException: Multiple entries with same key: https://b73edd61-1c05-4a6b-ae09-fcc19ddf1940.epubcheck.w3c.org/OEBPS/font/AdobeFangsongStd-Regular.otf=com.adobe.epubcheck.ocf.encryption.IDPFFontManglingFilter@6e41ba2 and https://b73edd61-1c05-4a6b-ae09-fcc19ddf1940.epubcheck.w3c.org/OEBPS/font/AdobeFangsongStd-Regular.otf=com.adobe.epubcheck.ocf.encryption.IDPFFontManglingFilter@dfa9893
	at com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:378)
	at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:372)
	at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:246)
	at com.google.common.collect.RegularImmutableMap.fromEntryArrayCheckingBucketOverflow(RegularImmutableMap.java:133)
	at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:95)
	at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:572)
	at com.google.common.collect.ImmutableMap$Builder.buildOrThrow(ImmutableMap.java:600)
	at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:587)
	at com.adobe.epubcheck.ocf.OCFContainer.<init>(OCFContainer.java:77)
	at com.adobe.epubcheck.ocf.OCFContainer$Builder.build(OCFContainer.java:56)
	at com.adobe.epubcheck.ocf.OCFCheckerState.getContainer(OCFCheckerState.java:157)
	at com.adobe.epubcheck.ocf.OCFChecker.checkOtherMetaFiles(OCFChecker.java:492)
	at com.adobe.epubcheck.ocf.OCFChecker.check(OCFChecker.java:159)
	at com.adobe.epubcheck.api.EpubCheck.doValidate(EpubCheck.java:218)
	at com.adobe.epubcheck.tool.EpubChecker.validateFile(EpubChecker.java:253)
	at com.adobe.epubcheck.tool.EpubChecker.processFile(EpubChecker.java:328)
	at com.adobe.epubcheck.tool.EpubChecker.run(EpubChecker.java:151)
	at com.adobe.epubcheck.tool.Checker.main(Checker.java:31)

It's caused by encryption.xml

<encryption xmlns="urn:oasis:names:tc:opendocument:xmlns:container" xmlns:enc="http://www.w3.org/2001/04/xmlenc#">
	<enc:EncryptedData>
		<enc:EncryptionMethod Algorithm="http://www.idpf.org/2008/embedding" />
		<enc:CipherData>
			<enc:CipherReference URI="OEBPS/font/AdobeFangsongStd-Regular.otf" />
		</enc:CipherData>
	</enc:EncryptedData>
	<enc:EncryptedData>
		<enc:EncryptionMethod Algorithm="http://www.idpf.org/2008/embedding" />
		<enc:CipherData>
			<enc:CipherReference URI="OEBPS/font/AdobeFangsongStd-Regular.otf" />
		</enc:CipherData>
	</enc:EncryptedData>
</encryption>

AdobeFangsongStd-Regular.otf exists once is OK (in fact is only INFO(RSC-004)), twice is IllegalArgumentException.

@rdeltour
Copy link
Member

Thanks for the report, I'll look into it!

@rdeltour rdeltour self-assigned this Apr 14, 2025
@rdeltour rdeltour added type: bug The issue describes a bug status: accepted Ready to be further processed labels Apr 14, 2025
@rdeltour rdeltour added this to the Next maintenance release milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Ready to be further processed type: bug The issue describes a bug
Projects
None yet
Development

No branches or pull requests

2 participants