diff options
Diffstat (limited to 'stun/rand.c')
-rw-r--r-- | stun/rand.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stun/rand.c b/stun/rand.c index 25dc402..cc0927f 100644 --- a/stun/rand.c +++ b/stun/rand.c @@ -68,6 +68,17 @@ void nice_RAND_nonce (uint8_t *dst, int len) } #else +#ifdef HAVE_OPENSSL + +#include <openssl/rand.h> + +void nice_RAND_nonce (uint8_t *dst, int len) +{ + RAND_bytes (dst, len); +} + +#else + #include <sys/types.h> #include <gnutls/gnutls.h> #include <gnutls/crypto.h> @@ -77,4 +88,6 @@ void nice_RAND_nonce (uint8_t *dst, int len) gnutls_rnd (GNUTLS_RND_NONCE, dst, len); } +#endif /* HAVE_OPENSSL */ + #endif /* _WIN32 */ |