GNUnet debian-0.24.3-29-g453fda2cf
 
Loading...
Searching...
No Matches
gnunet-service-core_kx.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009, 2010, 2011 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
26#ifndef GNUNET_SERVICE_CORE_KX_H
27#define GNUNET_SERVICE_CORE_KX_H
28
29#include "gnunet_util_lib.h"
30#include "gnunet_core_service.h"
31
36
38{
44
49 uint16_t peer_class;
50
54};
55
67{
72
76 uint64_t r_I;
77
83
89
94
95 /* Followed by encrypted InitiatorHelloPayload */
96};
97
108
122{
127
131 uint64_t r_R;
132
138
139 /* Followed by encrypted ResponderHelloPayload */
140
141};
142
163
169{
174
179
183 unsigned char reserved[crypto_aead_xchacha20poly1305_ietf_ABYTES];
184
185};
186
195{
200
203
210
219 unsigned char tag[crypto_aead_xchacha20poly1305_ietf_ABYTES];
220};
221
233
241{
246
250 uint32_t flags;
251
255};
256
257
265void
267 const void *payload,
268 size_t payload_size);
269
270
276int
277GSC_KX_init (void);
278
279
283void
284GSC_KX_done (void);
285
286
293int
295 GSC_KeyExchangeInfo *target);
296
297
304unsigned int
306
307
316void
318
319
320#endif
321/* end of gnunet-service-core_kx.h */
void GSC_KX_handle_client_monitor_peers(struct GNUNET_MQ_Handle *mq)
Handle GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS request.
HeartbeatFlags
Heartbeat flags.
@ GSC_HEARTBEAT_KEY_UPDATE_REQUESTED
A key update is requested.
int GSC_NEIGHBOURS_check_excess_bandwidth(const struct GSC_KeyExchangeInfo *target)
Check if the given neighbour has excess bandwidth available.
void GSC_KX_encrypt_and_transmit(struct GSC_KeyExchangeInfo *kx, const void *payload, size_t payload_size)
Encrypt and transmit a message with the given payload.
unsigned int GSC_NEIGHBOURS_get_queue_length(const struct GSC_KeyExchangeInfo *target)
Check how many messages are queued for the given neighbour.
void GSC_KX_done(void)
Shutdown KX subsystem.
int GSC_KX_init(void)
Initialize KX subsystem.
static unsigned long long payload
How much data are we currently storing in the database?
Core service; the main API for encrypted P2P communications.
#define GNUNET_PACKED
gcc-ism to get packed structs.
static struct GNUNET_MQ_Handle * mq
Our connection to the resolver service, created on-demand, but then persists until error or shutdown.
struct GNUNET_MessageHeader header
Message type is GNUNET_MESSAGE_TYPE_CORE_ACK.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.
unsigned char tag[crypto_aead_xchacha20poly1305_ietf_ABYTES]
The Poly1305 tag of the encrypted message (which is starting at sequence_number), used to verify mess...
uint64_t sequence_number
Sequence number, in network byte order.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
HPKE DHKEM encapsulation (X25519) See RFC 9180.
A 512-bit hashcode.
Handle to a message queue.
Definition mq.c:87
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Information about the status of a key exchange with another peer.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.
uint32_t flags
Flags.
struct GNUNET_HashCode finished
TODO {Finished} - encrypted.
unsigned char reserved[crypto_aead_xchacha20poly1305_ietf_ABYTES]
The following is the additional space needed for the mac.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.
struct GNUNET_PeerIdentity pk_I
Sender Peer ID.
uint16_t peer_class
The peer class of the sending peer TODO part of services info?
uint64_t r_I
Random number to make replay attacks harder.
struct GNUNET_CRYPTO_EcdhePublicKey pk_e
Ephemeral public edx25519 key.
struct GNUNET_CRYPTO_HpkeEncapsulation c_R
Key encapsulation.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.
struct GNUNET_HashCode h_pk_R
Hash of the responder peer id.
uint16_t peer_class
The peer class of the sending peer TODO is it correct to send an enum like this? TODO part of service...
struct GNUNET_CRYPTO_HpkeEncapsulation c_I
Challenge encapsulation c_I.
struct GNUNET_CRYPTO_HpkeEncapsulation c_e
Ephemeral key encapsulation c_e.
uint64_t r_R
Random number to make replay attacks harder.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.