[ 
https://issues.apache.org/jira/browse/TIKA-2873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16839717#comment-16839717
 ] 

Tim Allison edited comment on TIKA-2873 at 5/14/19 7:20 PM:
------------------------------------------------------------

Our unit tests that test for decryption of ooxml wind up with a 
{{javax.crypto.CipherInputStream}} in OOXMLExtractorFactory, and so everything 
works because the underlying stream is not a {{ChunkedCipherInputStream}}.

The xlsx file that I just generated, however, results in a 
{{ChunkedCipherInputStream}} and shows the bug. 


was (Author: [email protected]):
Our unit tests that test for decryption of ooxml wind up with a 
javax.cryptoCipherInputStream in OOXMLExtractorFactory, and so everything works 
because the underlying stream is not a {{ChunkedCipherInputStream}}.

The xlsx file that I just generated, however, results in a 
{{ChunkedCipherInputStream}} and shows the bug. 

> Some password protected xlsx file no longer opens with password
> ---------------------------------------------------------------
>
>                 Key: TIKA-2873
>                 URL: https://issues.apache.org/jira/browse/TIKA-2873
>             Project: Tika
>          Issue Type: Task
>            Reporter: Tim Allison
>            Priority: Major
>
>   A password protected .xlsx file can no longer be read because there's a bug 
> in POI's ChunkedCipherInputStream:
> {noformat}
> @Override
> public int read() throws IOException {
>     byte[] b = \{ 0 };
>     // FIXME: compare against -1 or 1? (bug 59893)
>     return (read(b) == 1) ? -1 : b[0];
> }
>  {noformat}
>   Reading with a byte[] works fine, but read() individual bytes returns -1 if 
> the stream had something in it.  Because of some recent changes...we now wrap 
> the ChunkedCipherInputStream in a RereadableInputStream...whereas we didn't 
> before...this wrapping is now calling {{read()}} at some point where the 
> stream used to only be {{read(byte[])}}.  We can fix this by wrapping the 
> ChunkedCipherInputStream in a TikaInputStream...
> I think this is significant enough to do a respin of 1.21-rc1...what do you 
> think?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to