Bug 351608

Summary: 7z format does not respect the unchecked Header-Encryption checkbox
Product: [Applications] ark Reporter: Elvis Angelaccio <elvis.angelaccio>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal CC: rthomsen6
Priority: NOR Keywords: junior-jobs
Version: 15.08.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 15.08.2
Sentry Crash Report:

Description Elvis Angelaccio 2015-08-22 10:33:49 UTC
When creating a new, encrypted, 7z archive, Ark will always create an archive with header encryption enabled, regardless the checking status of the "Ask for password before showing the list of files in the archive" checkbox.

Reproducible: Always
Comment 1 Ragnar Thomsen 2015-09-24 07:49:33 UTC
I think I figured it out. m_isHeaderEncryptionEnabled in ReadOnlyArchiveInterface is never initialized and since it's a boolean it will be true or false at random.

It seems Part:: OpenFile() calls ArchiveModel::enableHeaderEncryption() which calls Archive::enableHeaderEncryption() which finally calls ReadOnlyArchiveInterface::setHeaderEncryptionEnabled() which sets m_isHeaderEncryptionEnabled. But this only gets done if the checkbox was checked.

CliInterface::addFiles() uses ReadOnlyArchiveInterface::isHeaderEncryptionEnabled() to decide whether to activate header encryption when adding files. So if the checkbox is checked, then header encryption is guaranteed, but if it is unchecked header encryption will be active/inactive at random.

Elvis, can you make a patch and provide a RR for Applications/15.08 branch?
Comment 2 Elvis Angelaccio 2015-09-24 13:27:17 UTC
Git commit b99086196be108dbc76c202bf78ef0e4b5ac8bee by Elvis Angelaccio.
Committed on 24/09/2015 at 13:26.
Pushed by elvisangelaccio into branch 'Applications/15.08'.

Assume that header encryption is disabled

This initialize ReadOnlyArchiveInterface::m_isHeaderEncryptionEnabled to false.

The boolean member ReadOnlyArchiveInterface::m_isHeaderEncryptionEnabled is
only set if the header encryption is explicitly enabled by the user. If not,
its default value is used to enable or disable the header encryption. Since
this variable was not initialized, the behavior was undefined when the checkbox
was not checked.
REVIEW: 125372
FIXED-IN: 15.08.2

M  +3    -1    kerfuffle/archiveinterface.cpp

http://commits.kde.org/ark/b99086196be108dbc76c202bf78ef0e4b5ac8bee