summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-09-15 08:26:22 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-09-18 09:15:09 +0200
commita6c023dba0d00598741a224651f07abdf565147e (patch)
tree7c2614ef7299a61d4ae36b28e59a3f890e601d66
parent0b92addd19d181ba29ea24112f3f2dcf7e03caca (diff)
downloadgnutls-a6c023dba0d00598741a224651f07abdf565147e.tar.gz
_gnutls_epoch_get(): simplified use
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/constate.c3
-rw-r--r--lib/handshake.c3
-rw-r--r--lib/session_pack.c3
3 files changed, 4 insertions, 5 deletions
diff --git a/lib/constate.c b/lib/constate.c
index 0121f9a658..1a8e19def0 100644
--- a/lib/constate.c
+++ b/lib/constate.c
@@ -508,7 +508,8 @@ _gnutls_epoch_get(gnutls_session_t session, unsigned int epoch_rel,
if (params == NULL || *params == NULL)
return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
- *params_out = *params;
+ if (params_out)
+ *params_out = *params;
return 0;
}
diff --git a/lib/handshake.c b/lib/handshake.c
index 46540e1ebe..2928756622 100644
--- a/lib/handshake.c
+++ b/lib/handshake.c
@@ -2235,7 +2235,6 @@ static int _gnutls_recv_supplemental(gnutls_session_t session)
int gnutls_handshake(gnutls_session_t session)
{
int ret;
- record_parameters_st *params;
/* sanity check. Verify that there are priorities setup.
*/
@@ -2265,7 +2264,7 @@ int gnutls_handshake(gnutls_session_t session)
ret =
_gnutls_epoch_get(session,
session->security_parameters.epoch_next,
- &params);
+ NULL);
if (ret < 0) {
/* We assume the epoch is not allocated if _gnutls_epoch_get fails. */
ret =
diff --git a/lib/session_pack.c b/lib/session_pack.c
index 526f5937de..6cc5d15c7b 100644
--- a/lib/session_pack.c
+++ b/lib/session_pack.c
@@ -723,7 +723,6 @@ pack_security_parameters(gnutls_session_t session, gnutls_buffer_st * ps)
int ret;
int size_offset;
size_t cur_size;
- record_parameters_st *params;
if (session->security_parameters.epoch_read
!= session->security_parameters.epoch_write) {
@@ -731,7 +730,7 @@ pack_security_parameters(gnutls_session_t session, gnutls_buffer_st * ps)
return GNUTLS_E_UNAVAILABLE_DURING_HANDSHAKE;
}
- ret = _gnutls_epoch_get(session, EPOCH_READ_CURRENT, &params);
+ ret = _gnutls_epoch_get(session, EPOCH_READ_CURRENT, NULL);
if (ret < 0) {
gnutls_assert();
return ret;