Skip to content

bug: encrypted ZIP reports misleading 'corrupted or malformed' error instead of 'encrypted' #83

@bug-ops

Description

@bug-ops

Summary

When extracting a password-protected ZIP archive, exarch returns a generic corruption hint instead of a clear encryption error:

Error: Invalid archive 'encrypted.zip': failed to check entry 0 for encryption:
  unsupported Zip archive: Password required to decrypt file
HINT: The archive may be corrupted or malformed.

Compare to 7z encrypted archives which correctly identify the issue:

Error: operation denied by security policy: encrypted 7z archive detected.
  Password-protected archives are not supported. Decrypt the archive externally and try again.

Expected behavior

Error: Invalid archive 'encrypted.zip': archive is password-protected.
  Password-protected ZIP archives are not supported. Decrypt the archive externally and try again.

Root cause

The ZIP extraction code wraps the zip crate error "Password required to decrypt file" in the generic InvalidArchive variant, which surfaces the generic corruption hint. The error string should be detected and mapped to a dedicated message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoreChanges to exarch-core

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions