summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-23 10:17:01 +0100
committerEike Rathke <erack@redhat.com>2018-02-23 11:16:58 +0100
commit0fe1b2fb823470e2f5eae574f9c9f877eecc932d (patch)
tree9aaf5e5275b84a624b454d24ee4a3daf970dc6c1
parent62767cf6062d4e90ba5de9b19927b1a96d0f7e62 (diff)
Read algorithmName, hashValue, saltValue, spinCount, tdf#115933 prep
Change-Id: I799d4652099059fcd09088c02537ed5dec087259
-rw-r--r--sc/source/filter/inc/workbooksettings.hxx8
-rw-r--r--sc/source/filter/oox/workbooksettings.cxx5
2 files changed, 11 insertions, 2 deletions
diff --git a/sc/source/filter/inc/workbooksettings.hxx b/sc/source/filter/inc/workbooksettings.hxx
index 02c8fa204a7f..dda6cc366f15 100644
--- a/sc/source/filter/inc/workbooksettings.hxx
+++ b/sc/source/filter/inc/workbooksettings.hxx
@@ -30,8 +30,12 @@ namespace xls {
/** Settings for workbook write protection. */
struct FileSharingModel
{
- OUString maUserName; /// User who added the write protection password.
- sal_uInt16 mnPasswordHash; /// Hash value of the write protection password.
+ OUString maUserName; /// User who added the write protection password.
+ OUString maAlgorithmName; /// Algorithm name, "SHA-512", "SHA-1", ...
+ OUString maHashValue; /// Hash value computed by the algorithm, base-64 encoded
+ OUString maSaltValue; /// Salt value to be prepended to the password, base-64 encoded
+ sal_uInt32 mnSpinCount; /// Spin count, iterations to run algorithm
+ sal_uInt16 mnPasswordHash; /// Hash value of the write protection password. (unrelated to the above)
bool mbRecommendReadOnly; /// True = recommend read-only mode on opening.
explicit FileSharingModel();
diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx
index 44c017bbafbc..9dd4caff95f1 100644
--- a/sc/source/filter/oox/workbooksettings.cxx
+++ b/sc/source/filter/oox/workbooksettings.cxx
@@ -63,6 +63,7 @@ const sal_Int16 API_SHOWMODE_PLACEHOLDER = 2; /// Show placeholder
} // namespace
FileSharingModel::FileSharingModel() :
+ mnSpinCount( 0 ),
mnPasswordHash( 0 ),
mbRecommendReadOnly( false )
{
@@ -108,6 +109,10 @@ WorkbookSettings::WorkbookSettings( const WorkbookHelper& rHelper ) :
void WorkbookSettings::importFileSharing( const AttributeList& rAttribs )
{
maFileSharing.maUserName = rAttribs.getXString( XML_userName, OUString() );
+ maFileSharing.maAlgorithmName = rAttribs.getString( XML_algorithmName, OUString());
+ maFileSharing.maHashValue = rAttribs.getString( XML_hashValue, OUString());
+ maFileSharing.maSaltValue = rAttribs.getString( XML_saltValue, OUString());
+ maFileSharing.mnSpinCount = rAttribs.getUnsigned( XML_spinCount, 0);
maFileSharing.mnPasswordHash = oox::core::CodecHelper::getPasswordHash( rAttribs, XML_reservationPassword );
maFileSharing.mbRecommendReadOnly = rAttribs.getBool( XML_readOnlyRecommended, false );
}