Bug 351608 - 7z format does not respect the unchecked Header-Encryption checkbox
Summary: 7z format does not respect the unchecked Header-Encryption checkbox
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 15.08.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2015-08-22 10:33 UTC by Elvis Angelaccio
Modified: 2015-09-24 13:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 15.08.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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