GNUnet  0.11.x
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 
25 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #if 0 /* keep Emacsens' auto-indent happy */
44 }
45 #endif
46 #endif
47 
48 #include "gnunet_util_lib.h"
49 
53 #define GNUNET_REVOCATION_VERSION 0x00000001
54 
58 #define GNUNET_REVOCATION_MAX_PROOF_SIZE sizeof(struct GNUNET_REVOCATION_PowP) +\
59  sizeof(struct GNUNET_IDENTITY_PublicKey) +\
60  1024 //FIXME max sig_len
61 
66 #define POW_COUNT 32
67 
68 
70 
75 {
80 
85 
90 
92 };
93 
94 
99 {
104 
109 
111 };
112 
114 
115 
120 
125 
135 typedef void (*GNUNET_REVOCATION_Callback) (void *cls,
137  is_valid);
138 
139 
151  const struct GNUNET_IDENTITY_PublicKey *key,
153 
154 
160 void
162 
163 
168 
169 
184  const struct GNUNET_REVOCATION_PowP *pow,
186 
187 
193 void
195 
196 
207  unsigned int matching_bits,
209 
210 
217 void
219  struct GNUNET_REVOCATION_PowP *pow);
220 
221 
233  int epochs,
234  unsigned int difficulty);
235 
236 
245 
246 
254 void
256 
257 size_t
259 
260 
261 #if 0 /* keep Emacsens' auto-indent happy */
262 {
263 #endif
264 #ifdef __cplusplus
265 }
266 #endif
267 
268 #endif /* GNUNET_REVOCATION_SERVICE_H_ */
269  /* end of group revocation */
static unsigned int epochs
-e option.
void GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q)
Cancel key revocation check.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
enum GNUNET_GenericReturnValue GNUNET_REVOCATION_pow_round(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Calculate a single round in the key revocation PoW.
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
#define POW_COUNT
The proof-of-work narrowing factor.
Struct for a proof of work as part of the revocation.
A private key for an identity as per LSD0001.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:83
The signature object we use for the PoW.
Time for relative time used by GNUnet, in microseconds and in network byte order. ...
Time for absolute time used by GNUnet, in microseconds and in network byte order. ...
void GNUNET_REVOCATION_pow_stop(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Stop a PoW calculation.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_TIME_Relative epoch_duration
Epoch length.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
void * func_cls
Closure for func.
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.
unsigned int difficulty
The difficulty (leading zeros) to achieve.
void * func_cls
Closure for func.
uint64_t pow[32]
The PoWs.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
struct GNUNET_HashCode key
The key used in the DHT.
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...
Handle for the key revocation query.
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the revocation.
size_t GNUNET_REVOCATION_proof_get_size(const struct GNUNET_REVOCATION_PowP *pow)
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.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
An identity key as per LSD0001.
#define GNUNET_PACKED
gcc-ism to get packed structs.
configuration data
Definition: configuration.c:84
Handle for the key revocation operation.
GNUNET_REVOCATION_Callback func
Function to call with the result.
GNUNET_REVOCATION_Callback func
Function to call once we are done.
The handle to a PoW calculation.
void GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h)
Cancel key revocation.
void GNUNET_REVOCATION_pow_init(const struct GNUNET_IDENTITY_PrivateKey *key, struct GNUNET_REVOCATION_PowP *pow)
Initializes a fresh PoW computation.
static unsigned long long matching_bits
Number of matching bits required for revocation.
struct GNUNET_TIME_RelativeNBO ttl
The TTL of this revocation (purely informational)
Time for relative time used by GNUnet, in microseconds.
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.