]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Check whether the RNG can perform many iterations without error.
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 4 Dec 2013 14:11:30 +0000 (15:11 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 4 Dec 2013 14:11:30 +0000 (15:11 +0100)
tests/rng-fork.c

index 5e7a8d38dee7dcafdd0c135f567ed81ef82b6f68..4cf3246ef39a1dc3679f570266acc7e6fbb5c919 100644 (file)
@@ -104,6 +104,14 @@ void doit(void)
                }
        }
 
+       for (i = 0; i <= 65539; i++) {
+               ret = gnutls_rnd(GNUTLS_RND_NONCE, buf1, sizeof(buf1));
+               if (ret < 0) {
+                       fail("Error iterating RNG more than %u times\n", i);
+                       exit(1);
+               }
+       }
+
        gnutls_global_deinit();
 }
 #else