return 0;
}
+/* Sets the next epoch to be a clone of the current one.
+ */
+int _gnutls_epoch_dup(gnutls_session_t session)
+{
+ record_parameters_st *prev;
+ record_parameters_st *next;
+ int ret;
+
+ ret = _gnutls_epoch_get(session, EPOCH_READ_CURRENT, &prev);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
+
+ ret = _gnutls_epoch_get(session, EPOCH_NEXT, &next);
+ if (ret < 0) {
+ ret = _gnutls_epoch_new(session, 0, &next);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
+ }
+
+ if (next->initialized
+ || next->cipher != NULL || next->mac != NULL)
+ return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+
+ next->cipher = prev->cipher;
+ next->mac = prev->mac;
+
+ return 0;
+}
+
int _gnutls_epoch_set_keys(gnutls_session_t session, uint16_t epoch)
{
int hash_size;
return 0;
}
-
-
/* Initializes the write connection session
* (write encrypted data)
*/
#define _gnutls_epoch_bump(session) \
(session)->security_parameters.epoch_next++
+int _gnutls_epoch_dup(gnutls_session_t session);
+
int _gnutls_epoch_get(gnutls_session_t session, unsigned int epoch_rel,
record_parameters_st ** params_out);
int _gnutls_epoch_new(gnutls_session_t session, unsigned null_epoch, record_parameters_st **newp);