58#define DECRYPTION_FAILURES_LOG_LEVEL GNUNET_ERROR_TYPE_DEBUG
72#define RESEND_MAX_TRIES 5
77#define AEAD_KEY_BYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES
82#define AEAD_NONCE_BYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
87#define AEAD_TAG_BYTES crypto_aead_xchacha20poly1305_ietf_ABYTES
94#define RESEND_TIMEOUT \
95 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
100#define RESEND_TIMEOUT_MAX \
101 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
109#define REPLAY_WINDOW_SIZE 64
118#define HEARTBEAT_PROBE_FREQUENCY \
119 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
126#define MAX_UNANSWERED_HEARTBEATS 3
131#define MIN_HEARTBEAT_FREQUENCY \
132 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
137#define HEARTBEAT_FREQUENCY \
138 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12)
151#define EPOCH_EXPIRATION \
152 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12)
157#define REKEY_TOLERANCE \
158 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
164#define EARLY_DATA_STR "early data"
170#define R_HS_TRAFFIC_STR "r hs traffic"
176#define I_HS_TRAFFIC_STR "i hs traffic"
182#define R_AP_TRAFFIC_STR "r ap traffic"
188#define I_AP_TRAFFIC_STR "i ap traffic"
194#define DERIVED_STR "derived"
200#define R_FINISHED_STR "r finished"
206#define I_FINISHED_STR "i finished"
211#define CAKE_LABEL "cake10"
223#define TRAFFIC_UPD_STR "traffic upd"
520 memset_s (buf, len, 0, len);
521#elif HAVE_EXPLICIT_BZERO
522 explicit_bzero (buf, len);
524 volatile unsigned char *
p = buf;
675 msg.state = htonl ((uint32_t) kx->
status);
718 "Session with `%s' timed out (%u heartbeats unanswered)\n",
732 "Sending HEARTBEAT to `%s'\n",
821 "Decrypted message of type %d from %s\n",
968 "Initiating key exchange with peer %s\n",
992 "I am the initiator, sending hello\n");
1001 "I am the responder, yielding and await initiator hello\n");
1032 "Ignoring connection to self\n");
1036 "Incoming connection of peer with %s\n",
1167 &derived_early_secret,
1168 sizeof (derived_early_secret),
1173 derived_early_secret));
1183 &derived_early_secret,
1184 sizeof (derived_early_secret),
1249 &derived_handshake_secret,
1250 sizeof (derived_handshake_secret),
1262 &derived_handshake_secret,
1263 sizeof (derived_handshake_secret),
1287 uint64_t *write_iv_ptr;
1288 unsigned int byte_offset;
1291 memcpy (per_record_write_iv,
1296 write_iv_ptr = (uint64_t*) (per_record_write_iv + byte_offset);
1297 *write_iv_ptr ^= seq_nbo;
1356 "Something went wrong deriving next *ATS key\n");
1372 const char *traffic_str;
1381 sizeof (*initial_ats),
1412 "Something went wrong expanding fk_R\n");
1418 sizeof (*transcript),
1446 "Something went wrong expanding fk_I\n");
1451 sizeof (*transcript),
1471 "Resending responder hello. Retries left: %u\n",
1499 &ephemeral_kem_challenge,
1504 "Something went wrong encapsulating ss_e\n");
1505 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1516 "Something went wrong encapsulating ss_I\n");
1518 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1527 "Transcript snapshot for derivation of HS, MS: `%s'\n",
1541 unsigned char rhp_buf[rhp_len];
1557 &ephemeral_kem_challenge,
1558 sizeof (ephemeral_kem_challenge));
1570 "Transcript snapshot for derivation of *HTS: `%s'\n",
1592 unsigned long long out_ct_len;
1595 unsigned char *finished_buf;
1596 GNUNET_assert (0 == crypto_aead_xchacha20poly1305_ietf_encrypt (
1597 (
unsigned char*) &rhm_e[1],
1607 "Encrypted and wrote %llu bytes\n",
1618 finished_buf = ((
unsigned char*) &rhm_e[1]) + out_ct_len;
1623 "Transcript snapshot for derivation of Rfinished: `%s'\n",
1634 GNUNET_assert (0 == crypto_aead_xchacha20poly1305_ietf_encrypt (
1645 "Encrypted and wrote %llu bytes\n",
1662 "Transcript snapshot for derivation of *ATS: `%s'\n",
1693 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1712 uint32_t ihm_len = ntohs (ihm_e->
header.
size);
1724 sizeof (ihm_e->
pk_e));
1740 "Transcript snapshot for derivation of ES, ETS: `%s'\n",
1753 ret = crypto_aead_xchacha20poly1305_ietf_decrypt (
1757 (
unsigned char*) &ihm_e[1],
1770 "Something went wrong decrypting: %d\n",
ret);
1772 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1798 "InitiatorHello from `%s' claims to be `%s'\n",
1801 kx->
peer = peer_before;
1805 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1825 "Something went wrong - we have the lower value and should have sent the InitiatorHello, but instead received it.\n");
1834 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1854 uint16_t
size = ntohs (
m->header.size);
1856 if (
size <
sizeof (*
m)
1892 "I am an initiator! Tearing down...\n");
1893 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1904 "Already received InitiatorHello: %d %d\n", kx->
role, kx->
status
1906 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1942 "InitiatorHello repeated by `%s' in state %d\n",
1947 "# InitiatorHello retransmissions received"),
1958 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
1993 "Peer `%s' restarted the key exchange in state %d, following\n",
2020 if (0 != memcmp (&ihm_e->
h_pk_R,
2025 "This message is not meant for us (H(PID) mismatch)\n");
2032 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2047 "No private key for our peer identity, cannot answer hello"
2053 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2063 "Failed to decapsulate c_R of hello from `%s'\n",
2068 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2126 "Resending initiator done. Retries left: %u\n",
2160 memset (&idm_local, 0,
sizeof (idm_local));
2173 "Transcript snapshot for derivation of Rfinished: `%s'\n",
2178 &responder_finished);
2180 &responder_finished,
2188 "Could not verify \"responder finished\" from `%s'\n",
2193 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2224 "Transcript snapshot for derivation of *ATS: `%s'\n",
2253 "InteratorFinished: `%s'\n",
2256 "Transcript `%s'\n",
2260 GNUNET_assert (0 == crypto_aead_xchacha20poly1305_ietf_encrypt (
2281 "Transcript snapshot for derivation of *ATS: `%s'\n",
2313 GNUNET_assert (0 == crypto_aead_xchacha20poly1305_ietf_encrypt (
2314 (
unsigned char*) &idm_e[1],
2316 (
unsigned char*) &ack_i,
2333 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2340 uint16_t
size = ntohs (
m->header.size);
2342 if (
size <
sizeof (*
m)
2382 "I am the responder! Ignoring.\n");
2383 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2403 "ResponderHello repeated by `%s', resending InitiatorDone\n",
2407 "# ResponderHello retransmissions received"),
2413 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2425 "Unexpected ResponderHello in state %d, ignoring\n",
2427 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2464 "Something went wrong decapsulating ss_e\n");
2467 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2474 "Transcript snapshot for derivation of HS, *HTS: `%s'\n",
2493 unsigned long long int c_len;
2494 unsigned char *finished_buf;
2496 c_len = ntohs (rhm_e->
header.
size) -
sizeof (*rhm_e)
2503 finished_buf = ((
unsigned char*) &rhm_e[1]) + c_len;
2512 ret = crypto_aead_xchacha20poly1305_ietf_decrypt (
2513 (
unsigned char*) rh_ctx->
rhp,
2516 (
unsigned char*) &rhm_e[1],
2526 "Something went wrong decrypting: %d\n",
ret);
2530 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2540 ret = crypto_aead_xchacha20poly1305_ietf_decrypt (
2554 "Something went wrong decrypting finished field: %d\n",
ret);
2558 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2574 "Failed to decapsulate c_I of ResponderHello from `%s'\n",
2579 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2591 uint16_t
size = ntohs (
m->header.size);
2628 "I am the initiator! Tearing down...\n");
2629 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2640 "InitiatorDone repeated by `%s', resending our Ack\n",
2647 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2658 "Unexpected InitiatorDone in state %d, ignoring\n",
2660 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2677 ret = crypto_aead_xchacha20poly1305_ietf_decrypt (
2692 "Something went wrong decrypting: %d\n",
ret);
2693 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2706 &initiator_finished);
2708 &initiator_finished,
2712 "Could not verify \"initiator finished\" hash.\n");
2720 "Transcript `%s'\n",
2722 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2741 ret = crypto_aead_xchacha20poly1305_ietf_decrypt (
2742 (
unsigned char*) &ack_i,
2745 (
unsigned char*) &idm_e[1],
2755 "Something went wrong decrypting the Ack: %d\n",
ret);
2757 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2760 if ((
sizeof ack_i != ntohs (ack_i.
header.
size)) ||
2766 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
2817 GNUNET_TRANSPORT_core_receive_continue (
transport,
2830 uint16_t
size = ntohs (
m->header.size) -
sizeof(*m);
2861 "Max epoch reached (you probably will never see this)\n");
2897 if (
sizeof *
msg > buf_len)
2951 uint16_t
size = ntohs (
m->header.size);
2953 unsigned char seq_enc_k[crypto_stream_chacha20_ietf_KEYBYTES];
2954 const unsigned char *seq_enc_nonce;
2958 uint32_t seq_enc_ctr;
2980 "Discarding record from `%s': no keys for epoch %" PRIu64
"\n",
2983 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3013 "Epoch %" PRIu64
" is too new, will not decrypt...\n",
3015 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3030 "Epoch %" PRIu64
" is too old, cannot decrypt...\n",
3032 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3040 seq_enc_ctr = *((uint32_t*)
m->tag);
3041 seq_enc_nonce = &
m->tag[
sizeof (uint32_t)];
3056 crypto_stream_chacha20_ietf_xor_ic (
3057 (
unsigned char*) &m_seq_nbo,
3058 (
unsigned char*) &
m->sequence_number,
3061 ntohl (seq_enc_ctr),
3065 "Received encrypted message in epoch %" PRIu64
3066 " with E(SQN=%" PRIu64
")=%" PRIu64
3070 m->sequence_number);
3081 "Discarding replayed record %" PRIu64
"/%" PRIu64
3086 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3101 ret = crypto_aead_xchacha20poly1305_ietf_decrypt_detached (
3102 (
unsigned char*) buf,
3104 (
unsigned char*) &
m[1],
3106 (
const unsigned char*) &
m->tag,
3124 "Discarding record %" PRIu64
"/%" PRIu64
" from `%s':"
3125 " does not deprotect\n",
3129 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3161 "Dropping message as we are still waiting for handshake ACK\n");
3163 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3174 GNUNET_TRANSPORT_core_receive_continue (
transport, &kx->
peer);
3196 "Peer `%s' disconnected from us.\n",
3247 "InitiatorHello not answered by `%s', restarting KX\n",
3254 "Resending InitiatorHello. Retries left: %u\n",
3276 long long unsigned int c_len;
3313 "Something went wrong encapsulating ss_R\n");
3350 ret = crypto_aead_xchacha20poly1305_ietf_encrypt (
3351 (
unsigned char*) &ihm_e[1],
3355 (
unsigned char*) ihmp,
3403 "Epoch expiration %" PRIu64
" SQN %" PRIu64
3404 ", incrementing epoch...\n",
3413 "Epoch exhausted for `%s', starting a new association\n",
3441 size_t payload_size)
3447 unsigned char seq_enc_k[crypto_stream_chacha20_ietf_KEYBYTES];
3452 encrypted_msg = NULL;
3481 ret = crypto_aead_xchacha20poly1305_ietf_encrypt_detached (
3482 (
unsigned char*) &encrypted_msg[1],
3483 (
unsigned char*) &encrypted_msg->
tag,
3496 "Something went wrong encrypting message\n");
3501 unsigned char *seq_enc_nonce;
3503 uint32_t seq_enc_ctr;
3506 seq_enc_ctr = *((uint32_t*) encrypted_msg->
tag);
3507 seq_enc_nonce = &encrypted_msg->
tag[
sizeof (uint32_t)];
3508 crypto_stream_chacha20_ietf_xor_ic (
3510 (
unsigned char*) &seq_nbo,
3513 ntohl (seq_enc_ctr),
3526 "Sending encrypted message with E(SQN=%" PRIu64
")=%" PRIu64
3577 _ (
"Failed to load our private key, "
3578 "cannot run key exchange\n"));
3603 "Connected to TRANSPORT\n");
3713 msg->state = htonl ((uint32_t) kx->
status);
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
#define GNUNET_CORE_OPTION_SEND_FULL_INBOUND
Client wants all inbound messages in full.
#define GNUNET_CORE_OPTION_SEND_HDR_INBOUND
Client just wants the 4-byte message headers of all inbound messages.
#define gettext_noop(String)
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
static int ret
Final status code.
static char * peer_id
Option –peer.
static bool finished
Set to true once we are finished and should exit after sending our final message to the parent.
struct GNUNET_HashCode key
The key used in the DHT.
static int result
Global testing status.
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
const struct GNUNET_CONFIGURATION_Handle * GSC_cfg
Our configuration.
void GSC_complete_initialization_cb(void)
This function is called from GSC_KX_init() once it got its peer id from pils.
void GSC_CLIENTS_deliver_message(const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *msg, uint16_t msize, uint32_t options)
Deliver P2P message to interested clients.
struct GNUNET_PILS_Handle * GSC_pils
For peer identity access.
struct GNUNET_STATISTICS_Handle * GSC_stats
For creating statistics.
Globals for gnunet-service-core.
#define RESEND_MAX_TRIES
Number of times we retransmit a handshake flight before giving up on it and starting a fresh exchange...
static void * handle_transport_notify_connect(void *cls, const struct GNUNET_PeerIdentity *peer_id, struct GNUNET_MQ_Handle *mq)
Function called by transport to notify us that a peer connected to us (on the network level).
static void cleanup_handshake_secrets(struct GSC_KeyExchangeInfo *kx)
unsigned int GSC_NEIGHBOURS_get_queue_length(const struct GSC_KeyExchangeInfo *kxinfo)
Check how many messages are queued for the given neighbour.
static void replay_commit(struct GSC_KeyExchangeInfo *kx, uint64_t epoch, uint64_t sqn)
Record that a record with sequence number sqn in epoch has been deprotected successfully,...
int GSC_NEIGHBOURS_check_excess_bandwidth(const struct GSC_KeyExchangeInfo *kxinfo)
Check if the given neighbour has excess bandwidth available.
static int check_initiator_hello(void *cls, const struct InitiatorHello *m)
#define MAX_UNANSWERED_HEARTBEATS
How many heartbeats in a row may go unanswered before we give up on the association.
static int check_responder_hello(void *cls, const struct ResponderHello *m)
static struct GSC_KeyExchangeInfo * kx_tail
DLL tail.
static int check_initiator_done(void *cls, const struct InitiatorDone *m)
void GSC_KX_handle_client_monitor_peers(struct GNUNET_MQ_Handle *mq)
Handle GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS request.
static void generate_per_record_nonce(uint64_t seq, const uint8_t write_iv[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES], uint8_t per_record_write_iv[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES])
Generate per record nonce as per https://www.rfc-editor.org/rfc/rfc8446#section-5....
static void handle_responder_hello(void *cls, const struct ResponderHello *rhm_e)
Handle Responder Hello message.
static void send_heartbeat(void *cls)
Task triggered when a neighbour entry is about to time out (and we should prevent this by sending an ...
#define IV_STR
String for expanding derived keys (Handshake and Early) (See https://lsd.gnunet.org/lsd0012/draft-sch...
static void handle_initiator_hello_cont(struct GSC_KeyExchangeInfo *kx, const struct InitiatorHello *ihm_e, const struct GNUNET_ShortHashCode *ss_R)
Finish handling the InitiatorHello ihm_e now that ss_R, the shared secret decapsulated with our peer ...
#define AEAD_TAG_BYTES
libsodium has very long symbol names
#define I_AP_TRAFFIC_STR
String for expanding IATS (See https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
#define I_FINISHED_STR
String for expanding fk_I used for InitiatorFinished field (See https://lsd.gnunet....
static char * my_services_info
Our services info string TODO.
static void resend_responder_hello(void *cls)
#define REPLAY_WINDOW_SIZE
Size of the per-epoch anti-replay window, in records.
static void handle_transport_notify_disconnect(void *cls, const struct GNUNET_PeerIdentity *peer, void *handler_cls)
Function called by transport telling us that a peer disconnected.
static void handle_responder_hello_cont(struct ResponderHelloCls *rh_ctx, const struct GNUNET_ShortHashCode *ss_I)
Finish handling a ResponderHello now that ss_I, the shared secret decapsulated with our peer identity...
#define MAX_EPOCHS
Maximum number of epochs we keep on hand.
static void derive_ihts(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *hs, struct GNUNET_ShortHashCode *ihts)
Derive the initiator handshake secret.
#define R_FINISHED_STR
String for expanding fk_R used for ResponderFinished field (See https://lsd.gnunet....
static void derive_initial_ats(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *ms, enum GSC_KX_Role role, struct GNUNET_ShortHashCode *initial_ats)
Derive the initiator application secret.
static struct GNUNET_NotificationContext * nc
Notification context for broadcasting to monitors.
#define AEAD_NONCE_BYTES
libsodium has very long symbol names
void GSC_KX_encrypt_and_transmit(struct GSC_KeyExchangeInfo *kx, const void *payload, size_t payload_size)
Encrypt and transmit payload.
#define R_AP_TRAFFIC_STR
String for expanding RATS (See https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
static void derive_next_ats(const struct GNUNET_ShortHashCode *old_ats, struct GNUNET_ShortHashCode *new_ats)
Derive the next application secret.
static void schedule_resend(struct GSC_KeyExchangeInfo *kx, GNUNET_SCHEDULER_TaskCallback cb)
Arm resend_task for the next retransmission of the flight in resend_env and back the timer off for th...
static enum GNUNET_GenericReturnValue replay_check(const struct GSC_KeyExchangeInfo *kx, uint64_t epoch, uint64_t sqn)
Would a record with sequence number sqn in epoch be a replay?
static void buffer_clear(void *buf, size_t len)
#define DECRYPTION_FAILURES_LOG_LEVEL
Enable expensive logging of decryption failures.
static void derive_per_message_secrets(const struct GNUNET_ShortHashCode *ts, uint64_t seq, unsigned char key[crypto_aead_xchacha20poly1305_ietf_KEYBYTES], unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES])
key = HKDF-Expand [I,R][A,H]TS, "key", 32) nonce = HKDF-Expand ([I,R][A,H]TS, "iv",...
static void derive_rhts(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *hs, struct GNUNET_ShortHashCode *rhts)
Derive the responder handshake secret.
static void generate_responder_finished(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *ms, struct GNUNET_HashCode *result)
Generate the responder finished field.
static struct GSC_KeyExchangeInfo * kx_head
DLL head.
#define AEAD_KEY_BYTES
libsodium has very long symbol names
GSC_KX_Role
Indicates whether a peer is in the initiating or receiving role.
static void generate_initiator_finished(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *ms, struct GNUNET_HashCode *result)
Generate the initiator finished field.
static void replay_reset_all(struct GSC_KeyExchangeInfo *kx)
Forget every anti-replay window (all of MAX_EPOCHS).
static void reset_handshake(struct GSC_KeyExchangeInfo *kx)
Discard the state of the handshake kx is in the middle of, so that a new one can be started.
static void snapshot_transcript(const struct GNUNET_HashContext *ts_hash, struct GNUNET_HashCode *snapshot)
static void derive_sn(const struct GNUNET_ShortHashCode *secret, unsigned char *sn, size_t sn_len)
#define MIN_HEARTBEAT_FREQUENCY
What is the minimum frequency for a HEARTBEAT message?
#define RESEND_TIMEOUT_MAX
Ceiling for the handshake retransmission timer (RFC 9147, Section 5.8).
void GSC_KX_done()
Shutdown KX subsystem.
static void derive_ms(const struct GNUNET_ShortHashCode *hs, const struct GNUNET_ShortHashCode *ss_I, struct GNUNET_ShortHashCode *ms)
Derive the master secret.
#define KEY_STR
String for expanding derived keys (Handshake and Early) (See https://lsd.gnunet.org/lsd0012/draft-sch...
#define HEARTBEAT_PROBE_FREQUENCY
How long we wait for the Ack to a heartbeat before sending another one.
static void update_timeout(struct GSC_KeyExchangeInfo *kx)
We've seen a valid message from the other peer.
static void derive_hs(const struct GNUNET_ShortHashCode *es, const struct GNUNET_ShortHashCode *ss_e, struct GNUNET_ShortHashCode *handshake_secret)
Derive the handshake secret.
static void send_initiator_hello(struct GSC_KeyExchangeInfo *kx)
Send initiator hello.
#define I_HS_TRAFFIC_STR
String for expanding IHTS (See https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
#define EARLY_DATA_STR
String for expanding early transport secret (See https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
static void handle_initiator_hello(void *cls, const struct InitiatorHello *ihm_e)
Handle the InitiatorHello message.
static void start_resend(struct GSC_KeyExchangeInfo *kx, GNUNET_SCHEDULER_TaskCallback cb)
Start a handshake flight: kx will retransmit it RESEND_MAX_TRIES times, starting after RESEND_TIMEOUT...
static void handle_encrypted_message(void *cls, const struct EncryptedMessage *m)
handle an encrypted message
static void derive_es_ets(const struct GNUNET_HashCode *transcript, const struct GNUNET_ShortHashCode *ss_R, struct GNUNET_ShortHashCode *es, struct GNUNET_ShortHashCode *ets)
TODO propose a new scheme: don't choose an initiator and responder based on hashing the peer ids,...
static int deliver_message(void *cls, const struct GNUNET_MessageHeader *m)
Deliver P2P message to interested clients.
static enum GNUNET_GenericReturnValue check_if_ack_or_heartbeat(struct GSC_KeyExchangeInfo *kx, const char *buf, size_t buf_len)
#define DERIVED_STR
String for expanding derived keys (Handshake and Early) (See https://lsd.gnunet.org/lsd0012/draft-sch...
static void abandon_exchange(struct GSC_KeyExchangeInfo *kx)
Give up on the exchange kx is in and on the session it may have established, and return it to a state...
static int check_encrypted_message(void *cls, const struct EncryptedMessage *m)
Check an incoming encrypted message before handling it.
static void resend_initiator_hello(void *cls)
#define EPOCH_EXPIRATION
How often do we rekey/switch to a new epoch?
static void resend_initiator_done(void *cls)
static enum GNUNET_GenericReturnValue check_rekey(struct GSC_KeyExchangeInfo *kx)
Move to the next epoch if the current one is exhausted.
static void monitor_notify_all(struct GSC_KeyExchangeInfo *kx)
Inform all monitors about the KX state of the given peer.
static struct GNUNET_SCHEDULER_Task * rekey_task
Task scheduled for periodic re-generation (and thus rekeying) of our ephemeral key.
void pid_change_cb(void *cls, const struct GNUNET_HELLO_Parser *parser, const struct GNUNET_HashCode *hash)
#define CAKE_LABEL
Labeled expand label for CAKE.
int GSC_KX_init(void)
Initialize KX subsystem.
static void restart_kx(struct GSC_KeyExchangeInfo *kx)
static struct GNUNET_TRANSPORT_CoreHandle * transport
Transport service.
static void handle_heartbeat(struct GSC_KeyExchangeInfo *kx, const struct Heartbeat *m)
Handle a key update.
static void handle_initiator_done(void *cls, const struct InitiatorDone *idm_e)
Handle InitiatorDone message.
#define R_HS_TRAFFIC_STR
String for expanding RHTS (See https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
void send_responder_hello(struct GSC_KeyExchangeInfo *kx)
#define RESEND_TIMEOUT
Initial handshake retransmission timer.
#define TRAFFIC_UPD_STR
String for expanding derived keys (Handshake and Early) (See https://lsd.gnunet.org/lsd0012/draft-sch...
static void replay_reset(struct GSC_KeyExchangeInfo *kx, uint64_t epoch)
Forget the anti-replay window of epoch.
code for managing the key exchange (SET_KEY, PING, PONG) with other peers
@ GSC_HEARTBEAT_KEY_UPDATE_REQUESTED
A key update is requested.
void GSC_SESSIONS_end(const struct GNUNET_PeerIdentity *pid)
End the session with the given peer (we are no longer connected).
void GSC_SESSIONS_create(const struct GNUNET_PeerIdentity *peer, struct GSC_KeyExchangeInfo *kx, enum GNUNET_CORE_PeerClass class)
Create a session, a key exchange was just completed.
static unsigned long long payload
How much data are we currently storing in the database?
struct GNUNET_CRYPTO_EddsaPrivateKey my_private_key
The current private key.
static struct GNUNET_Process * p
Helper process we started.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
enum GNUNET_GenericReturnValue GNUNET_PILS_enable_private_key(struct GNUNET_PILS_Handle *handle)
Enable local access to the private key of the current peer identity.
struct GNUNET_PILS_Handle * GNUNET_PILS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_PILS_PidChangeCallback pid_change_cb, void *cls)
Connect to the PILS service.
void GNUNET_PILS_disconnect(struct GNUNET_PILS_Handle *handle)
Disconnect from the PILS service.
const struct GNUNET_HashCode * GNUNET_PILS_get_identity_hash(const struct GNUNET_PILS_Handle *handle)
Return the hash of the current peer identity from a given handle.
const struct GNUNET_CRYPTO_EddsaPrivateKey * GNUNET_PILS_get_private_key(const struct GNUNET_PILS_Handle *handle)
Return the private key of the current peer identity.
const struct GNUNET_PeerIdentity * GNUNET_PILS_get_identity(const struct GNUNET_PILS_Handle *handle)
Return the current peer identity of a given handle.
Constants for network protocols.
API of the transport service towards the CORE service (TNG version)
struct GNUNET_TRANSPORT_CoreHandle * GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *self, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_TRANSPORT_NotifyConnect nc, GNUNET_TRANSPORT_NotifyDisconnect nd)
Connect to the transport service.
void GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle)
Disconnect from the transport service.
#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT
After how long do we consider a connection to a peer dead if we don't receive messages from the peer?
GNUNET_CORE_PeerClass
The peer class gives a hint about the capabilities of a peer.
GNUNET_CORE_KxState
TODO how does this harmonize with CAKE_CRYPTO_ENABLED?
@ GNUNET_CORE_CLASS_UNKNOWN
The device's capabilities are currently unknown.
@ GNUNET_CORE_KX_PEER_DISCONNECT
Last state of a KX (when it is being terminated).
@ GNUNET_CORE_KX_STATE_RESPONDER_CONNECTED
Connected as responder.
@ GNUNET_CORE_KX_STATE_DOWN
No handshake yet.
@ GNUNET_CORE_KX_STATE_INITIATOR_DONE_SENT
We sent initiator done.
@ GNUNET_CORE_KX_STATE_INITIATOR_HELLO_RECEIVED
We've received the initiator hello.
@ GNUNET_CORE_KX_STATE_AWAIT_INITIATION
We are awating the initiator hello.
@ GNUNET_CORE_KX_STATE_INITIATOR_CONNECTED
Connected as initiator.
@ GNUNET_CORE_KX_STATE_INITIATOR_HELLO_SENT
We sent the initiator hello.
@ GNUNET_CORE_KX_STATE_RESPONDER_HELLO_SENT
We sent the responder hello.
@ GNUNET_CORE_KX_ITERATION_FINISHED
This is not a state in a peer's state machine, but a special value used with the GNUNET_CORE_MonitorC...
void GNUNET_CRYPTO_ecdhe_key_create(struct GNUNET_CRYPTO_EcdhePrivateKey *pk)
Create a new private key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_kem_decaps(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Decapsulate a key for a private EdDSA key.
uint64_t GNUNET_CRYPTO_random_u64(uint64_t max)
Generate a random unsigned 64-bit value.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_kem_decaps(const struct GNUNET_CRYPTO_HpkePrivateKey *priv, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Decapsulate a key for a private X25519 key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_kem_encaps(const struct GNUNET_CRYPTO_HpkePublicKey *pkR, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Encapsulate key material for a X25519 public key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_kem_encaps(const struct GNUNET_CRYPTO_EddsaPublicKey *pub, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Encapsulate key material for a EdDSA public key.
void GNUNET_CRYPTO_ecdhe_key_get_public(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, struct GNUNET_CRYPTO_EcdhePublicKey *pub)
Extract the public key for the given private key.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hkdf_extract(struct GNUNET_ShortHashCode *prk, const void *salt, size_t salt_len, const void *ikm, size_t ikm_len)
HKDF-Extract using SHA256.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void GNUNET_CRYPTO_hmac(const struct GNUNET_CRYPTO_AuthKey *key, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac)
Calculate HMAC of a message (RFC 2104)
#define GNUNET_CRYPTO_hkdf_expand(result, out_len, prk,...)
HKDF-Expand using SHA256.
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_log(kind,...)
#define GNUNET_B2S(obj)
Convert a fixed-sized object to a string using GNUNET_b2s().
void GNUNET_CRYPTO_hash_context_read(struct GNUNET_HashContext *hc, const void *buf, size_t size)
Add data to be hashed.
struct GNUNET_HashContext * GNUNET_CRYPTO_hash_context_copy(const struct GNUNET_HashContext *hc)
Make a copy of the hash computation.
#define GNUNET_CRYPTO_kdf_arg_string(d)
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
void * cls
Closure for mv and cb.
void GNUNET_CRYPTO_hash_context_abort(struct GNUNET_HashContext *hc)
Abort hashing, do not bother calculating final result.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
void GNUNET_CRYPTO_hash_context_finish(struct GNUNET_HashContext *hc, struct GNUNET_HashCode *r_hash)
Finish the hash computation.
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's.
#define GNUNET_CRYPTO_kdf_arg_auto(d)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
struct GNUNET_HashContext * GNUNET_CRYPTO_hash_context_start(void)
Start incremental hashing operation.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_print_bytes(const void *buf, size_t buf_len, int fold, int in_be)
Print a byte string in hexadecimal ascii notation.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
const char * GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc)
Destroy the context, force disconnect for all subscribers.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
unsigned int GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq)
Obtain the current length of the message queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
struct GNUNET_NotificationContext * GNUNET_notification_context_create(unsigned int queue_length)
Create a new notification context.
void GNUNET_notification_context_broadcast(struct GNUNET_NotificationContext *nc, const struct GNUNET_MessageHeader *msg, int can_drop)
Send a message to all subscribers of this context.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc, struct GNUNET_MQ_Handle *mq)
Add a subscriber to the notification context.
#define GNUNET_MESSAGE_TYPE_CORE_HEARTBEAT
Message updating the keys of the peers.
#define GNUNET_MESSAGE_TYPE_CORE_ACK
Acknowledgement of prior messages.
#define GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE_CAKE
Encrypted message.
#define GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY
Reply for monitor by CORE service.
#define GNUNET_MESSAGE_TYPE_CORE_INITIATOR_DONE
Third and final message of the handshake, second of the initiator.
#define GNUNET_MESSAGE_TYPE_CORE_RESPONDER_HELLO
Reply to the first message from the initiator - first message sent by the responder.
#define GNUNET_MESSAGE_TYPE_CORE_INITIATOR_HELLO
for more detail on the following messages see https://lsd.gnunet.org/lsd0012/draft-schanzen-cake....
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
enum GNUNET_GenericReturnValue GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst, const char *buf, size_t size, int purge, int one_shot)
Add incoming data to the receive buffer and call the callback for all complete messages.
struct GNUNET_MessageStreamTokenizer * GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb, void *cb_cls)
Create a message stream tokenizer.
void GNUNET_MST_destroy(struct GNUNET_MessageStreamTokenizer *mst)
Destroys a tokenizer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the maximum of two relative time values.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
bool GNUNET_TIME_absolute_is_past(struct GNUNET_TIME_Absolute abs)
Test if abs is truly in the past (excluding now).
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
static unsigned int size
Size of the "table".
static struct GNUNET_MQ_Handle * mq
Our connection to the resolver service, created on-demand, but then persists until error or shutdown.
static struct GNUNET_TIME_Relative delta
struct GNUNET_MessageHeader header
Message type is GNUNET_MESSAGE_TYPE_CORE_ACK.
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.
type for (message) authentication keys
Private ECC key encoded for transmission.
HPKE DHKEM encapsulation (X25519) See RFC 9180.
A public key used for decryption.
struct GNUNET_CRYPTO_EcdhePrivateKey ecdhe_key
An ECDHE/X25519 key.
A public key used for encryption.
struct GNUNET_CRYPTO_EcdhePublicKey ecdhe_key
An ECDHE/X25519 key.
Context for parsing HELLOs.
Handle to a message queue.
Message handler for a specific message type.
Handle to a message stream tokenizer.
The notification context is the key datastructure for a convenience API used for transmission of noti...
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
Handle for the transport service (includes all of the state for the transport service).
Information about the status of a key exchange with another peer.
struct GSC_KeyExchangeInfo * prev
DLL.
struct GNUNET_ShortHashCode their_ats[10]
*ATS - other peers application traffic secret by epoch
struct GNUNET_ShortHashCode ss_R
struct GNUNET_ShortHashCode ihts
IHTS - Initiator handshake secret TODO.
struct GNUNET_TIME_Absolute current_epoch_expiration
Expiration time of our current epoch.
struct GNUNET_ShortHashCode early_secret_key
ES - Early Secret Key TODO uniform naming: _key?
struct GNUNET_ShortHashCode master_secret
Master secret key TODO.
uint64_t current_sqn
Our current sequence number.
struct GNUNET_TIME_Absolute last_notify_timeout
Last time we notified monitors.
enum GSC_KX_Role role
Own role in the key exchange.
struct GNUNET_MessageStreamTokenizer * mst
Our message stream tokenizer (for encrypted payload).
struct GSC_KeyExchangeInfo * next
DLL.
struct GNUNET_CRYPTO_HpkePrivateKey sk_e
Initiator secret key.
unsigned int resend_tries_left
Resend tries left.
struct GNUNET_SCHEDULER_Task * resend_task
Task for resending messages during handshake.
struct GNUNET_HashCode rh_hash
Hash over the entire ResponderHello we are currently answering, or all zeroes if there is none.
struct GNUNET_PeerIdentity peer
Identity of the peer.
struct GNUNET_MQ_Handle * mq
Message queue for sending messages to peer.
struct GNUNET_ShortHashCode early_traffic_secret
ETS - Early traffic secret TODO.
uint64_t their_max_epoch
Highest seen (or used) epoch of responder resp initiator.
int association_up
GNUNET_YES once application traffic keys are installed for this peer, i.e.
struct GNUNET_TIME_Absolute timeout
When should the session time out (if there are no Acks to HEARTBEATs)?
struct GNUNET_MQ_Envelope * resend_env
Env for resending messages.
struct GNUNET_ShortHashCode rhts
RHTS - Responder handshake secret TODO.
struct GNUNET_ShortHashCode ss_I
uint64_t replay_max[10]
Highest sequence number we have successfully deprotected in each epoch; the right edge of that epoch'...
struct GNUNET_ShortHashCode handshake_secret
HS - Handshake secret TODO.
struct GNUNET_ShortHashCode ss_e
int has_excess_bandwidth
GNUNET_YES if this peer currently has excess bandwidth.
struct GNUNET_TIME_Relative resend_delay
How long to wait before the next retransmission of the handshake message in resend_env.
uint64_t replay_bitmap[10]
Anti-replay window for each epoch: bit k is set if the record with sequence number ‘replay_max[i] - k...
enum GNUNET_CORE_KxState status
What is our connection state?
unsigned int heartbeats_unanswered
Heartbeats sent since the last record we deprotected from this peer.
struct GNUNET_CRYPTO_HpkePublicKey pk_e
Initiator ephemeral key.
struct GNUNET_HashCode ih_hash
Hash over the entire InitiatorHello we are currently answering, or all zeroes if there is none.
struct GNUNET_HashContext * transcript_hash_ctx
The transcript hash context.
uint64_t current_epoch
Our currently used epoch for sending.
enum GNUNET_CORE_PeerClass class
Peer class of the other peer TODO still needed?
struct GNUNET_ShortHashCode current_ats
*ATS - our current application traffic secret by epoch
struct GNUNET_SCHEDULER_Task * heartbeat_task
ID of task used for sending keep-alive pings.
struct GNUNET_MessageHeader header
Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG.
struct GNUNET_HashCode finished
TODO {Finished} - encrypted.
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.
Message sent by the service to monitor clients to notify them about a peer changing status.
uint32_t state
New peer state, an enum GNUNET_CORE_KxState in NBO.
struct GNUNET_TIME_AbsoluteNBO timeout
How long will we stay in this state (if nothing else happens)?
struct GNUNET_ShortHashCode ss_e
struct GNUNET_ShortHashCode ihts
struct GNUNET_ShortHashCode rhts
struct ResponderHello rhm_e
struct ResponderHelloPayload * rhp
struct GSC_KeyExchangeInfo * kx
char finished_enc[sizeof(struct GNUNET_HashCode)+crypto_aead_xchacha20poly1305_ietf_ABYTES]
struct GNUNET_HashContext * hc
struct GNUNET_HashCode decrypted_finish
struct GNUNET_ShortHashCode hs
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.