summaryrefslogtreecommitdiff
path: root/lib/random.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-01-22 12:54:49 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-01-22 12:54:49 +0100
commite81cf5d64777342cc621d303a8c3c5eebc475391 (patch)
treec5f221228219430477043899a1a2dda980955916 /lib/random.c
parentaf1fbb1aa68909a9e48220f102b8582354f8a3fd (diff)
downloadgnutls-e81cf5d64777342cc621d303a8c3c5eebc475391.tar.gz
register FIPS140 random generator prior to initialization
Diffstat (limited to 'lib/random.c')
-rw-r--r--lib/random.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/random.c b/lib/random.c
index 8d19a2081d..42d5c82646 100644
--- a/lib/random.c
+++ b/lib/random.c
@@ -32,13 +32,6 @@ void *gnutls_rnd_ctx;
int _gnutls_rnd_init(void)
{
- if (_gnutls_rnd_ops.init != NULL) {
- if (_gnutls_rnd_ops.init(&gnutls_rnd_ctx) < 0) {
- gnutls_assert();
- return GNUTLS_E_RANDOM_FAILED;
- }
- }
-
#ifdef ENABLE_FIPS140
/* The FIPS140 random generator is only enabled when we are compiled
* with FIPS support, _and_ the system requires FIPS140.
@@ -52,6 +45,13 @@ int _gnutls_rnd_init(void)
}
#endif
+ if (_gnutls_rnd_ops.init != NULL) {
+ if (_gnutls_rnd_ops.init(&gnutls_rnd_ctx) < 0) {
+ gnutls_assert();
+ return GNUTLS_E_RANDOM_FAILED;
+ }
+ }
+
return 0;
}