Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6d673473
Kaydet (Commit)
6d673473
authored
Şub 23, 2018
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move OOXML password definitions to struct ScOoxPasswordHash, tdf#104250 prep
Change-Id: I595d5ae8db6f739900afdfdde1e36b0a0b1d2179
üst
1f159a4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
tabprotection.hxx
sc/inc/tabprotection.hxx
+15
-7
excrecds.cxx
sc/source/filter/excel/excrecds.cxx
+4
-4
worksheetsettings.cxx
sc/source/filter/oox/worksheetsettings.cxx
+4
-4
No files found.
sc/inc/tabprotection.hxx
Dosyayı görüntüle @
6d673473
...
...
@@ -39,6 +39,18 @@ enum ScPasswordHash
PASSHASH_UNSPECIFIED
};
/// OOXML password definitions: algorithmName, hashValue, saltValue, spinCount
struct
ScOoxPasswordHash
{
OUString
maAlgorithmName
;
/// "SHA-512", ...
OUString
maHashValue
;
/// base64 encoded hash value
OUString
maSaltValue
;
/// base64 encoded salt value
sal_uInt32
mnSpinCount
;
/// spin count, iteration runs
ScOoxPasswordHash
()
:
mnSpinCount
(
0
)
{}
bool
hasPassword
()
const
{
return
!
maHashValue
.
isEmpty
();
}
};
namespace
ScPassHashHelper
{
/** Check for the compatibility of all password hashes. If there is at
...
...
@@ -117,13 +129,9 @@ struct ScEnhancedProtection
OUString
maTitle
;
::
std
::
vector
<
sal_uInt8
>
maSecurityDescriptor
;
// imported as raw BIFF data
OUString
maSecurityDescriptorXML
;
// imported from OOXML
// OOXML password definitions
OUString
maAlgorithmName
;
OUString
maHashValue
;
OUString
maSaltValue
;
sal_uInt32
mnSpinCount
;
ScOoxPasswordHash
maPasswordHash
;
ScEnhancedProtection
()
:
mnAreserved
(
0
),
mnPasswordVerifier
(
0
)
,
mnSpinCount
(
0
)
{}
ScEnhancedProtection
()
:
mnAreserved
(
0
),
mnPasswordVerifier
(
0
)
{}
bool
hasSecurityDescriptor
()
const
{
...
...
@@ -132,7 +140,7 @@ struct ScEnhancedProtection
bool
hasPassword
()
const
{
return
mnPasswordVerifier
!=
0
||
!
maHashValue
.
isEmpty
();
return
mnPasswordVerifier
!=
0
||
maPasswordHash
.
hasPassword
();
}
};
...
...
sc/source/filter/excel/excrecds.cxx
Dosyayı görüntüle @
6d673473
...
...
@@ -516,10 +516,10 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm )
* 'algorithmName', 'hashValue', 'saltValue' and
* 'spinCount' are absent; so do we if it was present. */
XML_password
,
(
*
it
).
mnPasswordVerifier
?
OString
::
number
(
(
*
it
).
mnPasswordVerifier
,
16
).
getStr
()
:
nullptr
,
XML_algorithmName
,
(
*
it
).
ma
AlgorithmName
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
)
.
maAlgorithmName
).
getStr
(),
XML_hashValue
,
(
*
it
).
ma
HashValue
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
)
.
maHashValue
).
getStr
(),
XML_saltValue
,
(
*
it
).
ma
SaltValue
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
)
.
maSaltValue
).
getStr
(),
XML_spinCount
,
(
*
it
).
m
nSpinCount
?
OString
::
number
(
(
*
it
)
.
mnSpinCount
).
getStr
()
:
nullptr
,
XML_algorithmName
,
(
*
it
).
ma
PasswordHash
.
maAlgorithmName
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
).
maPasswordHash
.
maAlgorithmName
).
getStr
(),
XML_hashValue
,
(
*
it
).
ma
PasswordHash
.
maHashValue
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
).
maPasswordHash
.
maHashValue
).
getStr
(),
XML_saltValue
,
(
*
it
).
ma
PasswordHash
.
maSaltValue
.
isEmpty
()
?
nullptr
:
XclXmlUtils
::
ToOString
(
(
*
it
).
maPasswordHash
.
maSaltValue
).
getStr
(),
XML_spinCount
,
(
*
it
).
m
aPasswordHash
.
mnSpinCount
?
OString
::
number
(
(
*
it
).
maPasswordHash
.
mnSpinCount
).
getStr
()
:
nullptr
,
XML_sqref
,
(
*
it
).
maRangeList
.
is
()
?
XclXmlUtils
::
ToOString
(
*
(
*
it
).
maRangeList
).
getStr
()
:
nullptr
,
FSEND
);
}
...
...
sc/source/filter/oox/worksheetsettings.cxx
Dosyayı görüntüle @
6d673473
...
...
@@ -144,10 +144,10 @@ void WorksheetSettings::importProtectedRange( const AttributeList& rAttribs )
* 'saltValue' and 'spinCount' that are written if the protection was newly
* created. */
aProt
.
mnPasswordVerifier
=
rAttribs
.
getIntegerHex
(
XML_password
,
0
);
aProt
.
maAlgorithmName
=
rAttribs
.
getString
(
XML_algorithmName
,
OUString
());
aProt
.
maHashValue
=
rAttribs
.
getString
(
XML_hashValue
,
OUString
());
aProt
.
maSaltValue
=
rAttribs
.
getString
(
XML_saltValue
,
OUString
());
aProt
.
mnSpinCount
=
rAttribs
.
getUnsigned
(
XML_spinCount
,
0
);
aProt
.
ma
PasswordHash
.
ma
AlgorithmName
=
rAttribs
.
getString
(
XML_algorithmName
,
OUString
());
aProt
.
ma
PasswordHash
.
ma
HashValue
=
rAttribs
.
getString
(
XML_hashValue
,
OUString
());
aProt
.
ma
PasswordHash
.
ma
SaltValue
=
rAttribs
.
getString
(
XML_saltValue
,
OUString
());
aProt
.
m
aPasswordHash
.
m
nSpinCount
=
rAttribs
.
getUnsigned
(
XML_spinCount
,
0
);
OUString
aRefs
(
rAttribs
.
getString
(
XML_sqref
,
OUString
()));
if
(
!
aRefs
.
isEmpty
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment