From: t3sserakt Date: Wed, 29 Jan 2020 17:06:37 +0000 (+0100) Subject: fix warning X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d2c15dbb8061e7e7657657ec8334c4dbb71c03ea;p=oweals%2Fgnunet.git fix warning --- diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h index b3d5ecab9..cf2681dfe 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h @@ -95,7 +95,7 @@ struct GNUNET_CADET_ConnectionCreateMessage * 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 diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 40966f553..f75b2fdb0 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -599,10 +599,10 @@ int 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)) { @@ -643,7 +643,7 @@ send_create (void *cls) (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)); } diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 8b17402b2..b7a89dfe9 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -1565,10 +1565,10 @@ GCP_update_monotime (struct CadetPeer *peer) * 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; } @@ -1584,7 +1584,7 @@ GCP_check_monotime_sig (struct CadetPeer *peer, struct GNUNET_CADET_ConnectionCr 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, diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h index 389914915..9336092fb 100644 --- a/src/cadet/gnunet-service-cadet_peer.h +++ b/src/cadet/gnunet-service-cadet_peer.h @@ -410,6 +410,6 @@ GCP_update_monotime (struct CadetPeer *cp); int GCP_check_monotime (struct CadetPeer *peer, - struct GNUNET_TIME_Absolute monotime); + struct GNUNET_TIME_AbsoluteNBO monotime); #endif