GNUnet debian-0.24.3-23-g589b01d60
gnunet_pils_service.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2024 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
36#ifndef GNUNET_PILS_SERVICE_H
37#define GNUNET_PILS_SERVICE_H
38
39#ifdef __cplusplus
40extern "C" {
41#if 0 /* keep Emacsens' auto-indent happy */
42}
43#endif
44#endif
45
46
47#include "gnunet_util_lib.h"
49
51
63 void *cls,
64 const struct GNUNET_PeerIdentity *pid,
65 const struct GNUNET_CRYPTO_EddsaSignature *sig);
66
75 void *cls,
76 void *result,
77 size_t result_size);
78
86 void *cls,
87 const struct GNUNET_ShortHashCode *key);
88
98 void *cls,
99 const struct GNUNET_HELLO_Parser *parser,
100 const struct GNUNET_HashCode *hash);
101
102
106struct GNUNET_PILS_Handle;
107
108
118struct GNUNET_PILS_Handle *
121 void *cls);
122
123
124
131void
133
134
153 const struct
156 void *cb_cls);
157
158
175 const struct GNUNET_CRYPTO_HpkeEncapsulation *c, // TODO rename
176 GNUNET_PILS_DecapsResultCallback cb, // TODO rename
177 void *cb_cls);
178
179
192void
194 const struct GNUNET_HELLO_Builder *addresses_builder);
195
196
197
198
205void
207 struct GNUNET_HashCode *address_hash);
208
217void
218GNUNET_PILS_derive_pid (size_t seed_key_bytes,
219 const uint8_t seed_key[seed_key_bytes],
220 const struct GNUNET_HashCode *addrs_hash,
221 struct GNUNET_CRYPTO_EddsaPrivateKey *outkey);
222
234 const struct GNUNET_HELLO_Builder *builder,
235 struct GNUNET_TIME_Absolute et,
237 void *cb_cls);
243void
245
246#if 0 /* keep Emacsens' auto-indent happy */
247{
248#endif
249#ifdef __cplusplus
250}
251#endif
252
253/* ifndef GNUNET_PILS_SERVICE_H */
254#endif
255
256/* end of gnunet_pils_service.h */
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static struct HostSet * builder
NULL if we are not currently iterating over peer information.
struct GNUNET_HashCode key
The key used in the DHT.
struct GNUNET_PILS_Operation * op
PILS op.
Definition: gnunet-hello.c:94
static uint8_t seed_key[256/8]
void pid_change_cb(void *cls, const struct GNUNET_HELLO_Parser *hparser, const struct GNUNET_HashCode *addr_hash)
Definition: gnunet-pils.c:64
static int result
Global testing status.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
Helper library for handling HELLO URIs.
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.
Definition: pils_api.c:367
void GNUNET_PILS_disconnect(struct GNUNET_PILS_Handle *handle)
Disconnect from the PILS service.
Definition: pils_api.c:390
void GNUNET_PILS_derive_pid(size_t seed_key_bytes, const uint8_t seed_key[seed_key_bytes], const struct GNUNET_HashCode *addrs_hash, struct GNUNET_CRYPTO_EddsaPrivateKey *outkey)
Generate the peer id from the addresses hash and the initial secret key.
Definition: pils_api.c:507
struct GNUNET_PILS_Operation * GNUNET_PILS_sign_hello(struct GNUNET_PILS_Handle *handle, const struct GNUNET_HELLO_Builder *builder, struct GNUNET_TIME_Absolute et, GNUNET_PILS_SignResultCallback cb, void *cb_cls)
Create HELLO signature.
Definition: pils_api.c:576
void GNUNET_PILS_cancel(struct GNUNET_PILS_Operation *op)
Cancel request.
Definition: pils_api.c:495
void(* GNUNET_PILS_PidChangeCallback)(void *cls, const struct GNUNET_HELLO_Parser *parser, const struct GNUNET_HashCode *hash)
A handler/callback to be called on the change of the peer id.
void(* GNUNET_PILS_DecapsResultCallback)(void *cls, const struct GNUNET_ShortHashCode *key)
A handler/callback to be called for decaps.
struct GNUNET_PILS_Operation * GNUNET_PILS_kem_decaps(struct GNUNET_PILS_Handle *handle, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, GNUNET_PILS_DecapsResultCallback cb, void *cb_cls)
Decaps an encapsulated key with our private key.
Definition: pils_api.c:468
struct GNUNET_PILS_Operation * GNUNET_PILS_sign_by_peer_identity(struct GNUNET_PILS_Handle *handle, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, GNUNET_PILS_SignResultCallback cb, void *cb_cls)
Sign data with the peer id.
Definition: pils_api.c:428
void GNUNET_PILS_feed_addresses(struct GNUNET_PILS_Handle *handle, const struct GNUNET_HELLO_Builder *addresses_builder)
Feed a set of addresses to pils so that it will generate a new peer id based on the given set of addr...
Definition: pils_api.c:542
void(* GNUNET_PILS_SignAddrResultCallback)(void *cls, void *result, size_t result_size)
A handler/callback to be called for signatures on addresses.
void(* GNUNET_PILS_SignResultCallback)(void *cls, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_CRYPTO_EddsaSignature *sig)
A handler/callback to be called for signatures.
void GNUNET_HELLO_builder_hash_addresses(const struct GNUNET_HELLO_Builder *builder, struct GNUNET_HashCode *address_hash)
Hash address in buidler.
Definition: hello-uri.c:1134
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
Private ECC key encoded for transmission.
an ECC signature using EdDSA.
HPKE DHKEM encapsulation (X25519) See RFC 9180.
Context for building (or parsing) HELLO URIs.
Definition: hello-uri.c:184
Context for parsing HELLOs.
Definition: hello-uri.c:232
A 512-bit hashcode.
A handle for the PILS service.
Definition: pils_api.c:82
The identity of the host (wraps the signing key of the peer).
A 256-bit hashcode.
Time for absolute times used by GNUnet, in microseconds.