summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-04-13 20:10:16 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-04-13 20:10:16 +0200
commit300a55eb94d9ff7ab45916a2422e2495d4caccac (patch)
treeef4a79e6f38612da1f00b4232764701adb5ac68d
parent4b9169e8900bfacbc688f4d68911b10f3240cc8a (diff)
downloadgnutls-300a55eb94d9ff7ab45916a2422e2495d4caccac.tar.gz
Update random state on all cases.
-rw-r--r--lib/nettle/rnd.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/nettle/rnd.c b/lib/nettle/rnd.c
index bdc723fcc0..c00726ee9c 100644
--- a/lib/nettle/rnd.c
+++ b/lib/nettle/rnd.c
@@ -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);