jetwhiz / encfs4win

Windows port of EncFS
https://encfs.win
Other
400 stars 41 forks source link

Renaming file in root dir affects unrelated files while using Null filename encryption #83

Closed vovcacik closed 5 years ago

vovcacik commented 7 years ago

Environment

Description

When I create encfs disk with Null filename encryption and I create empty file aaaa.txt in root dir manually (i.e. not through encfs itself) and non-empty bbbb.txt file, then two files are displayed in encfs encrypted disk a) the encfs config xml file b) aaaa.txt. When I rename bbbb.txt in root dir to -bbbb.txt it will cause the xml file and the aaaa.txt to disappear from the encfs disk.

Expected behavior vs. actual behavior

Renaming bbbb.txt should not affect aaaa.txt or other files.

Steps to reproduce problem

Stay with default values while creating encfs disk, but choose Null filename encryption.

@echo off
mkdir "%temp%\bug"
encfs "%temp%\bug" x:

echo 1234 > "%temp%\bug\bbbb.txt"
type nul > "%temp%\bug\aaaa.txt"

echo Rename %temp%\bug\bbbb.txt to %temp%\bug\-bbbb.txt
pause

pause
dokanctl /u x:
rmdir /S /Q "%temp%\bug"

Relevant logs

Nothing relevant in logs.

jetwhiz commented 5 years ago

The issue here is that you have (what's supposed to be) an encrypted file that is empty and you've also used default settings, which uses per-file IVs (which expects there to be a header in the encrypted files). When the empty file is opened it throws an assertion error, since the length of the file is less than the length of the expected header.

I expect this is the same behavior upstream, since the related code all looks the same. Do you know if this is true @benrubson?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.