aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-20 04:14:47 +0000
committerlloyd <[email protected]>2015-03-20 04:14:47 +0000
commit181e75b66d5fbffdce04d37014c260b4fab5dec8 (patch)
tree2ea9410a39186e20b5d03b5915550188b653f16f /src/lib
parent6b132d225e77a7d5e4ec4ed385c60e3e8505d308 (diff)
Windows fix
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/entropy/cryptoapi_rng/es_capi.cpp8
-rw-r--r--src/lib/entropy/cryptoapi_rng/es_capi.h1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.cpp b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
index a18fca7f2..2c86152ad 100644
--- a/src/lib/entropy/cryptoapi_rng/es_capi.cpp
+++ b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
@@ -57,17 +57,15 @@ class CSP_Handle
*/
void Win32_CAPI_EntropySource::poll(Entropy_Accumulator& accum)
{
- secure_vector<byte>& io_buffer = accum.get_io_buffer(32);
+ m_buf.resize(32);
for(size_t i = 0; i != prov_types.size(); ++i)
{
CSP_Handle csp(prov_types[i]);
- size_t got = csp.gen_random(&io_buffer[0], io_buffer.size());
-
- if(got)
+ if(size_t got = csp.gen_random(&m_buf[0], m_buf.size()))
{
- accum.add(&io_buffer[0], io_buffer.size(), 6);
+ accum.add(&m_buf[0], got, 6);
break;
}
}
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.h b/src/lib/entropy/cryptoapi_rng/es_capi.h
index 359618535..34ab2e22d 100644
--- a/src/lib/entropy/cryptoapi_rng/es_capi.h
+++ b/src/lib/entropy/cryptoapi_rng/es_capi.h
@@ -30,6 +30,7 @@ class Win32_CAPI_EntropySource : public EntropySource
Win32_CAPI_EntropySource(const std::string& provs = "");
private:
std::vector<u64bit> prov_types;
+ secure_vector<byte> m_buf;
};
}