You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2012/08/30 18:22:07 UTC

[jira] [Created] (TIKA-986) NullPointerException trying to parse detached .pk7s signature

Michael McCandless created TIKA-986:
---------------------------------------

             Summary: NullPointerException trying to parse detached .pk7s signature
                 Key: TIKA-986
                 URL: https://issues.apache.org/jira/browse/TIKA-986
             Project: Tika
          Issue Type: Bug
            Reporter: Michael McCandless
            Assignee: Michael McCandless
             Fix For: 1.3


Our Pkcs7Parser tries to pull the signed content out and then parses
that, but if the signature is detached then there is no content (we
get null return from CMSSignedDataParser.getSignedContent) and we hit
NPE:

{noformat}
Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
	at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
	at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
	at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
Caused by: java.lang.NullPointerException
	at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
	... 5 more
{noformat}

I think fix is trivial: if we get null return then throw a
TikaException saying there's nothing to extract.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TIKA-986) NullPointerException trying to parse detached .pk7s signature

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated TIKA-986:
-----------------------------

    Attachment: smime.p7s
    
> NullPointerException trying to parse detached .pk7s signature
> -------------------------------------------------------------
>
>                 Key: TIKA-986
>                 URL: https://issues.apache.org/jira/browse/TIKA-986
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 1.3
>
>         Attachments: smime.p7s, TIKA-986.patch
>
>
> Our Pkcs7Parser tries to pull the signed content out and then parses
> that, but if the signature is detached then there is no content (we
> get null return from CMSSignedDataParser.getSignedContent) and we hit
> NPE:
> {noformat}
> Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
> 	at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
> 	at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
> 	at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
> Caused by: java.lang.NullPointerException
> 	at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	... 5 more
> {noformat}
> I think fix is trivial: if we get null return then throw a
> TikaException saying there's nothing to extract.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (TIKA-986) NullPointerException trying to parse detached .pk7s signature

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved TIKA-986.
-------------------------------------

    Resolution: Fixed
    
> NullPointerException trying to parse detached .pk7s signature
> -------------------------------------------------------------
>
>                 Key: TIKA-986
>                 URL: https://issues.apache.org/jira/browse/TIKA-986
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 1.3
>
>         Attachments: smime.p7s, TIKA-986.patch, TIKA-986.patch
>
>
> Our Pkcs7Parser tries to pull the signed content out and then parses
> that, but if the signature is detached then there is no content (we
> get null return from CMSSignedDataParser.getSignedContent) and we hit
> NPE:
> {noformat}
> Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
> 	at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
> 	at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
> 	at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
> Caused by: java.lang.NullPointerException
> 	at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	... 5 more
> {noformat}
> I think fix is trivial: if we get null return then throw a
> TikaException saying there's nothing to extract.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TIKA-986) NullPointerException trying to parse detached .pk7s signature

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated TIKA-986:
------------------------------------

    Attachment: TIKA-986.patch

Patch, I think it's ready.

The example I have isn't shareable ... if someone knows how to easily make a committable detached PKCS7 signature that would be great!
                
> NullPointerException trying to parse detached .pk7s signature
> -------------------------------------------------------------
>
>                 Key: TIKA-986
>                 URL: https://issues.apache.org/jira/browse/TIKA-986
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 1.3
>
>         Attachments: TIKA-986.patch
>
>
> Our Pkcs7Parser tries to pull the signed content out and then parses
> that, but if the signature is detached then there is no content (we
> get null return from CMSSignedDataParser.getSignedContent) and we hit
> NPE:
> {noformat}
> Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
> 	at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
> 	at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
> 	at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
> Caused by: java.lang.NullPointerException
> 	at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	... 5 more
> {noformat}
> I think fix is trivial: if we get null return then throw a
> TikaException saying there's nothing to extract.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TIKA-986) NullPointerException trying to parse detached .pk7s signature

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated TIKA-986:
------------------------------------

    Attachment: TIKA-986.patch

Awesome, thanks Robert: new patch with test case.  I think it's ready.
                
> NullPointerException trying to parse detached .pk7s signature
> -------------------------------------------------------------
>
>                 Key: TIKA-986
>                 URL: https://issues.apache.org/jira/browse/TIKA-986
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 1.3
>
>         Attachments: smime.p7s, TIKA-986.patch, TIKA-986.patch
>
>
> Our Pkcs7Parser tries to pull the signed content out and then parses
> that, but if the signature is detached then there is no content (we
> get null return from CMSSignedDataParser.getSignedContent) and we hit
> NPE:
> {noformat}
> Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
> 	at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
> 	at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
> 	at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
> Caused by: java.lang.NullPointerException
> 	at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	... 5 more
> {noformat}
> I think fix is trivial: if we get null return then throw a
> TikaException saying there's nothing to extract.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira