fix warning
authort3sserakt <t3ss@posteo.de>
Wed, 29 Jan 2020 17:06:37 +0000 (18:06 +0100)
committert3sserakt <t3ss@posteo.de>
Wed, 29 Jan 2020 17:06:37 +0000 (18:06 +0100)
src/cadet/cadet_protocol.h
src/cadet/gnunet-service-cadet_connection.c
src/cadet/gnunet-service-cadet_peer.c
src/cadet/gnunet-service-cadet_peer.h

index b3d5ecab968ccf291869084929194f9934b9757b..cf2681dfe331d7bba9bffe648fa10365fd773bee 100644 (file)
@@ -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
index 40966f553574eda70224ec4e0ec62aa01b03bf7e..f75b2fdb0b4b98ffb8a63367d7d6330e6d790909 100644 (file)
@@ -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));
   }
 
index 8b17402b25cc88deee3b0243c2ad43456d3385d6..b7a89dfe9f9de1ddffd668139dfc924096f4a8bc 100644 (file)
@@ -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,
index 389914915e696949a85f9004ff3b8a2c5f9afb7a..9336092fb3bde6346bd8218f1d8560c78cde9d39 100644 (file)
@@ -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