&hmac_send, NULL, NULL)) {
/** Cannot get keys */
ske->status = SILC_SKE_STATUS_ERROR;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_initiator_error);
return SILC_FSM_CONTINUE;
}
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
+
/* Set the new keys into use. This will also send REKEY_DONE packet. Any
packet sent after this call will be protected with the new keys. */
if (!silc_packet_set_keys(ske->stream, send_key, NULL, hmac_send, NULL,
/** Cannot set keys */
SILC_LOG_DEBUG(("Cannot set new keys, error sending REKEY_DONE"));
ske->status = SILC_SKE_STATUS_ERROR;
+ silc_cipher_free(send_key);
+ silc_hmac_free(hmac_send);
silc_fsm_next(fsm, silc_ske_st_initiator_error);
return SILC_FSM_CONTINUE;
}
NULL, &hmac_receive, NULL)) {
/** Cannot get keys */
ske->status = SILC_SKE_STATUS_ERROR;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_initiator_error);
return SILC_FSM_CONTINUE;
}
/** Cannot set keys */
SILC_LOG_DEBUG(("Cannot set new keys"));
ske->status = SILC_SKE_STATUS_ERROR;
+ silc_cipher_free(receive_key);
+ silc_hmac_free(hmac_receive);
silc_fsm_next(fsm, silc_ske_st_initiator_error);
return SILC_FSM_CONTINUE;
}
if (!rekey) {
/** No memory */
ske->status = SILC_SKE_STATUS_OUT_OF_MEMORY;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_initiator_error);
return SILC_FSM_CONTINUE;
}
silc_schedule_task_add_timeout(ske->schedule, silc_ske_timeout,
ske, 30, 0);
-
silc_fsm_next(fsm, silc_ske_st_rekey_responder_start);
/* If REKEY packet already received process it directly */
&hmac_send, NULL, NULL)) {
/** Cannot get keys */
ske->status = SILC_SKE_STATUS_ERROR;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_responder_error);
return SILC_FSM_CONTINUE;
}
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
+
/* Set the new keys into use. This will also send REKEY_DONE packet. Any
packet sent after this call will be protected with the new keys. */
if (!silc_packet_set_keys(ske->stream, send_key, NULL, hmac_send, NULL,
/** Cannot set keys */
SILC_LOG_DEBUG(("Cannot set new keys, error sending REKEY_DONE"));
ske->status = SILC_SKE_STATUS_ERROR;
+ silc_cipher_free(send_key);
+ silc_hmac_free(hmac_send);
silc_fsm_next(fsm, silc_ske_st_responder_error);
return SILC_FSM_CONTINUE;
}
NULL, &hmac_receive, NULL)) {
/** Cannot get keys */
ske->status = SILC_SKE_STATUS_ERROR;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_responder_error);
return SILC_FSM_CONTINUE;
}
/** Cannot set keys */
SILC_LOG_DEBUG(("Cannot set new keys"));
ske->status = SILC_SKE_STATUS_ERROR;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
+ silc_cipher_free(receive_key);
+ silc_hmac_free(hmac_receive);
silc_fsm_next(fsm, silc_ske_st_responder_error);
return SILC_FSM_CONTINUE;
}
if (!rekey) {
/** No memory */
ske->status = SILC_SKE_STATUS_OUT_OF_MEMORY;
+ ske->prop->cipher = NULL;
+ ske->prop->hmac = NULL;
silc_fsm_next(fsm, silc_ske_st_responder_error);
return SILC_FSM_CONTINUE;
}