From 5566798e8e5cd0520ba6110bb7d256c0c851d84f Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 31 Aug 2017 14:33:26 -0400 Subject: Fix missing virtual destructor on CSP_Handle Caught by GCC cross compiling. Also fix a couple 0-as-null warnings. --- src/lib/entropy/cryptoapi_rng/es_capi.cpp | 4 ++-- src/lib/entropy/cryptoapi_rng/es_capi.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/entropy') diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.cpp b/src/lib/entropy/cryptoapi_rng/es_capi.cpp index 3d744245e..58503c66d 100644 --- a/src/lib/entropy/cryptoapi_rng/es_capi.cpp +++ b/src/lib/entropy/cryptoapi_rng/es_capi.cpp @@ -22,8 +22,8 @@ class CSP_Handle_Impl : public Win32_CAPI_EntropySource::CSP_Handle explicit CSP_Handle_Impl(uint64_t capi_provider) { m_valid = ::CryptAcquireContext(&m_handle, - 0, - 0, + nullptr, + nullptr, static_cast(capi_provider), CRYPT_VERIFYCONTEXT); } diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.h b/src/lib/entropy/cryptoapi_rng/es_capi.h index 79a42828d..8439e62fa 100644 --- a/src/lib/entropy/cryptoapi_rng/es_capi.h +++ b/src/lib/entropy/cryptoapi_rng/es_capi.h @@ -32,6 +32,7 @@ class Win32_CAPI_EntropySource final : public Entropy_Source class CSP_Handle { public: + virtual ~CSP_Handle() {} virtual size_t gen_random(uint8_t out[], size_t n) const = 0; }; private: -- cgit v1.2.3