diff options
author | Eike Rathke <erack@redhat.com> | 2018-02-22 22:22:00 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-02-23 11:16:58 +0100 |
commit | 62767cf6062d4e90ba5de9b19927b1a96d0f7e62 (patch) | |
tree | daf00773cf4ddc62435facd709c6f4b33308b74d /sc | |
parent | cffecd3c8d2d6b34726b8820468fadef93dd553d (diff) |
Read algorithmName, hashValue, saltValue, spinCount, tdf#104250 prep
Change-Id: Idc68ad62e8420646d5aecd0d4126084390a1ed55
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/worksheetsettings.hxx | 6 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheetsettings.cxx | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/filter/inc/worksheetsettings.hxx b/sc/source/filter/inc/worksheetsettings.hxx index d2988d1150e9..46e19ee15f6c 100644 --- a/sc/source/filter/inc/worksheetsettings.hxx +++ b/sc/source/filter/inc/worksheetsettings.hxx @@ -43,7 +43,11 @@ struct SheetSettingsModel /** Sheet protection settings. */ struct SheetProtectionModel { - sal_uInt16 mnPasswordHash; /// Hash value from sheet 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 from sheet protection password. (unrelated to the above) bool mbSheet; /// True = sheet protection enabled, locked cells are protected. bool mbObjects; /// True = objects locked. bool mbScenarios; /// True = scenarios locked. diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx index f86abd370a12..06fc1db11da0 100644 --- a/sc/source/filter/oox/worksheetsettings.cxx +++ b/sc/source/filter/oox/worksheetsettings.cxx @@ -55,6 +55,7 @@ SheetSettingsModel::SheetSettingsModel() : } SheetProtectionModel::SheetProtectionModel() : + mnSpinCount( 0 ), mnPasswordHash( 0 ), mbSheet( false ), mbObjects( false ), @@ -106,6 +107,10 @@ void WorksheetSettings::importOutlinePr( const AttributeList& rAttribs ) void WorksheetSettings::importSheetProtection( const AttributeList& rAttribs ) { + maSheetProt.maAlgorithmName = rAttribs.getString( XML_algorithmName, OUString()); + maSheetProt.maHashValue = rAttribs.getString( XML_hashValue, OUString()); + maSheetProt.maSaltValue = rAttribs.getString( XML_saltValue, OUString()); + maSheetProt.mnSpinCount = rAttribs.getUnsigned( XML_spinCount, 0); maSheetProt.mnPasswordHash = oox::core::CodecHelper::getPasswordHash( rAttribs, XML_password ); maSheetProt.mbSheet = rAttribs.getBool( XML_sheet, false ); maSheetProt.mbObjects = rAttribs.getBool( XML_objects, false ); |