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
33d9584b
Kaydet (Commit)
33d9584b
authored
Eyl 04, 2012
tarafından
Jian Fang Zhang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i120675#, the certificate store handles need to be closed after closing the document
Found by: zhangjf Patch by: zhangjf
üst
32754ae9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
19 deletions
+48
-19
securityenvironment_mscryptimpl.cxx
...source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+42
-19
securityenvironment_mscryptimpl.hxx
...source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
+6
-0
No files found.
xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
Dosyayı görüntüle @
33d9584b
...
...
@@ -122,7 +122,7 @@ void traceTrustStatus(DWORD err)
}
}
SecurityEnvironment_MSCryptImpl
::
SecurityEnvironment_MSCryptImpl
(
const
Reference
<
XMultiServiceFactory
>&
aFactory
)
:
m_hProv
(
NULL
)
,
m_pszContainer
(
NULL
)
,
m_hKeyStore
(
NULL
),
m_hCertStore
(
NULL
),
m_tSymKeyList
()
,
m_tPubKeyList
()
,
m_tPriKeyList
(),
m_xServiceManager
(
aFactory
),
m_bEnableDefault
(
sal_False
)
{
SecurityEnvironment_MSCryptImpl
::
SecurityEnvironment_MSCryptImpl
(
const
Reference
<
XMultiServiceFactory
>&
aFactory
)
:
m_hProv
(
NULL
)
,
m_pszContainer
(
NULL
)
,
m_hKeyStore
(
NULL
),
m_hCertStore
(
NULL
),
m_tSymKeyList
()
,
m_tPubKeyList
()
,
m_tPriKeyList
(),
m_xServiceManager
(
aFactory
),
m_bEnableDefault
(
sal_False
)
,
m_hMySystemStore
(
NULL
),
m_hRootSystemStore
(
NULL
),
m_hTrustSystemStore
(
NULL
),
m_hCaSystemStore
(
NULL
)
{
}
...
...
@@ -148,6 +148,27 @@ SecurityEnvironment_MSCryptImpl :: ~SecurityEnvironment_MSCryptImpl() {
m_hKeyStore
=
NULL
;
}
//i120675, close the store handles
if
(
m_hMySystemStore
!=
NULL
)
{
CertCloseStore
(
m_hMySystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hMySystemStore
=
NULL
;
}
if
(
m_hRootSystemStore
!=
NULL
)
{
CertCloseStore
(
m_hRootSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hRootSystemStore
=
NULL
;
}
if
(
m_hTrustSystemStore
!=
NULL
)
{
CertCloseStore
(
m_hTrustSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hTrustSystemStore
=
NULL
;
}
if
(
m_hCaSystemStore
!=
NULL
)
{
CertCloseStore
(
m_hCaSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hCaSystemStore
=
NULL
;
}
if
(
!
m_tSymKeyList
.
empty
()
)
{
std
::
list
<
HCRYPTKEY
>::
iterator
symKeyIt
;
...
...
@@ -1260,40 +1281,42 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl :: createKeysManager() throw(
* Adopt system default certificate store.
*/
if
(
defaultEnabled
()
)
{
HCERTSTORE
hSystemStore
;
//Add system key store into the keys manager.
hSystemStore
=
CertOpenSystemStore
(
0
,
"MY"
)
;
if
(
hSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore
(
pKeysMngr
,
hSystemStore
)
<
0
)
{
CertCloseStore
(
hSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hMySystemStore
=
CertOpenSystemStore
(
0
,
"MY"
)
;
if
(
m_hMySystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore
(
pKeysMngr
,
m_hMySystemStore
)
<
0
)
{
CertCloseStore
(
m_hMySystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hMySystemStore
=
NULL
;
throw
RuntimeException
()
;
}
}
//Add system root store into the keys manager.
hSystemStore
=
CertOpenSystemStore
(
0
,
"Root"
)
;
if
(
hSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore
(
pKeysMngr
,
hSystemStore
)
<
0
)
{
CertCloseStore
(
hSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hRootSystemStore
=
CertOpenSystemStore
(
0
,
"Root"
)
;
if
(
m_hRootSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore
(
pKeysMngr
,
m_hRootSystemStore
)
<
0
)
{
CertCloseStore
(
m_hRootSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hRootSystemStore
=
NULL
;
throw
RuntimeException
()
;
}
}
//Add system trusted store into the keys manager.
hSystemStore
=
CertOpenSystemStore
(
0
,
"Trust"
)
;
if
(
hSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore
(
pKeysMngr
,
hSystemStore
)
<
0
)
{
CertCloseStore
(
hSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hTrustSystemStore
=
CertOpenSystemStore
(
0
,
"Trust"
)
;
if
(
m_hTrustSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore
(
pKeysMngr
,
m_hTrustSystemStore
)
<
0
)
{
CertCloseStore
(
m_hTrustSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hTrustSystemStore
=
NULL
;
throw
RuntimeException
()
;
}
}
//Add system CA store into the keys manager.
hSystemStore
=
CertOpenSystemStore
(
0
,
"CA"
)
;
if
(
hSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore
(
pKeysMngr
,
hSystemStore
)
<
0
)
{
CertCloseStore
(
hSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hCaSystemStore
=
CertOpenSystemStore
(
0
,
"CA"
)
;
if
(
m_hCaSystemStore
!=
NULL
)
{
if
(
xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore
(
pKeysMngr
,
m_hCaSystemStore
)
<
0
)
{
CertCloseStore
(
m_hCaSystemStore
,
CERT_CLOSE_STORE_CHECK_FLAG
)
;
m_hCaSystemStore
=
NULL
;
throw
RuntimeException
()
;
}
}
...
...
xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
Dosyayı görüntüle @
33d9584b
...
...
@@ -76,6 +76,12 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4<
//Certiticate store
HCERTSTORE
m_hCertStore
;
// i120675, save the store handles
HCERTSTORE
m_hMySystemStore
;
HCERTSTORE
m_hRootSystemStore
;
HCERTSTORE
m_hTrustSystemStore
;
HCERTSTORE
m_hCaSystemStore
;
//Enable default system cryptography setting
sal_Bool
m_bEnableDefault
;
...
...
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