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
0860d2bc
Kaydet (Commit)
0860d2bc
authored
Kas 26, 2012
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String => OUString conversion of svl's PasswordHelper
Change-Id: I7e107c37c43a8c9d868b579a2c389de558594a77
üst
ad6f9f2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
18 deletions
+15
-18
PasswordHelper.hxx
svl/inc/svl/PasswordHelper.hxx
+4
-6
svl.cxx
svl/qa/unit/svl.cxx
+1
-1
PasswordHelper.cxx
svl/source/misc/PasswordHelper.cxx
+10
-11
No files found.
svl/inc/svl/PasswordHelper.hxx
Dosyayı görüntüle @
0860d2bc
...
...
@@ -24,23 +24,21 @@
#include "sal/types.h"
#include "com/sun/star/uno/Sequence.hxx"
class
String
;
class
SvPasswordHelper
{
static
void
GetHashPasswordLittleEndian
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
);
static
void
GetHashPasswordBigEndian
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
);
static
void
GetHashPasswordLittleEndian
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
);
static
void
GetHashPasswordBigEndian
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
);
public
:
SVL_DLLPUBLIC
static
void
GetHashPassword
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
sal_Char
*
pPass
,
sal_uInt32
nLen
);
SVL_DLLPUBLIC
static
void
GetHashPassword
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
);
SVL_DLLPUBLIC
static
void
GetHashPassword
(
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
);
/**
Use this method to compare a given string with another given Hash value.
This is necessary, because in older versions exists different hashs of the same string. They were endian dependent.
We need this to handle old files. This method will compare against big and little endian. See #101326#
*/
SVL_DLLPUBLIC
static
bool
CompareHashPassword
(
const
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rOldPassHash
,
const
String
&
sNewPass
);
SVL_DLLPUBLIC
static
bool
CompareHashPassword
(
const
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rOldPassHash
,
const
OU
String
&
sNewPass
);
};
#endif
...
...
svl/qa/unit/svl.cxx
Dosyayı görüntüle @
0860d2bc
...
...
@@ -262,7 +262,7 @@ void Test::testNumberFormat()
}
}
xub_StrLen
nPos
;
sal_Int32
nPos
;
short
nType
=
NUMBERFORMAT_DEFINED
;
sal_uInt32
nKey
;
OUString
aCode
;
...
...
svl/source/misc/PasswordHelper.cxx
Dosyayı görüntüle @
0860d2bc
...
...
@@ -20,7 +20,6 @@
#include <svl/PasswordHelper.hxx>
#include <rtl/digest.h>
#include <tools/string.hxx>
using
namespace
com
::
sun
::
star
;
...
...
@@ -35,14 +34,14 @@ void SvPasswordHelper::GetHashPassword(uno::Sequence<sal_Int8>& rPassHash, const
}
}
void
SvPasswordHelper
::
GetHashPasswordLittleEndian
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
)
void
SvPasswordHelper
::
GetHashPasswordLittleEndian
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
)
{
xub_StrLen
nSize
(
sPass
.
Len
());
sal_Int32
nSize
(
sPass
.
getLength
());
sal_Char
*
pCharBuffer
=
new
sal_Char
[
nSize
*
sizeof
(
sal_Unicode
)];
for
(
xub_StrLen
i
=
0
;
i
<
nSize
;
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
nSize
;
++
i
)
{
sal_Unicode
ch
(
sPass
.
GetChar
(
i
)
);
sal_Unicode
ch
(
sPass
[
i
]
);
pCharBuffer
[
2
*
i
]
=
static_cast
<
sal_Char
>
(
ch
&
0xFF
);
pCharBuffer
[
2
*
i
+
1
]
=
static_cast
<
sal_Char
>
(
ch
>>
8
);
}
...
...
@@ -52,14 +51,14 @@ void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPas
delete
[]
pCharBuffer
;
}
void
SvPasswordHelper
::
GetHashPasswordBigEndian
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
)
void
SvPasswordHelper
::
GetHashPasswordBigEndian
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
)
{
xub_StrLen
nSize
(
sPass
.
Len
());
sal_Int32
nSize
(
sPass
.
getLength
());
sal_Char
*
pCharBuffer
=
new
sal_Char
[
nSize
*
sizeof
(
sal_Unicode
)];
for
(
xub_StrLen
i
=
0
;
i
<
nSize
;
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
nSize
;
++
i
)
{
sal_Unicode
ch
(
sPass
.
GetChar
(
i
)
);
sal_Unicode
ch
(
sPass
[
i
]
);
pCharBuffer
[
2
*
i
]
=
static_cast
<
sal_Char
>
(
ch
>>
8
);
pCharBuffer
[
2
*
i
+
1
]
=
static_cast
<
sal_Char
>
(
ch
&
0xFF
);
}
...
...
@@ -69,12 +68,12 @@ void SvPasswordHelper::GetHashPasswordBigEndian(uno::Sequence<sal_Int8>& rPassHa
delete
[]
pCharBuffer
;
}
void
SvPasswordHelper
::
GetHashPassword
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
String
&
sPass
)
void
SvPasswordHelper
::
GetHashPassword
(
uno
::
Sequence
<
sal_Int8
>&
rPassHash
,
const
OU
String
&
sPass
)
{
GetHashPasswordLittleEndian
(
rPassHash
,
sPass
);
}
bool
SvPasswordHelper
::
CompareHashPassword
(
const
uno
::
Sequence
<
sal_Int8
>&
rOldPassHash
,
const
String
&
sNewPass
)
bool
SvPasswordHelper
::
CompareHashPassword
(
const
uno
::
Sequence
<
sal_Int8
>&
rOldPassHash
,
const
OU
String
&
sNewPass
)
{
bool
bResult
=
false
;
...
...
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