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
66ebce7b
Kaydet (Commit)
66ebce7b
authored
Mar 23, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#75955 use SHA1 from openssl/nss instead of rtl_digest_sha1
Change-Id: I92186b2ed8426d59e31080cfb629beb02cd01c41
üst
e5ee33d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
CryptTools.cxx
oox/source/crypto/CryptTools.cxx
+38
-6
No files found.
oox/source/crypto/CryptTools.cxx
Dosyayı görüntüle @
66ebce7b
...
@@ -188,15 +188,47 @@ sal_uInt32 Encrypt::update(vector<sal_uInt8>& output, vector<sal_uInt8>& input,
...
@@ -188,15 +188,47 @@ sal_uInt32 Encrypt::update(vector<sal_uInt8>& output, vector<sal_uInt8>& input,
bool
sha1
(
vector
<
sal_uInt8
>&
output
,
vector
<
sal_uInt8
>&
input
)
bool
sha1
(
vector
<
sal_uInt8
>&
output
,
vector
<
sal_uInt8
>&
input
)
{
{
bool
aResult
=
false
;
#if USE_TLS_OPENSSL
output
.
clear
();
output
.
clear
();
output
.
resize
(
RTL_DIGEST_LENGTH_SHA1
,
0
);
output
.
resize
(
SHA_DIGEST_LENGTH
,
0
);
SHA_CTX
context
;
SHA1_Init
(
&
context
);
SHA1_Update
(
&
context
,
&
input
[
0
],
input
.
size
());
SHA1_Final
(
&
output
[
0
],
&
context
);
aResult
=
true
;
#endif
rtlDigest
aDigest
=
rtl_digest_create
(
rtl_Digest_AlgorithmSHA1
);
#if USE_TLS_NSS
rtl_digest_update
(
aDigest
,
&
input
[
0
],
input
.
size
()
);
output
.
clear
();
rtl_digest_get
(
aDigest
,
&
output
[
0
],
RTL_DIGEST_LENGTH_SHA1
);
output
.
resize
(
SHA1_LENGTH
,
0
);
rtl_digest_destroy
(
aDigest
);
return
true
;
// Initialize NSS, database functions are not needed
NSS_NoDB_Init
(
NULL
);
SECStatus
status
;
PK11Context
*
mContext
=
PK11_CreateDigestContext
(
SEC_OID_SHA1
);
status
=
PK11_DigestBegin
(
mContext
);
if
(
status
!=
SECSuccess
)
return
false
;
status
=
PK11_DigestOp
(
mContext
,
&
input
[
0
],
input
.
size
());
if
(
status
!=
SECSuccess
)
return
false
;
unsigned
int
outputLength
=
0
;
status
=
PK11_DigestFinal
(
mContext
,
&
output
[
0
],
&
outputLength
,
SHA1_LENGTH
);
if
(
status
!=
SECSuccess
||
outputLength
!=
SHA1_LENGTH
)
return
false
;
PK11_DestroyContext
(
mContext
,
PR_TRUE
);
aResult
=
true
;
#endif
return
aResult
;
}
}
bool
sha512
(
vector
<
sal_uInt8
>&
output
,
vector
<
sal_uInt8
>&
input
)
bool
sha512
(
vector
<
sal_uInt8
>&
output
,
vector
<
sal_uInt8
>&
input
)
...
...
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