- fix coverity
[oweals/gnunet.git] / src / cadet / cadet_protocol.h
index a51be39398c5f8647aa60cf56d6f1e2bf01511fb..dbb4f604fc64e16fca44e4525fc081af8ab0018d 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2001 - 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001 - 2011 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -53,7 +53,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
 struct GNUNET_CADET_ConnectionCreate
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
      *
      * Size: sizeof (struct GNUNET_CADET_ConnectionCreate) +
      *       path_length * sizeof (struct GNUNET_PeerIdentity)
@@ -79,7 +79,7 @@ struct GNUNET_CADET_ConnectionCreate
 struct GNUNET_CADET_ConnectionACK
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK
      */
   struct GNUNET_MessageHeader header;
 
@@ -97,7 +97,7 @@ struct GNUNET_CADET_ConnectionACK
 struct GNUNET_CADET_KX
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_KX.
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_KX.
      */
   struct GNUNET_MessageHeader header;
 
@@ -110,38 +110,38 @@ struct GNUNET_CADET_KX
 };
 
 
-
 /**
- * Message for encapsulation of a Key eXchange message in a connection.
+ * Flags to be used in GNUNET_CADET_AX_KX.
  */
-struct GNUNET_CADET_AX_KX
-{
-  /**
-   * Type: GNUNET_MESSAGE_TYPE_CADET_AX_KX.
-   */
-  struct GNUNET_MessageHeader header;
+enum GNUNET_CADET_AX_KX_Flags {
 
   /**
    * Should the peer reply with its KX details?
    */
-  uint32_t force_reply;
+  GNUNET_CADET_AX_KX_FLAG_NONE = 0,
 
   /**
-   * An EdDSA signature of the permanent ECDH key with the Peer's ID key.
+   * The peer should reply with its KX details?
    */
-  struct GNUNET_CRYPTO_EddsaSignature signature;
+  GNUNET_CADET_AX_KX_FLAG_FORCE_REPLY = 1
+};
 
+
+/**
+ * Message for encapsulation of a Key eXchange message in a connection.
+ */
+struct GNUNET_CADET_AX_KX
+{
   /**
-   * Information about what is being signed (@a permanent_key).
+   * Type: #GNUNET_MESSAGE_TYPE_CADET_AX_KX.
    */
-  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+  struct GNUNET_MessageHeader header;
 
   /**
-   * Sender's permanent_key public ECC key encoded in a
-   * format suitable for network transmission, as created
-   * using 'gcry_sexp_sprint'.
+   * Flags for the key exchange in NBO, based on
+   * `enum GNUNET_CADET_AX_KX_Flags`.
    */
-  struct GNUNET_CRYPTO_EcdhePublicKey permanent_key;
+  uint32_t flags GNUNET_PACKED;
 
   /**
    * Sender's ephemeral public ECC key encoded in a
@@ -319,6 +319,8 @@ struct GNUNET_CADET_AX
    */
   struct GNUNET_CADET_Hash hmac;
 
+  /**************** AX_HEADER start ****************/
+
   /**
    * Number of messages sent with the current ratchet key.
    */
@@ -334,6 +336,8 @@ struct GNUNET_CADET_AX
    */
   struct GNUNET_CRYPTO_EcdhePublicKey DHRs;
 
+  /**************** AX_HEADER  end  ****************/
+
   /**
    * Encrypted content follows.
    */