]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fix compat/getentropy_win.c check if CryptGenRandom works and no
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 20 Nov 2014 12:44:00 +0000 (12:44 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 20 Nov 2014 12:44:00 +0000 (12:44 +0000)
  immediate exit on windows.

git-svn-id: file:///svn/unbound/trunk@3276 be551aaa-1e26-0410-a405-d3ace91eadb9

compat/getentropy_win.c
doc/Changelog

index 9dc55891e393b2791ff3fe4f2c18c66ceec954dc..71fb955e7f9053ac56d0ffda4d5372e8691ec37b 100644 (file)
@@ -41,9 +41,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;
        }
index b1fca5fd5c716b9983983c7dcae90b48cd00be12..4fdb898131a5340fa67f7a7d03446e0a4b710a7d 100644 (file)
@@ -1,3 +1,7 @@
+20 November 2014: Wouter
+       - fix compat/getentropy_win.c check if CryptGenRandom works and no
+         immediate exit on windows.
+
 19 November 2014: Wouter
        - Fix cdflag dns64 processing.