GNUnet 0.27.0
 
Loading...
Searching...
No Matches
gnunet_pils_service.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2024, 2026 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#include "gnunet_common.h"
40#ifdef __cplusplus
41extern "C" {
42#if 0 /* keep Emacsens' auto-indent happy */
43}
44#endif
45#endif
46
47
48#include "gnunet_util_lib.h"
50
52
64 void *cls,
65 const struct GNUNET_PeerIdentity *pid,
66 const struct GNUNET_CRYPTO_EddsaSignature *sig);
67
76 void *cls,
77 void *result,
78 size_t result_size);
79
87 void *cls,
88 const struct GNUNET_ShortHashCode *key);
89
97 void *cls,
98 const struct GNUNET_HashCode *key);
99
109 void *cls,
110 const struct GNUNET_HELLO_Parser *parser,
111 const struct GNUNET_HashCode *hash);
112
113
117struct GNUNET_PILS_Handle;
118
119
124
125
135struct GNUNET_PILS_Handle *
138 void *cls);
139
140
147void
149
150
169 const struct
172 void *cb_cls);
173
174
191 const struct GNUNET_CRYPTO_HpkeEncapsulation *c, // TODO rename
192 GNUNET_PILS_DecapsResultCallback cb, // TODO rename
193 void *cb_cls);
194
195
208 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
210 void *cb_cls);
211
212
225void
227 const struct GNUNET_HELLO_Builder *addresses_builder
228 );
229
230
237void
239 struct GNUNET_HashCode *address_hash);
240
249void
250GNUNET_PILS_derive_pid (size_t seed_key_bytes,
251 const uint8_t seed_key[seed_key_bytes],
252 const struct GNUNET_HashCode *addrs_hash,
253 struct GNUNET_CRYPTO_EddsaPrivateKey *outkey);
254
266 const struct GNUNET_HELLO_Builder *builder,
267 struct GNUNET_TIME_Absolute et,
269 void *cb_cls);
270
276void
278
285const struct GNUNET_PeerIdentity*
287
294const struct GNUNET_HashCode*
296
309 void *cls);
310
316void
318
327 );
328
329#if 0 /* keep Emacsens' auto-indent happy */
330{
331#endif
332#ifdef __cplusplus
333}
334#endif
335
336/* ifndef GNUNET_PILS_SERVICE_H */
337#endif
338
339/* end of gnunet_pils_service.h */
static struct GNUNET_ARM_Operation * op
Current operation.
Definition gnunet-arm.c:143
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition gnunet-arm.c:108
static struct GNUNET_PILS_KeyRing * key_ring
For PILS.
static struct HostSet * builder
NULL if we are not currently iterating over peer information.
struct GNUNET_HashCode key
The key used in the DHT.
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:65
static int result
Global testing status.
static struct GNUNET_CRYPTO_EddsaPublicKey pub
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
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
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:465
void GNUNET_PILS_disconnect(struct GNUNET_PILS_Handle *handle)
Disconnect from the PILS service.
Definition pils_api.c:488
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.
Definition pils_api.c:736
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:635
struct GNUNET_PILS_Operation * GNUNET_PILS_ecdh(struct GNUNET_PILS_Handle *handle, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, GNUNET_PILS_EcdhResultCallback cb, void *cb_cls)
Derive key material from a ECDH public key and our private key.
Definition pils_api.c:595
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:703
void GNUNET_PILS_cancel(struct GNUNET_PILS_Operation *op)
Cancel request.
Definition pils_api.c:623
struct GNUNET_PILS_Operation * GNUNET_PILS_sign_by_peer_identity(struct GNUNET_PILS_Handle *handle, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, GNUNET_PILS_SignResultCallback cb, void *cb_cls)
Sign data with the peer id.
Definition pils_api.c:528
struct GNUNET_PILS_KeyRing * GNUNET_PILS_create_key_ring(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_SCHEDULER_TaskCallback init_cb, void *cls)
Create a key ring handle to use the current peer identity key.
Definition pils_api.c:804
void GNUNET_PILS_destroy_key_ring(struct GNUNET_PILS_KeyRing *key_ring)
Destroy a key ring handle and free its memory.
Definition pils_api.c:864
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.
const struct GNUNET_PeerIdentity * GNUNET_PILS_get_identity(const struct GNUNET_PILS_Handle *handle)
Return the current peer identity of a given handle.
Definition pils_api.c:727
void(* GNUNET_PILS_EcdhResultCallback)(void *cls, const struct GNUNET_HashCode *key)
A handler/callback to be called for ecdh.
const struct GNUNET_CRYPTO_EddsaPrivateKey * GNUNET_PILS_key_ring_get_private_key(const struct GNUNET_PILS_KeyRing *key_ring)
Return the current private key of a given key ring handle.
Definition pils_api.c:887
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:568
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:669
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 builder.
Definition hello-uri.c:1170
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
Private ECC key encoded for transmission.
an ECC signature using EdDSA.
HPKE DHKEM encapsulation (X25519) See RFC 9180.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
Context for building (or parsing) HELLO URIs.
Definition hello-uri.c:185
Context for parsing HELLOs.
Definition hello-uri.c:233
A 512-bit hashcode.
A handle for the PILS service.
Definition pils_api.c:82
A simplified handle for using the peer identity key.
Definition pils_api.c:132
void * cls
Closure for initial callback.
Definition pils_api.c:146
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.
static void init_cb(void *cls, const struct GNUNET_PeerIdentity *my_identity)