uint32_t options GNUNET_PACKED;
/**
- * Infomation of known tunnel state to keep two peers synced. (xrs,t3ss)
- * FIXME: find better var name.
+ * This monotonic time is set, if a peer likes to trigger a KX, but is not
+ * the peer that should start the KX. (xrs,t3ss)
*/
- int tunnel_up;
+ struct GNUNET_TIME_Absolute monotime;
+
+ /**
+ * We sign the monotime. The receiving peer can check the signature, to verify
+ * the sending peer.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature monotime_sig;
/**
* ID of the connection
// check for tunnel state and define tunnel_up (xrs,t3ss)
t = GCP_get_tunnel (cc->destination, GNUNET_YES);
- if (NULL != t)
+ if (NULL != t && (GCT_get_estate(t) == CADET_TUNNEL_KEY_UNINITIALIZED) &&
+ (GCT_alice_or_betty (GCP_get_id(cc->destination)) == GNUNET_NO))
{
- create_msg->tunnel_up = (GCT_get_estate(t) == CADET_TUNNEL_KEY_UNINITIALIZED) &&
- (GCT_alice_or_betty (GCP_get_id(cc->destination)) == GNUNET_NO)
- ? GNUNET_NO : GNUNET_YES;
+ create_msg->monotime = GNUNET_TIME_absolute_get_monotonic(we_need_config_handle_here);
+ create_msg->monotime_sig = create_monotime_sig(create_msg->monotime);
}
pids = (struct GNUNET_PeerIdentity *) &create_msg[1];
t = GCP_get_tunnel (sender, GNUNET_YES);
// Check for CADET state in case the other side has lost the tunnel (xrs,t3ss)
- if ((GNUNET_NO == msg->tunnel_up) &&
+ if ((NULL != msg->monotime) && check_monotime_sig(msg)
(CADET_TUNNEL_KEY_OK == GCT_get_estate(t)))
{
GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED);