From 1f6b98f21495f0ecc5ded493cb3273da03852191 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 May 2021 08:59:56 +0200 Subject: replace SVL_CRYPTO_MSCRYPTO with _WIN32 just to reduce the number of different #defines at work in this file. Change-Id: I586b09a3c3c4c8eed4971a0e89d8def9d848b9fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115166 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svl/Library_svl.mk | 3 --- svl/source/crypto/cryptosign.cxx | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'svl') diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 291e2557638c..19b9d9f8b940 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -97,9 +97,6 @@ $(eval $(call gb_Library_use_system_win32_libs,svl,\ )) ifeq ($(OS),WNT) -$(eval $(call gb_Library_add_defs,svl,\ - -DSVL_CRYPTO_MSCRYPTO \ -)) $(eval $(call gb_Library_use_system_win32_libs,svl,\ crypt32 \ )) diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 8aa47ee36cba..f2dffc4d76b7 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -929,7 +929,7 @@ std::vector DecodeHexString(const OString& rHex) } -#if defined(SVL_CRYPTO_NSS) || defined(SVL_CRYPTO_MSCRYPTO) +#if defined(SVL_CRYPTO_NSS) || defined(_WIN32) bool Signing::Sign(OStringBuffer& rCMSHexBuffer) { @@ -1633,7 +1633,7 @@ bool Signing::Sign(OStringBuffer&) { return false; } -#endif //!SVL_CRYPTO_NSS && !SVL_CRYPTO_MSCRYPTO +#endif //!SVL_CRYPTO_NSS && !_WIN32 namespace @@ -1789,7 +1789,7 @@ bad_data: } return rv; } -#elif defined SVL_CRYPTO_MSCRYPTO +#elif defined _WIN32 /// Verifies a non-detached signature using CryptoAPI. bool VerifyNonDetachedSignature(const std::vector& aData, const std::vector& rExpectedHash) { @@ -2105,7 +2105,7 @@ bool Signing::Verify(const std::vector& aData, return true; -#elif defined SVL_CRYPTO_MSCRYPTO +#elif defined _WIN32 // Open a message for decoding. HCRYPTMSG hMsg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, CMSG_DETACHED_FLAG, @@ -2336,7 +2336,7 @@ bool Signing::Verify(SvStream& rStream, const std::vector& aSignature, SignatureInformation& rInformation) { -#if defined(SVL_CRYPTO_NSS) || defined(SVL_CRYPTO_MSCRYPTO) +#if defined(SVL_CRYPTO_NSS) || defined(_WIN32) std::vector buffer; -- cgit