You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zipping and encrypting with libarchive will intermittently generate a zip file that won't be able to be unzipped and unencrypted by libarchive itself. A "bad" zip does unzip fine on the terminal though. It has to be executed multiple times and most of the times there's no issue. I isolated as much as possible the libarchive relevant code that could still replicate the issue.
I attached the sample file I've been using. It only contains 1 text file with "this is a test" text. Its password is "password".
In a nutshell the sample code below:
unzips sample.zip
zips and encrypts it back using the original password
- this is where I suspect the error might happen sometimes intermittently.
unzips again (this doesn't seem to be where the error happens but is the way to reveal if something wrong happened in the previous zipping+encrypting step)
Observations:
On a run that fails, the callback function (on the second unzipping, decrypting the "bad" file) seems to not iterate through all passwords needed to reach the actual password of the file (the password is "password", the 4th one in the list).
The zipped file that breaks libarchive does seem to work fine when used on the terminal. (The program saves this file to disk under the name zip_that_breaks_decrypting.zip)
If you use the zip file from a bad run as the sample file (eg. cp zip_that_breaks_decrypting.zip sample.zip and run compile_and_loop.sh ), libarchive will always break with that file.
How I'm building (behaves the same in a more complex build environment) :
clone libarchive-src git repo to libarchive_question/build_materials (You should end up with libarchive_question/build_materials/libarchive-src)
from libarchive_question/build_materials, run cmake and make
from libarchive_question/ run
g++ zip_and_encrypt_bug.cpp -Ibuild_materials/libarchive-src/libarchive -Lbuild_materials/libarchive -larchive
export LD_LIBRARY_PATH=./build_materials/libarchive:$LD_LIBRARY_PATH
while ./a.out ; do echo "heyo" ; done
The program will run several times until it fails and breaks the loop.
The text was updated successfully, but these errors were encountered:
sample_file.zip
zipping and encrypting with libarchive will intermittently generate a zip file that won't be able to be unzipped and unencrypted by libarchive itself. A "bad" zip does unzip fine on the terminal though. It has to be executed multiple times and most of the times there's no issue. I isolated as much as possible the libarchive relevant code that could still replicate the issue.
I attached the sample file I've been using. It only contains 1 text file with "this is a test" text. Its password is "password".
In a nutshell the sample code below:
- this is where I suspect the error might happen sometimes intermittently.
Observations:
How I'm building (behaves the same in a more complex build environment) :
clone libarchive-src git repo to libarchive_question/build_materials (You should end up with libarchive_question/build_materials/libarchive-src)
from libarchive_question/build_materials, run cmake and make
from libarchive_question/ run
The program will run several times until it fails and breaks the loop.
The text was updated successfully, but these errors were encountered: