diff --git a/src/lib/libcrypto/arc4random/getentropy_win.c b/src/lib/libcrypto/arc4random/getentropy_win.c index 1263ba4c..da048ae1 100644 --- a/src/lib/libcrypto/arc4random/getentropy_win.c +++ b/src/lib/libcrypto/arc4random/getentropy_win.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_win.c,v 1.2 2014/07/13 13:03:09 deraadt Exp $ */ +/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */ /* * Copyright (c) 2014, Theo de Raadt @@ -44,9 +44,9 @@ getentropy(void *buf, size_t len) } if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT) != 0) + CRYPT_VERIFYCONTEXT) == 0) goto fail; - if (CryptGenRandom(provider, len, buf) != 0) { + if (CryptGenRandom(provider, len, buf) == 0) { CryptReleaseContext(provider, 0); goto fail; } diff --git a/src/lib/libcrypto/crypto/getentropy_win.c b/src/lib/libcrypto/crypto/getentropy_win.c index 1263ba4c..da048ae1 100644 --- a/src/lib/libcrypto/crypto/getentropy_win.c +++ b/src/lib/libcrypto/crypto/getentropy_win.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_win.c,v 1.2 2014/07/13 13:03:09 deraadt Exp $ */ +/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */ /* * Copyright (c) 2014, Theo de Raadt @@ -44,9 +44,9 @@ getentropy(void *buf, size_t len) } if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT) != 0) + CRYPT_VERIFYCONTEXT) == 0) goto fail; - if (CryptGenRandom(provider, len, buf) != 0) { + if (CryptGenRandom(provider, len, buf) == 0) { CryptReleaseContext(provider, 0); goto fail; }