Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2873

Some password protected xlsx files no longer open with password

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.21
    • Component/s: None
    • Labels:
      None

      Description

        A password protected .xlsx file can no longer be read because there's a bug in POI's ChunkedCipherInputStream:

      @Override
      public int read() throws IOException {
          byte[] b = \{ 0 };
          // FIXME: compare against -1 or 1? (bug 59893)
          return (read(b) == 1) ? -1 : b[0];
      }
       

        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?

        Attachments

          Activity

            People

            • Assignee:
              tallison Tim Allison
              Reporter:
              tallison Tim Allison
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: