summaryrefslogtreecommitdiff
path: root/lib/nettle/rnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nettle/rnd.c')
-rw-r--r--lib/nettle/rnd.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/nettle/rnd.c b/lib/nettle/rnd.c
index 6e7c69aca7..3f611f1db2 100644
--- a/lib/nettle/rnd.c
+++ b/lib/nettle/rnd.c
@@ -447,20 +447,23 @@ wrap_nettle_rnd (void *_ctx, int level, void *data, size_t datasize)
RND_LOCK;
- ret = do_trivia_source (0);
- if (ret < 0)
+ if (level != GNUTLS_RND_NONCE)
{
- RND_UNLOCK;
- gnutls_assert ();
- return ret;
- }
+ ret = do_trivia_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;
+ ret = do_device_source (0);
+ if (ret < 0)
+ {
+ RND_UNLOCK;
+ gnutls_assert ();
+ return ret;
+ }
}
yarrow256_random (&yctx, datasize, data);