From d1a0baf25fc8251778ba6465c333bb82cd3150ab Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 25 Oct 2015 03:43:24 +0100 Subject: [PATCH] tweetNaCL: fix winrandom problem: random byte generation on windows got stuck in an infinite loop solution: the failure test is incorrect. Change it --- tweetnacl/contrib/randombytes/winrandom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweetnacl/contrib/randombytes/winrandom.c b/tweetnacl/contrib/randombytes/winrandom.c index 187ef8fe..4d649f74 100644 --- a/tweetnacl/contrib/randombytes/winrandom.c +++ b/tweetnacl/contrib/randombytes/winrandom.c @@ -22,7 +22,7 @@ void randombytes(unsigned char *x,unsigned long long xlen) if (xlen < 1048576) i = (unsigned) xlen; else i = 1048576; ret = CryptGenRandom(hProvider, i, x); - if (ret != FALSE) { + if (ret == FALSE) { Sleep(1); continue; }