diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-04-18 13:37:53 +0300 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-04-18 13:37:53 +0300 |
commit | 0046cfb7a990280c44763230c9c353da5560d515 (patch) | |
tree | 4bd041c8a615e4c38cf44e19d751a0638f9eae0b | |
parent | b79a633ee18dfc2a9eeb7c3cf7b1c0bfd7efba2d (diff) |
xmlsecurity: keep error code (if any) to support older WinSDK < 10
Change-Id: I42a102a3532f3de98fecba8a7d96e93caac4b95b
-rw-r--r-- | svl/source/crypto/cryptosign.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index fb5fd7038033..479aa07af07d 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -1427,7 +1427,10 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) &bFreeNeeded)) { SAL_WARN("svl.crypto", "CryptAcquireCertificatePrivateKey failed: " << WindowsErrorString(GetLastError())); + // Keep last error value for later checks. WinSDK < 10 during CertFreeCertificateContext() can modify it + DWORD dwErr = GetLastError(); CertFreeCertificateContext(pCertContext); + SetLastError(dwErr); return false; } assert(!bFreeNeeded); |