diff options
Diffstat (limited to 'src/include/gnunet_revocation_service.h')
-rw-r--r-- | src/include/gnunet_revocation_service.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/include/gnunet_revocation_service.h b/src/include/gnunet_revocation_service.h index 105bb1149..18c1f2674 100644 --- a/src/include/gnunet_revocation_service.h +++ b/src/include/gnunet_revocation_service.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #ifndef GNUNET_REVOCATION_SERVICE_H_ | 21 | #ifndef GNUNET_REVOCATION_SERVICE_H_ |
22 | #define GNUNET_REVOCATION_SERVICE_H_ | 22 | #define GNUNET_REVOCATION_SERVICE_H_ |
23 | 23 | ||
24 | #include "gnunet_identity_service.h" | ||
25 | |||
24 | /** | 26 | /** |
25 | * @author Christian Grothoff | 27 | * @author Christian Grothoff |
26 | * | 28 | * |
@@ -51,6 +53,13 @@ extern "C" | |||
51 | #define GNUNET_REVOCATION_VERSION 0x00000001 | 53 | #define GNUNET_REVOCATION_VERSION 0x00000001 |
52 | 54 | ||
53 | /** | 55 | /** |
56 | * Maximum length of a revocation | ||
57 | */ | ||
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 | |||
62 | /** | ||
54 | * The proof-of-work narrowing factor. | 63 | * The proof-of-work narrowing factor. |
55 | * The number of PoWs that are calculates as part of revocation. | 64 | * The number of PoWs that are calculates as part of revocation. |
56 | */ | 65 | */ |
@@ -79,22 +88,14 @@ struct GNUNET_REVOCATION_PowP | |||
79 | */ | 88 | */ |
80 | uint64_t pow[POW_COUNT] GNUNET_PACKED; | 89 | uint64_t pow[POW_COUNT] GNUNET_PACKED; |
81 | 90 | ||
82 | /** | 91 | /** followed by the public key type, the key and a signature **/ |
83 | * The signature | ||
84 | */ | ||
85 | struct GNUNET_CRYPTO_EcdsaSignature signature; | ||
86 | |||
87 | /** | ||
88 | * The revoked public key | ||
89 | */ | ||
90 | struct GNUNET_CRYPTO_EcdsaPublicKey key; | ||
91 | }; | 92 | }; |
92 | 93 | ||
93 | 94 | ||
94 | /** | 95 | /** |
95 | * The signature object we use for the PoW | 96 | * The signature object we use for the PoW |
96 | */ | 97 | */ |
97 | struct GNUNET_REVOCATION_SignaturePurposePS | 98 | struct GNUNET_REVOCATION_EcdsaSignaturePurposePS |
98 | { | 99 | { |
99 | /** | 100 | /** |
100 | * The signature purpose | 101 | * The signature purpose |
@@ -102,6 +103,11 @@ struct GNUNET_REVOCATION_SignaturePurposePS | |||
102 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 103 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
103 | 104 | ||
104 | /** | 105 | /** |
106 | * Type of the key | ||
107 | */ | ||
108 | uint32_t ktype; | ||
109 | |||
110 | /** | ||
105 | * The revoked public key | 111 | * The revoked public key |
106 | */ | 112 | */ |
107 | struct GNUNET_CRYPTO_EcdsaPublicKey key; | 113 | struct GNUNET_CRYPTO_EcdsaPublicKey key; |
@@ -150,7 +156,7 @@ typedef void (*GNUNET_REVOCATION_Callback) (void *cls, | |||
150 | */ | 156 | */ |
151 | struct GNUNET_REVOCATION_Query * | 157 | struct GNUNET_REVOCATION_Query * |
152 | GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, | 158 | GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, |
153 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 159 | const struct GNUNET_IDENTITY_PublicKey *key, |
154 | GNUNET_REVOCATION_Callback func, void *func_cls); | 160 | GNUNET_REVOCATION_Callback func, void *func_cls); |
155 | 161 | ||
156 | 162 | ||
@@ -217,7 +223,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, | |||
217 | * @param pow the pow object to work with in the calculation. | 223 | * @param pow the pow object to work with in the calculation. |
218 | */ | 224 | */ |
219 | void | 225 | void |
220 | GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 226 | GNUNET_REVOCATION_pow_init (const struct GNUNET_IDENTITY_PrivateKey *key, |
221 | struct GNUNET_REVOCATION_PowP *pow); | 227 | struct GNUNET_REVOCATION_PowP *pow); |
222 | 228 | ||
223 | 229 | ||
@@ -256,6 +262,10 @@ GNUNET_REVOCATION_pow_round (struct GNUNET_REVOCATION_PowCalculationHandle *pc); | |||
256 | void | 262 | void |
257 | GNUNET_REVOCATION_pow_stop (struct GNUNET_REVOCATION_PowCalculationHandle *pc); | 263 | GNUNET_REVOCATION_pow_stop (struct GNUNET_REVOCATION_PowCalculationHandle *pc); |
258 | 264 | ||
265 | size_t | ||
266 | GNUNET_REVOCATION_proof_get_size (const struct GNUNET_REVOCATION_PowP *pow); | ||
267 | |||
268 | |||
259 | #if 0 /* keep Emacsens' auto-indent happy */ | 269 | #if 0 /* keep Emacsens' auto-indent happy */ |
260 | { | 270 | { |
261 | #endif | 271 | #endif |