diff options
author | Nikos Mavrogiannopoulos <nmav@turtle.(none)> | 2008-04-26 14:16:23 +0300 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@turtle.(none)> | 2008-04-26 14:16:23 +0300 |
commit | df724e494d0fd566265ebec70ce55a17b24acb56 (patch) | |
tree | d95e234489814b512d8d7bb6883a1834526f144a /lib/random.c | |
parent | b5a10db461057c947fa50414c7dc58bb6c12a0f0 (diff) | |
download | gnutls-df724e494d0fd566265ebec70ce55a17b24acb56.tar.gz |
faster seek into the list.
Diffstat (limited to 'lib/random.c')
-rw-r--r-- | lib/random.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/random.c b/lib/random.c index 25353cabac..82340c60b7 100644 --- a/lib/random.c +++ b/lib/random.c @@ -40,6 +40,7 @@ _gnutls_rnd_init () /* check if a digest has been registered */ cc = _gnutls_get_crypto_rnd(); + if (cc != NULL) { if (cc->init(& rnd_ctx) < 0) { gnutls_assert(); @@ -69,6 +70,7 @@ _gnutls_rnd (int level, void *data, int len) int ret = GC_OK; if (len > 0) { + if (cc != NULL) { return cc->rnd( rnd_ctx, level, data, len); } @@ -77,7 +79,6 @@ int ret = GC_OK; ret = gc_nonce (data, len); else ret = gc_pseudo_random( data, len); - } if (ret == GC_OK) return 0; |