summaryrefslogtreecommitdiff
path: root/crypto/rand
diff options
context:
space:
mode:
authorMat <mberchtold@gmail.com>2016-05-29 20:44:27 +0200
committerRich Salz <rsalz@openssl.org>2016-06-03 12:18:59 -0400
commite56f956ef1347b8eb9024471f4fa16691cf8e3ea (patch)
tree94e132e801b92e9f5fc23f0885cfc6cf880ca346 /crypto/rand
parent0814afcfa46039c8f27739dbe6a355b731f34608 (diff)
downloadopenssl-new-e56f956ef1347b8eb9024471f4fa16691cf8e3ea.tar.gz
Adds casts for 64-bit
Adds missing casts for 64-bit. Removed zero initialization of hProvider. hProvider is an "out" parameter of CryptAcquireContextW. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1142)
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/rand_win.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c
index 21cc9b6bcb..ae5bbddcd2 100644
--- a/crypto/rand/rand_win.c
+++ b/crypto/rand/rand_win.c
@@ -37,7 +37,7 @@ int RAND_poll(void)
{
MEMORYSTATUS mst;
# ifndef USE_BCRYPT
- HCRYPTPROV hProvider = 0;
+ HCRYPTPROV hProvider;
# endif
DWORD w;
BYTE buf[64];
@@ -50,7 +50,7 @@ int RAND_poll(void)
/* poll the CryptoAPI PRNG */
/* The CryptoAPI returns sizeof(buf) bytes of randomness */
if (CryptAcquireContextW(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
- if (CryptGenRandom(hProvider, sizeof(buf), buf) != 0) {
+ if (CryptGenRandom(hProvider, (DWORD)sizeof(buf), buf) != 0) {
RAND_add(buf, sizeof(buf), sizeof(buf));
}
CryptReleaseContext(hProvider, 0);
@@ -58,7 +58,7 @@ int RAND_poll(void)
/* poll the Pentium PRG with CryptoAPI */
if (CryptAcquireContextW(&hProvider, NULL, INTEL_DEF_PROV, PROV_INTEL_SEC, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
- if (CryptGenRandom(hProvider, sizeof(buf), buf) != 0) {
+ if (CryptGenRandom(hProvider, (DWORD)sizeof(buf), buf) != 0) {
RAND_add(buf, sizeof(buf), sizeof(buf));
}
CryptReleaseContext(hProvider, 0);