]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update random state on all cases.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 13 Apr 2012 18:10:16 +0000 (20:10 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 13 Apr 2012 18:10:16 +0000 (20:10 +0200)
lib/nettle/rnd.c

index bdc723fcc0c49fa367f1fec65b2a3ba38a5c613c..c00726ee9c481fd39e3eac9c1be4b726a8cf15ca 100644 (file)
@@ -447,23 +447,20 @@ wrap_nettle_rnd (void *_ctx, int level, void *data, size_t datasize)
 
   RND_LOCK;
 
-  if (level != GNUTLS_RND_NONCE)
+  ret = do_trivia_source (0);
+  if (ret < 0)
     {
-      ret = do_trivia_source (0);
-      if (ret < 0)
-        {
-          RND_UNLOCK;
-          gnutls_assert ();
-          return ret;
-        }
+      RND_UNLOCK;
+      gnutls_assert ();
+      return ret;
+    }
 
-      ret = do_device_source (0);
-      if (ret < 0)
-        {
-          RND_UNLOCK;
-          gnutls_assert ();
-          return ret;
-        }
+  ret = do_device_source (0);
+  if (ret < 0)
+    {
+      RND_UNLOCK;
+      gnutls_assert ();
+      return ret;
     }
 
   yarrow256_random (&yctx, datasize, data);