summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/source/crypto/cryptosign.cxx21
1 files changed, 3 insertions, 18 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index a9258a5c607c..0e86664c28c1 100644
--- a/svl/source/crypto/cryptosign.cxx
+++ b/svl/source/crypto/cryptosign.cxx
@@ -1402,15 +1402,9 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer)
aPara.cMsgCert = 1;
aPara.rgpMsgCert = &pCertContext;
- HCRYPTPROV hCryptProv = 0;
NCRYPT_KEY_HANDLE hCryptKey = 0;
- DWORD dwFlags = CRYPT_ACQUIRE_CACHE_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_CACHE_FLAG | CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG;
+ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE* phCryptProvOrNCryptKey = &hCryptKey;
DWORD nKeySpec;
BOOL bFreeNeeded;
@@ -1432,10 +1426,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer)
memset(&aSignerInfo, 0, sizeof(aSignerInfo));
aSignerInfo.cbSize = sizeof(aSignerInfo);
aSignerInfo.pCertInfo = pCertContext->pCertInfo;
- if (!svl::crypto::isMSCng())
- aSignerInfo.hCryptProv = hCryptProv;
- else
- aSignerInfo.hNCryptKey = hCryptKey;
+ aSignerInfo.hNCryptKey = hCryptKey;
aSignerInfo.dwKeySpec = nKeySpec;
aSignerInfo.HashAlgorithm.pszObjId = const_cast<LPSTR>(szOID_NIST_sha256);
aSignerInfo.HashAlgorithm.Parameters.cbData = 0;
@@ -2421,12 +2412,6 @@ bool Signing::Verify(SvStream& rStream,
#endif
}
-bool isMSCng()
-{
- static bool bNoMSCng = getenv("SVL_CRYPTO_NOCNG");
- return !bNoMSCng;
-}
-
}
}