diff options
author | Simon Josefsson <simon@josefsson.org> | 2005-08-30 09:03:44 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2005-08-30 09:03:44 +0000 |
commit | 199a152697c2d4fdaf3e68842f9d77d0350c0e9c (patch) | |
tree | f372bf4d78c83d79f9f116dafecb18deb9fba066 /lib/gnutls_handshake.c | |
parent | fd878a3aa2872ab0cfeb2993cf5a71e0dacd3c40 (diff) | |
download | gnutls-199a152697c2d4fdaf3e68842f9d77d0350c0e9c.tar.gz |
Call gc directly instead of _gnutls_get_random.
Diffstat (limited to 'lib/gnutls_handshake.c')
-rw-r--r-- | lib/gnutls_handshake.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index e1a9a357b4..4ce7e78d9a 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -50,6 +50,7 @@ #include <ext_srp.h> #include <gnutls_rsa_export.h> /* for gnutls_get_rsa_params() */ #include <auth_anon.h> /* for gnutls_anon_server_credentials_t */ +#include <gc.h> #ifdef HANDSHAKE_DEBUG #define ERR(x, y) _gnutls_handshake_log( "HSK[%x]: %s (%d)\n", session, x,y) @@ -239,10 +240,9 @@ int _gnutls_tls_create_random(opaque * dst) /* generate server random value */ _gnutls_write_uint32(tim, dst); - if (_gnutls_get_random - (&dst[4], TLS_RANDOM_SIZE - 4, GNUTLS_WEAK_RANDOM) < 0) { - gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; + if (gc_nonce (&dst[4], TLS_RANDOM_SIZE - 4) != GC_OK) { + gnutls_assert(); + return GNUTLS_E_RANDOM_FAILED; } return 0; @@ -2352,9 +2352,9 @@ int _gnutls_generate_session_id(opaque * session_id, uint8 * len) { *len = TLS_MAX_SESSION_ID_SIZE; - if (_gnutls_get_random(session_id, *len, GNUTLS_WEAK_RANDOM) < 0) { - gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; + if (gc_nonce (session_id, *len) != GC_OK) { + gnutls_assert(); + return GNUTLS_E_RANDOM_FAILED; } return 0; |