Kaydet (Commit) 62767cf6 authored tarafından Eike Rathke's avatar Eike Rathke

Read algorithmName, hashValue, saltValue, spinCount, tdf#104250 prep

Change-Id: Idc68ad62e8420646d5aecd0d4126084390a1ed55
üst cffecd3c
...@@ -43,7 +43,11 @@ struct SheetSettingsModel ...@@ -43,7 +43,11 @@ struct SheetSettingsModel
/** Sheet protection settings. */ /** Sheet protection settings. */
struct SheetProtectionModel 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 mbSheet; /// True = sheet protection enabled, locked cells are protected.
bool mbObjects; /// True = objects locked. bool mbObjects; /// True = objects locked.
bool mbScenarios; /// True = scenarios locked. bool mbScenarios; /// True = scenarios locked.
......
...@@ -55,6 +55,7 @@ SheetSettingsModel::SheetSettingsModel() : ...@@ -55,6 +55,7 @@ SheetSettingsModel::SheetSettingsModel() :
} }
SheetProtectionModel::SheetProtectionModel() : SheetProtectionModel::SheetProtectionModel() :
mnSpinCount( 0 ),
mnPasswordHash( 0 ), mnPasswordHash( 0 ),
mbSheet( false ), mbSheet( false ),
mbObjects( false ), mbObjects( false ),
...@@ -106,6 +107,10 @@ void WorksheetSettings::importOutlinePr( const AttributeList& rAttribs ) ...@@ -106,6 +107,10 @@ void WorksheetSettings::importOutlinePr( const AttributeList& rAttribs )
void WorksheetSettings::importSheetProtection( 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.mnPasswordHash = oox::core::CodecHelper::getPasswordHash( rAttribs, XML_password );
maSheetProt.mbSheet = rAttribs.getBool( XML_sheet, false ); maSheetProt.mbSheet = rAttribs.getBool( XML_sheet, false );
maSheetProt.mbObjects = rAttribs.getBool( XML_objects, false ); maSheetProt.mbObjects = rAttribs.getBool( XML_objects, false );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment