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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/nettle/rnd.c b/lib/nettle/rnd.c
index 8af0adde57..b503e10e1d 100644
--- a/lib/nettle/rnd.c
+++ b/lib/nettle/rnd.c
@@ -33,6 +33,7 @@
#include <gnutls_errors.h>
#include <gnutls_num.h>
#include <nettle/yarrow.h>
+#include "rnd.h"
#define SOURCES 2
@@ -440,7 +441,6 @@ wrap_nettle_rnd_init (void **ctx)
}
-
static int
wrap_nettle_rnd (void *_ctx, int level, void *data, size_t datasize)
{
@@ -467,6 +467,14 @@ wrap_nettle_rnd (void *_ctx, int level, void *data, size_t datasize)
return 0;
}
+/* internal function to provide to nettle functions that
+ * require a nettle_random_func().
+ */
+void _int_random_func(void *ctx, unsigned length, uint8_t *dst)
+{
+ wrap_nettle_rnd(ctx, 0, dst, length);
+}
+
int crypto_rnd_prio = INT_MAX;
gnutls_crypto_rnd_st _gnutls_rnd_ops = {