[
https://issues.apache.org/jira/browse/TIKA-4999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18132615#comment-18132615
]
ASF GitHub Bot commented on TIKA-4999:
--------------------------------------
Copilot commented on code in PR #3420:
URL: https://github.com/apache/tika/pull/3420#discussion_r4382171785
##########
tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml:
##########
@@ -4991,6 +4991,16 @@
<mime-type type="application/x-pkcs7-certificates">
<glob pattern="*.p7b"/>
<glob pattern="*.spc"/>
+ <!
> Certs-only PKCS#7 (.p7b) detected as application/pkcs7-signature instead of
> application/x-pkcs7-certificates
> -------------------------------------------------------------------------------------------------------------
>
> Key: TIKA-4999
> URL: https://issues.apache.org/jira/browse/TIKA-4999
> Project: Tika
> Issue Type: Bug
> Components: tika-core
> Reporter: Subbu
> Priority: Major
>
> Issue:
> A certificates-only PKCS#7 file (a .p7b bundle with no signers and no
> content) is detected by content as _application/pkcs7-signature._
> Cause:
> The application/pkcs7-signature magic matches only the outer wrapper, a DER
> ContentInfo with the signedData OID. Certs-only bundles and real signatures
> share that wrapper
> Fix:
> Add a magic rule to application/x-pkcs7-certificates at priority 60, above
> the signature rule's 50. It matches the signedData wrapper, then requires an
> empty digestAlgorithms set (31 00). A real signature has at least one digest
> algorithm, so it doesn't match.
> A test in Pkcs7DetectionTest uses existing content.
> testPKCS7_certs_only_def.p7c is detected as x-pkcs7-certificates by content.
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)