* 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)
*/
- struct GNUNET_TIME_Absolute monotime;
+ struct GNUNET_TIME_AbsoluteNBO monotime;
/**
* We sign the monotime. The receiving peer can check the signature, to verify
set_monotime_sig (struct GNUNET_CADET_ConnectionCreateMessage * msg)
{
struct GNUNET_CRYPTO_EddsaPrivateKey *key;
- struct GNUNET_TIME_Absolute monotime;
+
struct CadetConnectionCreatePS cp = { .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CADET_CONNECTION_INITIATOR),
.purpose.size = htonl (sizeof(cp)),
- .monotonic_time = GNUNET_TIME_absolute_hton (monotime)};
+ .monotonic_time = msg->monotime};
if (GNUNET_OK != GNUNET_CRYPTO_eddsa_sign (my_private_key, &cp.purpose, &msg->monotime_sig))
{
(GCT_alice_or_betty (GCP_get_id(cc->destination)) == GNUNET_NO))
{
create_msg->has_monotime = GNUNET_YES;
- create_msg->monotime = GNUNET_TIME_absolute_get_monotonic(cfg);
+ create_msg->monotime = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic(cfg));
GNUNET_assert (GNUNET_OK == set_monotime_sig(create_msg));
}
* FIXME: comment
*/
int
-GCP_check_monotime (struct CadetPeer *peer, struct GNUNET_TIME_Absolute monotime)
+GCP_check_monotime (struct CadetPeer *peer, struct GNUNET_TIME_AbsoluteNBO monotime)
{
- if (monotime.abs_value_us > *(&peer->last_connection_create.abs_value_us))
+ if (GNUNET_TIME_absolute_ntoh(monotime).abs_value_us > *(&peer->last_connection_create.abs_value_us))
return GNUNET_YES;
return GNUNET_NO;
}
struct CadetConnectionCreatePS cp = { .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CADET_CONNECTION_INITIATOR),
.purpose.size = htonl (sizeof(cp)),
- .monotonic_time = &msg->monotime};
+ .monotonic_time = msg->monotime};
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_CADET_CONNECTION_INITIATOR,
int
GCP_check_monotime (struct CadetPeer *peer,
- struct GNUNET_TIME_Absolute monotime);
+ struct GNUNET_TIME_AbsoluteNBO monotime);
#endif