diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-08 23:10:52 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-09 09:13:51 +0200 |
commit | 954f59db6cddc79d1f629fafc53ad20b6c4a14de (patch) | |
tree | f0e299dc691c63c9ef8ebf22d4e65e01fcd9f8a2 /xmlsecurity | |
parent | ff09d941ecee1044570ca898be408dcd14ead4f7 (diff) |
svl windows: remove last traces of pre-CNG signing
Mostly only the certificate selector was left + the global runtime switch.
Change-Id: I11e8e0920806eb61848512df6dea48c594febfe4
Reviewed-on: https://gerrit.libreoffice.org/58751
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 9e2ccf928a08..b03a4945f42d 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -344,7 +344,6 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl if( m_bEnableDefault ) { HCERTSTORE hSystemKeyStore ; DWORD dwKeySpec; - HCRYPTPROV hCryptProv; NCRYPT_KEY_HANDLE hCryptKey; #ifdef SAL_LOG_INFO @@ -357,13 +356,8 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl while (pCertContext) { // for checking whether the certificate is a personal certificate or not. - DWORD dwFlags = CRYPT_ACQUIRE_COMPARE_KEY_FLAG; - HCRYPTPROV_OR_NCRYPT_KEY_HANDLE* phCryptProvOrNCryptKey = &hCryptProv; - if (svl::crypto::isMSCng()) - { - dwFlags |= CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG; - phCryptProvOrNCryptKey = &hCryptKey; - } + DWORD dwFlags = CRYPT_ACQUIRE_COMPARE_KEY_FLAG | CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG; + HCRYPTPROV_OR_NCRYPT_KEY_HANDLE* phCryptProvOrNCryptKey = &hCryptKey; if(!(CryptAcquireCertificatePrivateKey(pCertContext, dwFlags, nullptr, @@ -977,15 +971,9 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::getCertificateCharacters( const css:: { BOOL fCallerFreeProv ; DWORD dwKeySpec ; - HCRYPTPROV hProv ; NCRYPT_KEY_HANDLE hKey = 0; - DWORD dwFlags = 0; - HCRYPTPROV_OR_NCRYPT_KEY_HANDLE* phCryptProvOrNCryptKey = &hProv; - if (svl::crypto::isMSCng()) - { - dwFlags |= CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG; - phCryptProvOrNCryptKey = &hKey; - } + DWORD dwFlags = CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG; + HCRYPTPROV_OR_NCRYPT_KEY_HANDLE* phCryptProvOrNCryptKey = &hKey; if( CryptAcquireCertificatePrivateKey( pCertContext , dwFlags, nullptr , @@ -995,9 +983,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::getCertificateCharacters( const css:: ) { characters |= css::security::CertificateCharacters::HAS_PRIVATE_KEY ; - if( hProv != NULL && fCallerFreeProv ) - CryptReleaseContext( hProv, 0 ) ; - else if (hKey && fCallerFreeProv) + if (hKey && fCallerFreeProv) NCryptFreeObject(hKey); } else { characters &= ~ css::security::CertificateCharacters::HAS_PRIVATE_KEY ; @@ -1056,8 +1042,7 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() { m_hMySystemStore = nullptr; throw uno::RuntimeException() ; } - if (svl::crypto::isMSCng()) - m_hMySystemStore = nullptr; + m_hMySystemStore = nullptr; } //Add system root store into the keys manager. @@ -1068,8 +1053,7 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() { m_hRootSystemStore = nullptr; throw uno::RuntimeException() ; } - if (svl::crypto::isMSCng()) - m_hRootSystemStore = nullptr; + m_hRootSystemStore = nullptr; } //Add system trusted store into the keys manager. @@ -1080,8 +1064,7 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() { m_hTrustSystemStore = nullptr; throw uno::RuntimeException() ; } - if (svl::crypto::isMSCng()) - m_hTrustSystemStore = nullptr; + m_hTrustSystemStore = nullptr; } //Add system CA store into the keys manager. @@ -1092,8 +1075,7 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() { m_hCaSystemStore = nullptr; throw uno::RuntimeException() ; } - if (svl::crypto::isMSCng()) - m_hCaSystemStore = nullptr; + m_hCaSystemStore = nullptr; } } |