diff options
author | René Korthaus <[email protected]> | 2015-12-23 11:52:19 +0100 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-01-08 19:09:51 -0500 |
commit | d22bc10cd4f67924acd82bcd46a31e3de3b20ce3 (patch) | |
tree | 58459585e6675cd799b6ef5900be026825cd6f9d /src/lib/entropy/cryptoapi_rng | |
parent | 2fbfdd7e5afb5e888fd8c0b56c6df09e2bdeaca7 (diff) |
Mass-prefix member vars with m_
Diffstat (limited to 'src/lib/entropy/cryptoapi_rng')
-rw-r--r-- | src/lib/entropy/cryptoapi_rng/es_capi.cpp | 34 | ||||
-rw-r--r-- | src/lib/entropy/cryptoapi_rng/es_capi.h | 2 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.cpp b/src/lib/entropy/cryptoapi_rng/es_capi.cpp index 88c8488ad..8d682698a 100644 --- a/src/lib/entropy/cryptoapi_rng/es_capi.cpp +++ b/src/lib/entropy/cryptoapi_rng/es_capi.cpp @@ -21,33 +21,33 @@ class CSP_Handle public: CSP_Handle(u64bit capi_provider) { - valid = false; + m_valid = false; DWORD prov_type = (DWORD)capi_provider; - if(CryptAcquireContext(&handle, 0, 0, + if(CryptAcquireContext(&m_handle, 0, 0, prov_type, CRYPT_VERIFYCONTEXT)) - valid = true; + m_valid = true; } ~CSP_Handle() { if(is_valid()) - CryptReleaseContext(handle, 0); + CryptReleaseContext(m_handle, 0); } size_t gen_random(byte out[], size_t n) const { - if(is_valid() && CryptGenRandom(handle, static_cast<DWORD>(n), out)) + if(is_valid() && CryptGenRandom(m_handle, static_cast<DWORD>(n), out)) return n; return 0; } - bool is_valid() const { return valid; } + bool is_valid() const { return m_valid; } - HCRYPTPROV get_handle() const { return handle; } + HCRYPTPROV get_handle() const { return m_handle; } private: - HCRYPTPROV handle; - bool valid; + HCRYPTPROV m_handle; + bool m_valid; }; } @@ -59,9 +59,9 @@ void Win32_CAPI_EntropySource::poll(Entropy_Accumulator& accum) { secure_vector<byte>& buf = accum.get_io_buf(BOTAN_SYSTEM_RNG_POLL_REQUEST); - for(size_t i = 0; i != prov_types.size(); ++i) + for(size_t i = 0; i != m_prov_types.size(); ++i) { - CSP_Handle csp(prov_types[i]); + CSP_Handle csp(m_prov_types[i]); if(size_t got = csp.gen_random(buf.data(), buf.size())) { @@ -80,14 +80,14 @@ Win32_CAPI_EntropySource::Win32_CAPI_EntropySource(const std::string& provs) for(size_t i = 0; i != capi_provs.size(); ++i) { - if(capi_provs[i] == "RSA_FULL") prov_types.push_back(PROV_RSA_FULL); - if(capi_provs[i] == "INTEL_SEC") prov_types.push_back(PROV_INTEL_SEC); - if(capi_provs[i] == "FORTEZZA") prov_types.push_back(PROV_FORTEZZA); - if(capi_provs[i] == "RNG") prov_types.push_back(PROV_RNG); + if(capi_provs[i] == "RSA_FULL") m_prov_types.push_back(PROV_RSA_FULL); + if(capi_provs[i] == "INTEL_SEC") m_prov_types.push_back(PROV_INTEL_SEC); + if(capi_provs[i] == "FORTEZZA") m_prov_types.push_back(PROV_FORTEZZA); + if(capi_provs[i] == "RNG") m_prov_types.push_back(PROV_RNG); } - if(prov_types.size() == 0) - prov_types.push_back(PROV_RSA_FULL); + if(m_prov_types.size() == 0) + m_prov_types.push_back(PROV_RSA_FULL); } } diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.h b/src/lib/entropy/cryptoapi_rng/es_capi.h index eb63183e9..9410e05b8 100644 --- a/src/lib/entropy/cryptoapi_rng/es_capi.h +++ b/src/lib/entropy/cryptoapi_rng/es_capi.h @@ -29,7 +29,7 @@ class Win32_CAPI_EntropySource : public Entropy_Source */ Win32_CAPI_EntropySource(const std::string& provs = ""); private: - std::vector<u64bit> prov_types; + std::vector<u64bit> m_prov_types; }; } |