From 232fd4fa74c483cc4e882ddcb166d514c021b4b9 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 18 Apr 2014 12:17:29 +0200 Subject: Avoid dual generation of key. --- lib/auth/psk.c | 16 ++++++---------- lib/auth/psk.h | 2 -- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'lib/auth') diff --git a/lib/auth/psk.c b/lib/auth/psk.c index 1124c94545..303e001607 100644 --- a/lib/auth/psk.c +++ b/lib/auth/psk.c @@ -35,7 +35,10 @@ #include -int _gnutls_proc_psk_client_kx(gnutls_session_t, uint8_t *, size_t); +static int _gnutls_proc_psk_client_kx(gnutls_session_t, uint8_t *, size_t); +static int +_gnutls_proc_psk_server_kx(gnutls_session_t session, uint8_t * data, + size_t _data_size); const mod_auth_st psk_auth_struct = { @@ -199,7 +202,7 @@ _gnutls_gen_psk_client_kx(gnutls_session_t session, /* just read the username from the client key exchange. */ -int +static int _gnutls_proc_psk_client_kx(gnutls_session_t session, uint8_t * data, size_t _data_size) { @@ -310,7 +313,7 @@ _gnutls_gen_psk_server_kx(gnutls_session_t session, /* just read the hint from the server key exchange. */ -int +static int _gnutls_proc_psk_server_kx(gnutls_session_t session, uint8_t * data, size_t _data_size) { @@ -358,15 +361,8 @@ _gnutls_proc_psk_server_kx(gnutls_session_t session, uint8_t * data, memcpy(info->hint, hint.data, hint.size); info->hint[hint.size] = 0; - ret = _gnutls_set_psk_session_key(session, &cred->key, NULL); - if (ret < 0) { - gnutls_assert(); - goto error; - } - ret = 0; - error: return ret; } diff --git a/lib/auth/psk.h b/lib/auth/psk.h index 3322493762..f9af369796 100644 --- a/lib/auth/psk.h +++ b/lib/auth/psk.h @@ -68,8 +68,6 @@ _gnutls_set_psk_session_key(gnutls_session_t session, gnutls_datum_t * key, int _gnutls_gen_psk_server_kx(gnutls_session_t session, gnutls_buffer_st * data); int _gnutls_gen_psk_client_kx(gnutls_session_t, gnutls_buffer_st *); -int _gnutls_proc_psk_server_kx(gnutls_session_t session, uint8_t * data, - size_t _data_size); int _gnutls_find_psk_key(gnutls_session_t session, gnutls_psk_client_credentials_t cred, -- cgit v1.2.1