GNUnet 0.28.0-dev.3-7-g31e20e2e6
 
Loading...
Searching...
No Matches
cadet_protocol.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2007 - 2017 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
28#ifndef CADET_PROTOCOL_H_
29#define CADET_PROTOCOL_H_
30
34#define DEBUG_KX 0
35#if DEBUG_KX
36#warning NEVER run this in production! KX debugging is on!
37#endif
38
39#include "platform.h"
40#include "gnunet_util_lib.h"
41#include "cadet.h"
42
43#ifdef __cplusplus
44
45struct GNUNET_CADET_TunnelMessage;
46extern "C"
47{
48#if 0
49/* keep Emacsens' auto-indent happy */
50}
51#endif
52#endif
53
54/******************************************************************************/
55/******************** CADET NETWORK MESSAGES **************************/
56/******************************************************************************/
57
59
60
61/******************************************************************************/
62/***************************** CONNECTION **********************************/
63/******************************************************************************/
64
65
116
117
138
139
170
171
192
193
194/******************************************************************************/
195/******************************* TUNNEL ***********************************/
196/******************************************************************************/
197
213
214
230
231
236{
243
249
254
261
262#if DEBUG_KX
268 struct GNUNET_CRYPTO_EcdhePrivateKey ephemeral_key_XXX; // for debugging KX-crypto!
269#endif
270
277};
278
279
285{
290
291#if DEBUG_KX
297 struct GNUNET_CRYPTO_EcdhePublicKey r_ephemeral_key_XXX; // for debugging KX-crypto!
298#endif
299
305};
306
307
329
330
368
369
370/******************************************************************************/
371/******************************* CHANNEL ***********************************/
372/******************************************************************************/
373
374
400
401
429
430
452
453
464
465
490
491
521
522
524
525#if 0 /* keep Emacsens' auto-indent happy */
526{
527#endif
528#ifdef __cplusplus
529}
530#endif
531
532/* ifndef CADET_PROTOCOL_H */
533#endif
534/* end of cadet_protocol.h */
GNUNET_CADET_KX_Flags
Flags to be used in GNUNET_CADET_KX.
@ GNUNET_CADET_KX_FLAG_NONE
Should the peer reply with its KX details?
@ GNUNET_CADET_KX_FLAG_FORCE_REPLY
The peer should reply with its KX details?
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Unique identifier (counter) for an encrypted message in a channel.
uint32_t pid
This number is incremented by one per message.
Number used to uniquely identify messages in a CADET Channel.
uint32_t mid
Unique ID of the message, cycles around, in NBO.
Encrypted axolotl header with numbers that identify which keys in which ratchet are to be used to dec...
uint32_t PNs
Number of messages sent with the previous ratchet key.
struct GNUNET_CRYPTO_EcdhePublicKey DHRs
Current ratchet key.
uint32_t Ns
Number of messages sent with the current ratchet key.
Message for cadet data traffic.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA.
struct GNUNET_CADET_ChannelTunnelNumber ctn
ID of the channel.
struct ChannelMessageIdentifier mid
Unique ID of the payload message.
Message to acknowledge end-to-end data.
struct ChannelMessageIdentifier mid
Next message ID expected.
struct GNUNET_CADET_ChannelTunnelNumber ctn
ID of the channel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK.
uint64_t futures
Bitfield of already-received newer messages.
Message to destroy a channel of type GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY.
struct GNUNET_CADET_ChannelTunnelNumber ctn
ID of the channel.
Message to acknowledge opening a channel of type GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK.
struct GNUNET_HashCode port
Port number of the channel, used to prove to the initiator that the receiver knows the port.
struct GNUNET_CADET_ChannelTunnelNumber ctn
ID of the channel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK.
Message to create a Channel.
struct GNUNET_HashCode h_port
Hash of destination port and listener.
struct GNUNET_CADET_ChannelTunnelNumber ctn
ID of the channel within the tunnel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN.
uint32_t opt
Channel options.
Number identifying a CADET channel within a tunnel.
Message for notifying a disconnection in a path.
struct GNUNET_PeerIdentity peer1
ID of the endpoint.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_PeerIdentity peer2
ID of the endpoint.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
Message for ack'ing a connection.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
Message for cadet connection creation.
int has_monotime
This flag indicates the peer sending the connection create message likes to trigger a KX handshake.
uint32_t options
Connection options in network byte order.
struct GNUNET_CRYPTO_EddsaSignature monotime_sig
We sign the monotime.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_TIME_AbsoluteNBO monotime
This monotonic time is set, if a peer likes to trigger a KX, but is not the peer that should start th...
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE.
Message to destroy a connection.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY.
Hash uniquely identifying a connection below a tunnel.
Axolotl-encrypted tunnel message with application payload.
struct GNUNET_CADET_AxHeader ax_header
Axolotl-header that specifies which keys to use in which ratchet to decrypt the body that follows.
uint32_t reserved
Reserved, for alignment.
struct GNUNET_CRYPTO_AeadMac mac
MAC of the encrypted message, used to verify message integrity.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED.
Message for a Key eXchange for a tunnel, with authentication.
struct GNUNET_HashCode auth
KDF-proof that sender could compute the 3-DH, used in lieu of a signature or payload data.
struct GNUNET_CADET_TunnelKeyExchangeMessage kx
Message header with key material.
Message for a Key eXchange for a tunnel.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key
Sender's next ephemeral public ECC key encoded in a format suitable for network transmission,...
uint32_t flags
Flags for the key exchange in NBO, based on enum GNUNET_CADET_KX_Flags.
struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key
Sender's ephemeral public ECC key encoded in a format suitable for network transmission,...
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX or GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH as part of stru...
type for session keys
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
an ECC signature using EdDSA.
A 512-bit hashcode.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Time for absolute time used by GNUnet, in microseconds and in network byte order.