Skip to content

Encrypted .doc reports a parse error instead of being detected as encrypted #638

Description

@andiwand

odr-public/doc/encrypted.doc is not recognised as encrypted. Instead the legacy .doc parser reads the encrypted bytes as structure and throws:

app.opendocument.core.OdrException: Unexpected negative Fib.ccpText: -1408755250

The equivalent fixtures in the other formats behave correctly — docx/encrypted.docx and xlsx/encrypted.xlsx both surface as encrypted and get a password prompt.

Why it matters downstream

OpenDocument.droid keys its password dialog off OdrException.FileEncrypted. Because this arrives as a generic error instead, the app concludes the format is unsupported and offers to upload the document to the online conversion service — for a file that is supported and only needs a password. So the user is nudged into sending a document off-device to solve a problem a password prompt would have solved.

Repro

Open test/data/input/odr-public/doc/encrypted.doc.

Expected: FileEncrypted (as for encrypted.docx / encrypted.xlsx).
Actual: OdrException: Unexpected negative Fib.ccpText: -1408755250.

Found while sweeping the whole input corpus on an Android device (opendocument-app/OpenDocument.droid#550); it was the only file of 225 that failed this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions