GNUnet  0.20.0
gnunet_revocation_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2013 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 
21 #ifndef GNUNET_REVOCATION_SERVICE_H_
22 #define GNUNET_REVOCATION_SERVICE_H_
23 
24 
26 
44 #ifdef __cplusplus
45 extern "C"
46 {
47 #if 0 /* keep Emacsens' auto-indent happy */
48 }
49 #endif
50 #endif
51 
52 #include "gnunet_util_lib.h"
53 
57 #define GNUNET_REVOCATION_VERSION 0x00000001
58 
62 #define GNUNET_REVOCATION_MAX_PROOF_SIZE sizeof(struct GNUNET_REVOCATION_PowP) +\
63  sizeof(struct GNUNET_IDENTITY_PublicKey) +\
64  1024 //FIXME max sig_len
65 
70 #define POW_COUNT 32
71 
72 
74 
79 {
84 
89 
94 
96 };
97 
98 
103 {
108 
113 
115 };
116 
118 
119 
124 
129 
139 typedef void (*GNUNET_REVOCATION_Callback) (void *cls,
141  is_valid);
142 
143 
155  const struct GNUNET_IDENTITY_PublicKey *key,
157 
158 
164 void
166 
167 
172 
173 
188  const struct GNUNET_REVOCATION_PowP *pow,
190 
191 
197 void
199 
200 
211  unsigned int matching_bits,
213 
214 
221 void
223  struct GNUNET_REVOCATION_PowP *pow);
224 
225 
237  int epochs,
238  unsigned int difficulty);
239 
240 
249 
250 
258 void
260 
261 size_t
263 
264 
265 #if 0 /* keep Emacsens' auto-indent happy */
266 {
267 #endif
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif /* GNUNET_REVOCATION_SERVICE_H_ */
273  /* end of group revocation */
275  /* end of group addition */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
static struct GNUNET_TIME_Relative epoch_duration
Epoch length.
static unsigned long long matching_bits
Number of matching bits required for revocation.
static unsigned int epochs
-e option.
Identity service; implements identity management for GNUnet.
#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;.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_PACKED
gcc-ism to get packed structs.
void GNUNET_REVOCATION_pow_stop(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Stop a PoW calculation.
size_t GNUNET_REVOCATION_proof_get_size(const struct GNUNET_REVOCATION_PowP *pow)
struct GNUNET_REVOCATION_Query * GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_IDENTITY_PublicKey *key, GNUNET_REVOCATION_Callback func, void *func_cls)
Check if a key was revoked.
void GNUNET_REVOCATION_pow_init(const struct GNUNET_IDENTITY_PrivateKey *key, struct GNUNET_REVOCATION_PowP *pow)
Initializes a fresh PoW computation.
void GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q)
Cancel key revocation check.
enum GNUNET_GenericReturnValue GNUNET_REVOCATION_pow_round(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Calculate a single round in the key revocation PoW.
void GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h)
Cancel key revocation.
#define POW_COUNT
The proof-of-work narrowing factor.
enum GNUNET_GenericReturnValue GNUNET_REVOCATION_check_pow(const struct GNUNET_REVOCATION_PowP *pow, unsigned int matching_bits, struct GNUNET_TIME_Relative epoch_duration)
Check if the given proof-of-work is valid.
struct GNUNET_REVOCATION_PowCalculationHandle * GNUNET_REVOCATION_pow_start(struct GNUNET_REVOCATION_PowP *pow, int epochs, unsigned int difficulty)
Starts a proof-of-work calculation given the pow object as well as target epochs and difficulty.
struct GNUNET_REVOCATION_Handle * GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_REVOCATION_PowP *pow, GNUNET_REVOCATION_Callback func, void *func_cls)
Perform key revocation.
void(* GNUNET_REVOCATION_Callback)(void *cls, enum GNUNET_GenericReturnValue is_valid)
Callback to call with the result of a key revocation query.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Handle for the key revocation operation.
GNUNET_REVOCATION_Callback func
Function to call once we are done.
void * func_cls
Closure for func.
The handle to a PoW calculation.
unsigned int difficulty
The difficulty (leading zeros) to achieve.
struct GNUNET_REVOCATION_PowP * pow
The final PoW result data structure.
Struct for a proof of work as part of the revocation.
struct GNUNET_TIME_RelativeNBO ttl
The TTL of this revocation (purely informational)
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the revocation.
Handle for the key revocation query.
void * func_cls
Closure for func.
GNUNET_REVOCATION_Callback func
Function to call with the result.
The signature object we use for the PoW.
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
The signature purpose.
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the revocation.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for relative time used by GNUnet, in microseconds and in network byte order.
Time for relative time used by GNUnet, in microseconds.