summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_win.c6
-rw-r--r--src/lib/libcrypto/crypto/getentropy_win.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_win.c b/src/lib/libcrypto/arc4random/getentropy_win.c
index 1263ba4ca2..da048ae157 100644
--- a/src/lib/libcrypto/arc4random/getentropy_win.c
+++ b/src/lib/libcrypto/arc4random/getentropy_win.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_win.c,v 1.2 2014/07/13 13:03:09 deraadt Exp $ */ 1/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
@@ -44,9 +44,9 @@ getentropy(void *buf, size_t len)
44 } 44 }
45 45
46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
47 CRYPT_VERIFYCONTEXT) != 0) 47 CRYPT_VERIFYCONTEXT) == 0)
48 goto fail; 48 goto fail;
49 if (CryptGenRandom(provider, len, buf) != 0) { 49 if (CryptGenRandom(provider, len, buf) == 0) {
50 CryptReleaseContext(provider, 0); 50 CryptReleaseContext(provider, 0);
51 goto fail; 51 goto fail;
52 } 52 }
diff --git a/src/lib/libcrypto/crypto/getentropy_win.c b/src/lib/libcrypto/crypto/getentropy_win.c
index 1263ba4ca2..da048ae157 100644
--- a/src/lib/libcrypto/crypto/getentropy_win.c
+++ b/src/lib/libcrypto/crypto/getentropy_win.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_win.c,v 1.2 2014/07/13 13:03:09 deraadt Exp $ */ 1/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
@@ -44,9 +44,9 @@ getentropy(void *buf, size_t len)
44 } 44 }
45 45
46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
47 CRYPT_VERIFYCONTEXT) != 0) 47 CRYPT_VERIFYCONTEXT) == 0)
48 goto fail; 48 goto fail;
49 if (CryptGenRandom(provider, len, buf) != 0) { 49 if (CryptGenRandom(provider, len, buf) == 0) {
50 CryptReleaseContext(provider, 0); 50 CryptReleaseContext(provider, 0);
51 goto fail; 51 goto fail;
52 } 52 }