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-25 07:46:08 +0200
commitac51d63265511a67fa76f5e0e7363e688cde57fc (patch)
treef51a6e32a931ac47fdace0f4cdc727e1857b872e
parent410a801ac3345c6ae8e732174989d9c2986faf36 (diff)
downloadgnutls-ac51d63265511a67fa76f5e0e7363e688cde57fc.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 58367a737f..becdfd9dcb 100644
--- a/lib/constate.c
+++ b/lib/constate.c
@@ -507,7 +507,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 f96f949a3e..8e20c76ab3 100644
--- a/lib/handshake.c
+++ b/lib/handshake.c
@@ -2170,7 +2170,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.
*/
@@ -2200,7 +2199,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 3bcff851d3..25f44d04fd 100644
--- a/lib/session_pack.c
+++ b/lib/session_pack.c
@@ -722,7 +722,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) {
@@ -730,7 +729,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;