Skip to content

fix: resolve AES-encrypted 7z file download blocking on last bytes - #162

Merged
javi11 merged 1 commit into
mainfrom
fix/aes-encrypted-7z-segment-mapping
Dec 23, 2025
Merged

fix: resolve AES-encrypted 7z file download blocking on last bytes#162
javi11 merged 1 commit into
mainfrom
fix/aes-encrypted-7z-segment-mapping

Conversation

@javi11

@javi11 javi11 commented Dec 23, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Fix segment mapping to include AES padding bytes for encrypted 7z files
  • Pass correct encryption type (AES) during validation instead of NONE
  • Add AES block size calculation to validation size comparison

Test plan

  • Import a password-protected 7z archive containing a media file
  • Download the file via WebDAV mount
  • Verify the file downloads completely without blocking
  • Verify the decrypted file size matches the expected size
  • Verify the file plays correctly (if video/audio)

🤖 Generated with Claude Code

The download of AES-encrypted files from 7z archives was blocking when
trying to read the last few bytes. This was caused by two issues:

1. Segment mapping used decrypted file size instead of encrypted size.
   AES-CBC pads data to 16-byte block boundaries, so the encrypted data
   is larger than the decrypted size. The segment mapping now includes
   the padding bytes.

2. Validation passed Encryption_NONE for AES-encrypted files and didn't
   account for AES padding when comparing segment sizes. Now correctly
   passes Encryption_AES and calculates expected size with padding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javi11
javi11 merged commit 67a9fb5 into main Dec 23, 2025
1 check passed
@javi11
javi11 deleted the fix/aes-encrypted-7z-segment-mapping branch February 4, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant