diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-14 19:47:32 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:18 +0200 |
commit | 96c802b46be51e5c45f34e2de823f787d26c2929 (patch) | |
tree | 457ccfd8f9a61563af86318739c4a8f964a57025 /src/include | |
parent | c14e3a2769ff0f15fdbb32797e37e43ce2344fa3 (diff) | |
download | gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.tar.gz gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.zip |
- towards crypto agility; wip
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_gns_service.h | 5 | ||||
-rw-r--r-- | src/include/gnunet_gnsrecord_lib.h | 24 | ||||
-rw-r--r-- | src/include/gnunet_identity_service.h | 107 | ||||
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 12 | ||||
-rw-r--r-- | src/include/gnunet_namestore_service.h | 15 | ||||
-rw-r--r-- | src/include/gnunet_revocation_service.h | 18 |
6 files changed, 143 insertions, 38 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index ef81e9a88..3f6c9b9aa 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include "gnunet_util_lib.h" | 37 | #include "gnunet_util_lib.h" |
38 | #include "gnunet_dnsparser_lib.h" | 38 | #include "gnunet_dnsparser_lib.h" |
39 | #include "gnunet_identity_service.h" | ||
39 | #include "gnunet_namestore_service.h" | 40 | #include "gnunet_namestore_service.h" |
40 | 41 | ||
41 | #ifdef __cplusplus | 42 | #ifdef __cplusplus |
@@ -139,7 +140,7 @@ enum GNUNET_GNS_LocalOptions | |||
139 | struct GNUNET_GNS_LookupRequest * | 140 | struct GNUNET_GNS_LookupRequest * |
140 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 141 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
141 | const char *name, | 142 | const char *name, |
142 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, | 143 | const struct GNUNET_IDENTITY_PublicKey *zone, |
143 | uint32_t type, | 144 | uint32_t type, |
144 | enum GNUNET_GNS_LocalOptions options, | 145 | enum GNUNET_GNS_LocalOptions options, |
145 | GNUNET_GNS_LookupResultProcessor proc, | 146 | GNUNET_GNS_LookupResultProcessor proc, |
@@ -163,7 +164,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | |||
163 | struct GNUNET_GNS_LookupRequest * | 164 | struct GNUNET_GNS_LookupRequest * |
164 | GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle, | 165 | GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle, |
165 | const char *name, | 166 | const char *name, |
166 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, | 167 | const struct GNUNET_IDENTITY_PublicKey *zone, |
167 | uint32_t type, | 168 | uint32_t type, |
168 | enum GNUNET_GNS_LocalOptions options, | 169 | enum GNUNET_GNS_LocalOptions options, |
169 | uint16_t recursion_depth_limit, | 170 | uint16_t recursion_depth_limit, |
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index 960203fb1..6124b2925 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #ifndef GNUNET_GNSRECORD_LIB_H | 34 | #ifndef GNUNET_GNSRECORD_LIB_H |
35 | #define GNUNET_GNSRECORD_LIB_H | 35 | #define GNUNET_GNSRECORD_LIB_H |
36 | 36 | ||
37 | #include "gnunet_identity_service.h" | ||
38 | |||
37 | #ifdef __cplusplus | 39 | #ifdef __cplusplus |
38 | extern "C" { | 40 | extern "C" { |
39 | #if 0 /* keep Emacsens' auto-indent happy */ | 41 | #if 0 /* keep Emacsens' auto-indent happy */ |
@@ -55,7 +57,7 @@ extern "C" { | |||
55 | /** | 57 | /** |
56 | * Record type for GNS zone transfer ("PKEY"). | 58 | * Record type for GNS zone transfer ("PKEY"). |
57 | */ | 59 | */ |
58 | #define GNUNET_GNSRECORD_TYPE_PKEY 65536 | 60 | #define GNUNET_GNSRECORD_TYPE_PKEY GNUNET_IDENTITY_TYPE_ECDSA |
59 | 61 | ||
60 | /** | 62 | /** |
61 | * Record type for GNS nick names ("NICK"). | 63 | * Record type for GNS nick names ("NICK"). |
@@ -275,7 +277,7 @@ struct GNUNET_GNSRECORD_Block | |||
275 | /** | 277 | /** |
276 | * Derived key used for signing; hash of this is the query. | 278 | * Derived key used for signing; hash of this is the query. |
277 | */ | 279 | */ |
278 | struct GNUNET_CRYPTO_EcdsaPublicKey derived_key; | 280 | struct GNUNET_IDENTITY_PublicKey derived_key; |
279 | 281 | ||
280 | /** | 282 | /** |
281 | * Number of bytes signed; also specifies the number of bytes | 283 | * Number of bytes signed; also specifies the number of bytes |
@@ -335,7 +337,7 @@ struct GNUNET_GNSRECORD_ReverseRecord | |||
335 | /** | 337 | /** |
336 | * The public key of the namespace the is delegating to our namespace | 338 | * The public key of the namespace the is delegating to our namespace |
337 | */ | 339 | */ |
338 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 340 | struct GNUNET_IDENTITY_PublicKey pkey; |
339 | 341 | ||
340 | /** | 342 | /** |
341 | * The expiration time of the delegation | 343 | * The expiration time of the delegation |
@@ -488,7 +490,7 @@ GNUNET_GNSRECORD_string_to_lowercase (const char *src); | |||
488 | * #GNUNET_GNSRECORD_z2s. | 490 | * #GNUNET_GNSRECORD_z2s. |
489 | */ | 491 | */ |
490 | const char * | 492 | const char * |
491 | GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | 493 | GNUNET_GNSRECORD_z2s (const struct GNUNET_IDENTITY_PublicKey *z); |
492 | 494 | ||
493 | 495 | ||
494 | /** | 496 | /** |
@@ -502,7 +504,7 @@ GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | |||
502 | * key in an encoding suitable for DNS labels. | 504 | * key in an encoding suitable for DNS labels. |
503 | */ | 505 | */ |
504 | const char * | 506 | const char * |
505 | GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 507 | GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_IDENTITY_PublicKey *pkey); |
506 | 508 | ||
507 | 509 | ||
508 | /** | 510 | /** |
@@ -516,7 +518,7 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | |||
516 | */ | 518 | */ |
517 | int | 519 | int |
518 | GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | 520 | GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, |
519 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 521 | struct GNUNET_IDENTITY_PublicKey *pkey); |
520 | 522 | ||
521 | 523 | ||
522 | /** | 524 | /** |
@@ -528,7 +530,7 @@ GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | |||
528 | */ | 530 | */ |
529 | void | 531 | void |
530 | GNUNET_GNSRECORD_query_from_private_key ( | 532 | GNUNET_GNSRECORD_query_from_private_key ( |
531 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, | 533 | const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, |
532 | struct GNUNET_HashCode *query); | 534 | struct GNUNET_HashCode *query); |
533 | 535 | ||
534 | 536 | ||
@@ -541,7 +543,7 @@ GNUNET_GNSRECORD_query_from_private_key ( | |||
541 | */ | 543 | */ |
542 | void | 544 | void |
543 | GNUNET_GNSRECORD_query_from_public_key ( | 545 | GNUNET_GNSRECORD_query_from_public_key ( |
544 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, | 546 | const struct GNUNET_IDENTITY_PublicKey *pub, const char *label, |
545 | struct GNUNET_HashCode *query); | 547 | struct GNUNET_HashCode *query); |
546 | 548 | ||
547 | 549 | ||
@@ -555,7 +557,7 @@ GNUNET_GNSRECORD_query_from_public_key ( | |||
555 | * @param rd_count number of records in @a rd | 557 | * @param rd_count number of records in @a rd |
556 | */ | 558 | */ |
557 | struct GNUNET_GNSRECORD_Block * | 559 | struct GNUNET_GNSRECORD_Block * |
558 | GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 560 | GNUNET_GNSRECORD_block_create (const struct GNUNET_IDENTITY_PrivateKey *key, |
559 | struct GNUNET_TIME_Absolute expire, | 561 | struct GNUNET_TIME_Absolute expire, |
560 | const char *label, | 562 | const char *label, |
561 | const struct GNUNET_GNSRECORD_Data *rd, | 563 | const struct GNUNET_GNSRECORD_Data *rd, |
@@ -574,7 +576,7 @@ GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
574 | * @param rd_count number of records in @a rd | 576 | * @param rd_count number of records in @a rd |
575 | */ | 577 | */ |
576 | struct GNUNET_GNSRECORD_Block * | 578 | struct GNUNET_GNSRECORD_Block * |
577 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 579 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_IDENTITY_PrivateKey *key, |
578 | struct GNUNET_TIME_Absolute expire, | 580 | struct GNUNET_TIME_Absolute expire, |
579 | const char *label, | 581 | const char *label, |
580 | const struct GNUNET_GNSRECORD_Data *rd, | 582 | const struct GNUNET_GNSRECORD_Data *rd, |
@@ -606,7 +608,7 @@ GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); | |||
606 | int | 608 | int |
607 | GNUNET_GNSRECORD_block_decrypt ( | 609 | GNUNET_GNSRECORD_block_decrypt ( |
608 | const struct GNUNET_GNSRECORD_Block *block, | 610 | const struct GNUNET_GNSRECORD_Block *block, |
609 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, | 611 | const struct GNUNET_IDENTITY_PublicKey *zone_key, const char *label, |
610 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); | 612 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); |
611 | 613 | ||
612 | 614 | ||
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 94127248e..c72e6d146 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h | |||
@@ -57,6 +57,21 @@ extern "C" { | |||
57 | */ | 57 | */ |
58 | #define GNUNET_IDENTITY_VERSION 0x00000100 | 58 | #define GNUNET_IDENTITY_VERSION 0x00000100 |
59 | 59 | ||
60 | enum GNUNET_IDENTITY_KeyType | ||
61 | { | ||
62 | /** | ||
63 | * The identity type. The value is the same as the | ||
64 | * PKEY record type. | ||
65 | */ | ||
66 | GNUNET_IDENTITY_TYPE_ECDSA = 65536, | ||
67 | |||
68 | /** | ||
69 | * EDDSA identity. The value is the same as the EDKEY | ||
70 | * record type. | ||
71 | */ | ||
72 | GNUNET_IDENTITY_TYPE_EDDSA = 65599 // FIXME | ||
73 | }; | ||
74 | |||
60 | /** | 75 | /** |
61 | * Handle to access the identity service. | 76 | * Handle to access the identity service. |
62 | */ | 77 | */ |
@@ -67,6 +82,61 @@ struct GNUNET_IDENTITY_Handle; | |||
67 | */ | 82 | */ |
68 | struct GNUNET_IDENTITY_Ego; | 83 | struct GNUNET_IDENTITY_Ego; |
69 | 84 | ||
85 | |||
86 | /** | ||
87 | * A private key for an identity as per LSD0001. | ||
88 | */ | ||
89 | struct GNUNET_IDENTITY_PrivateKey | ||
90 | { | ||
91 | /** | ||
92 | * Type of public key. | ||
93 | * Defined by the GNS zone type value. | ||
94 | * In NBO. | ||
95 | */ | ||
96 | uint32_t type; | ||
97 | |||
98 | union | ||
99 | { | ||
100 | /** | ||
101 | * An ECDSA identity key. | ||
102 | */ | ||
103 | struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_key; | ||
104 | |||
105 | /** | ||
106 | * AN EdDSA identtiy key | ||
107 | */ | ||
108 | struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_key; | ||
109 | }; | ||
110 | }; | ||
111 | |||
112 | |||
113 | /** | ||
114 | * An identity key as per LSD0001. | ||
115 | */ | ||
116 | struct GNUNET_IDENTITY_PublicKey | ||
117 | { | ||
118 | /** | ||
119 | * Type of public key. | ||
120 | * Defined by the GNS zone type value. | ||
121 | * In NBO. | ||
122 | */ | ||
123 | uint32_t type; | ||
124 | |||
125 | union | ||
126 | { | ||
127 | /** | ||
128 | * An ECDSA identity key. | ||
129 | */ | ||
130 | struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_key; | ||
131 | |||
132 | /** | ||
133 | * AN EdDSA identtiy key | ||
134 | */ | ||
135 | struct GNUNET_CRYPTO_EddsaPublicKey eddsa_key; | ||
136 | }; | ||
137 | }; | ||
138 | |||
139 | |||
70 | /** | 140 | /** |
71 | * Handle for an operation with the identity service. | 141 | * Handle for an operation with the identity service. |
72 | */ | 142 | */ |
@@ -79,7 +149,7 @@ struct GNUNET_IDENTITY_Operation; | |||
79 | * @param ego the ego | 149 | * @param ego the ego |
80 | * @return associated ECC key, valid as long as the ego is valid | 150 | * @return associated ECC key, valid as long as the ego is valid |
81 | */ | 151 | */ |
82 | const struct GNUNET_CRYPTO_EcdsaPrivateKey * | 152 | const struct GNUNET_IDENTITY_PrivateKey * |
83 | GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego); | 153 | GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego); |
84 | 154 | ||
85 | 155 | ||
@@ -100,7 +170,7 @@ GNUNET_IDENTITY_ego_get_anonymous (void); | |||
100 | */ | 170 | */ |
101 | void | 171 | void |
102 | GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego, | 172 | GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego, |
103 | struct GNUNET_CRYPTO_EcdsaPublicKey *pk); | 173 | struct GNUNET_IDENTITY_PublicKey *pk); |
104 | 174 | ||
105 | 175 | ||
106 | /** | 176 | /** |
@@ -224,7 +294,7 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h); | |||
224 | typedef void | 294 | typedef void |
225 | (*GNUNET_IDENTITY_CreateContinuation) ( | 295 | (*GNUNET_IDENTITY_CreateContinuation) ( |
226 | void *cls, | 296 | void *cls, |
227 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, | 297 | const struct GNUNET_IDENTITY_PrivateKey *pk, |
228 | const char *emsg); | 298 | const char *emsg); |
229 | 299 | ||
230 | 300 | ||
@@ -234,6 +304,7 @@ typedef void | |||
234 | * @param id identity service to use | 304 | * @param id identity service to use |
235 | * @param name desired name | 305 | * @param name desired name |
236 | * @param privkey desired private key or NULL to create one | 306 | * @param privkey desired private key or NULL to create one |
307 | * @param ktype the type of key to create. Ignored if privkey != NULL. | ||
237 | * @param cont function to call with the result (will only be called once) | 308 | * @param cont function to call with the result (will only be called once) |
238 | * @param cont_cls closure for @a cont | 309 | * @param cont_cls closure for @a cont |
239 | * @return handle to abort the operation | 310 | * @return handle to abort the operation |
@@ -241,7 +312,8 @@ typedef void | |||
241 | struct GNUNET_IDENTITY_Operation * | 312 | struct GNUNET_IDENTITY_Operation * |
242 | GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | 313 | GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, |
243 | const char *name, | 314 | const char *name, |
244 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey, | 315 | const struct GNUNET_IDENTITY_PrivateKey *privkey, |
316 | enum GNUNET_IDENTITY_KeyType ktype, | ||
245 | GNUNET_IDENTITY_CreateContinuation cont, | 317 | GNUNET_IDENTITY_CreateContinuation cont, |
246 | void *cont_cls); | 318 | void *cont_cls); |
247 | 319 | ||
@@ -291,6 +363,31 @@ GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, | |||
291 | void | 363 | void |
292 | GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op); | 364 | GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op); |
293 | 365 | ||
366 | ssize_t | ||
367 | GNUNET_IDENTITY_key_get_length (const struct GNUNET_IDENTITY_PublicKey *key); | ||
368 | |||
369 | char * | ||
370 | GNUNET_IDENTITY_public_key_to_string (const struct | ||
371 | GNUNET_IDENTITY_PublicKey *key); | ||
372 | |||
373 | |||
374 | char * | ||
375 | GNUNET_IDENTITY_private_key_to_string (const struct | ||
376 | GNUNET_IDENTITY_PrivateKey *key); | ||
377 | |||
378 | |||
379 | enum GNUNET_GenericReturnValue | ||
380 | GNUNET_IDENTITY_public_key_from_string (const char*str, | ||
381 | struct GNUNET_IDENTITY_PublicKey *key); | ||
382 | |||
383 | enum GNUNET_GenericReturnValue | ||
384 | GNUNET_IDENTITY_private_key_from_string (const char*str, | ||
385 | struct GNUNET_IDENTITY_PrivateKey *key); | ||
386 | |||
387 | enum GNUNET_GenericReturnValue | ||
388 | GNUNET_IDENTITY_key_get_public (const struct GNUNET_IDENTITY_PrivateKey *privkey, | ||
389 | struct GNUNET_IDENTITY_PublicKey *key); | ||
390 | |||
294 | 391 | ||
295 | /* ************* convenience API to lookup an ego ***************** */ | 392 | /* ************* convenience API to lookup an ego ***************** */ |
296 | 393 | ||
@@ -344,7 +441,7 @@ GNUNET_IDENTITY_ego_lookup_cancel (struct GNUNET_IDENTITY_EgoLookup *el); | |||
344 | typedef void | 441 | typedef void |
345 | (*GNUNET_IDENTITY_EgoSuffixCallback) ( | 442 | (*GNUNET_IDENTITY_EgoSuffixCallback) ( |
346 | void *cls, | 443 | void *cls, |
347 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | 444 | const struct GNUNET_IDENTITY_PrivateKey *priv, |
348 | const char *ego_name); | 445 | const char *ego_name); |
349 | 446 | ||
350 | 447 | ||
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 443c9e451..9cc8abc6e 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -58,7 +58,7 @@ typedef void | |||
58 | (*GNUNET_NAMESTORE_RecordIterator) (void *cls, | 58 | (*GNUNET_NAMESTORE_RecordIterator) (void *cls, |
59 | uint64_t serial, | 59 | uint64_t serial, |
60 | const struct | 60 | const struct |
61 | GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 61 | GNUNET_IDENTITY_PrivateKey *private_key, |
62 | const char *label, | 62 | const char *label, |
63 | unsigned int rd_count, | 63 | unsigned int rd_count, |
64 | const struct GNUNET_GNSRECORD_Data *rd); | 64 | const struct GNUNET_GNSRECORD_Data *rd); |
@@ -87,7 +87,7 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
87 | */ | 87 | */ |
88 | int | 88 | int |
89 | (*store_records) (void *cls, | 89 | (*store_records) (void *cls, |
90 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 90 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
91 | const char *label, | 91 | const char *label, |
92 | unsigned int rd_count, | 92 | unsigned int rd_count, |
93 | const struct GNUNET_GNSRECORD_Data *rd); | 93 | const struct GNUNET_GNSRECORD_Data *rd); |
@@ -104,7 +104,7 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
104 | */ | 104 | */ |
105 | int | 105 | int |
106 | (*lookup_records) (void *cls, | 106 | (*lookup_records) (void *cls, |
107 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 107 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
108 | const char *label, | 108 | const char *label, |
109 | GNUNET_NAMESTORE_RecordIterator iter, | 109 | GNUNET_NAMESTORE_RecordIterator iter, |
110 | void *iter_cls); | 110 | void *iter_cls); |
@@ -126,7 +126,7 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
126 | */ | 126 | */ |
127 | int | 127 | int |
128 | (*iterate_records) (void *cls, | 128 | (*iterate_records) (void *cls, |
129 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 129 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
130 | uint64_t serial, | 130 | uint64_t serial, |
131 | uint64_t limit, | 131 | uint64_t limit, |
132 | GNUNET_NAMESTORE_RecordIterator iter, | 132 | GNUNET_NAMESTORE_RecordIterator iter, |
@@ -146,8 +146,8 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
146 | */ | 146 | */ |
147 | int | 147 | int |
148 | (*zone_to_name) (void *cls, | 148 | (*zone_to_name) (void *cls, |
149 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 149 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
150 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 150 | const struct GNUNET_IDENTITY_PublicKey *value_zone, |
151 | GNUNET_NAMESTORE_RecordIterator iter, | 151 | GNUNET_NAMESTORE_RecordIterator iter, |
152 | void *iter_cls); | 152 | void *iter_cls); |
153 | }; | 153 | }; |
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index bf42c8d34..ca4d2cb52 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #include "gnunet_util_lib.h" | 41 | #include "gnunet_util_lib.h" |
42 | #include "gnunet_block_lib.h" | 42 | #include "gnunet_block_lib.h" |
43 | #include "gnunet_gnsrecord_lib.h" | 43 | #include "gnunet_gnsrecord_lib.h" |
44 | #include "gnunet_identity_service.h" | ||
44 | 45 | ||
45 | #ifdef __cplusplus | 46 | #ifdef __cplusplus |
46 | extern "C" | 47 | extern "C" |
@@ -127,7 +128,7 @@ typedef void | |||
127 | struct GNUNET_NAMESTORE_QueueEntry * | 128 | struct GNUNET_NAMESTORE_QueueEntry * |
128 | GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | 129 | GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, |
129 | const struct | 130 | const struct |
130 | GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 131 | GNUNET_IDENTITY_PrivateKey *pkey, |
131 | const char *label, | 132 | const char *label, |
132 | unsigned int rd_count, | 133 | unsigned int rd_count, |
133 | const struct GNUNET_GNSRECORD_Data *rd, | 134 | const struct GNUNET_GNSRECORD_Data *rd, |
@@ -147,7 +148,7 @@ GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | |||
147 | typedef void | 148 | typedef void |
148 | (*GNUNET_NAMESTORE_RecordMonitor) (void *cls, | 149 | (*GNUNET_NAMESTORE_RecordMonitor) (void *cls, |
149 | const struct | 150 | const struct |
150 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 151 | GNUNET_IDENTITY_PrivateKey *zone, |
151 | const char *label, | 152 | const char *label, |
152 | unsigned int rd_count, | 153 | unsigned int rd_count, |
153 | const struct GNUNET_GNSRECORD_Data *rd); | 154 | const struct GNUNET_GNSRECORD_Data *rd); |
@@ -170,7 +171,7 @@ typedef void | |||
170 | struct GNUNET_NAMESTORE_QueueEntry * | 171 | struct GNUNET_NAMESTORE_QueueEntry * |
171 | GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h, | 172 | GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h, |
172 | const struct | 173 | const struct |
173 | GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 174 | GNUNET_IDENTITY_PrivateKey *pkey, |
174 | const char *label, | 175 | const char *label, |
175 | GNUNET_SCHEDULER_TaskCallback error_cb, | 176 | GNUNET_SCHEDULER_TaskCallback error_cb, |
176 | void *error_cb_cls, | 177 | void *error_cb_cls, |
@@ -197,9 +198,9 @@ GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h, | |||
197 | */ | 198 | */ |
198 | struct GNUNET_NAMESTORE_QueueEntry * | 199 | struct GNUNET_NAMESTORE_QueueEntry * |
199 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | 200 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, |
200 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 201 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
201 | const struct | 202 | const struct |
202 | GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 203 | GNUNET_IDENTITY_PublicKey *value_zone, |
203 | GNUNET_SCHEDULER_TaskCallback error_cb, | 204 | GNUNET_SCHEDULER_TaskCallback error_cb, |
204 | void *error_cb_cls, | 205 | void *error_cb_cls, |
205 | GNUNET_NAMESTORE_RecordMonitor proc, | 206 | GNUNET_NAMESTORE_RecordMonitor proc, |
@@ -246,7 +247,7 @@ GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); | |||
246 | struct GNUNET_NAMESTORE_ZoneIterator * | 247 | struct GNUNET_NAMESTORE_ZoneIterator * |
247 | GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | 248 | GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, |
248 | const struct | 249 | const struct |
249 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 250 | GNUNET_IDENTITY_PrivateKey *zone, |
250 | GNUNET_SCHEDULER_TaskCallback error_cb, | 251 | GNUNET_SCHEDULER_TaskCallback error_cb, |
251 | void *error_cb_cls, | 252 | void *error_cb_cls, |
252 | GNUNET_NAMESTORE_RecordMonitor proc, | 253 | GNUNET_NAMESTORE_RecordMonitor proc, |
@@ -316,7 +317,7 @@ struct GNUNET_NAMESTORE_ZoneMonitor * | |||
316 | GNUNET_NAMESTORE_zone_monitor_start (const struct | 317 | GNUNET_NAMESTORE_zone_monitor_start (const struct |
317 | GNUNET_CONFIGURATION_Handle *cfg, | 318 | GNUNET_CONFIGURATION_Handle *cfg, |
318 | const struct | 319 | const struct |
319 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 320 | GNUNET_IDENTITY_PrivateKey *zone, |
320 | int iterate_first, | 321 | int iterate_first, |
321 | GNUNET_SCHEDULER_TaskCallback error_cb, | 322 | GNUNET_SCHEDULER_TaskCallback error_cb, |
322 | void *error_cb_cls, | 323 | void *error_cb_cls, |
diff --git a/src/include/gnunet_revocation_service.h b/src/include/gnunet_revocation_service.h index 105bb1149..479cc61d7 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 | * |
@@ -80,14 +82,16 @@ struct GNUNET_REVOCATION_PowP | |||
80 | uint64_t pow[POW_COUNT] GNUNET_PACKED; | 82 | uint64_t pow[POW_COUNT] GNUNET_PACKED; |
81 | 83 | ||
82 | /** | 84 | /** |
83 | * The signature | 85 | * The revoked public key |
84 | */ | 86 | */ |
85 | struct GNUNET_CRYPTO_EcdsaSignature signature; | 87 | struct GNUNET_IDENTITY_PublicKey key; |
86 | 88 | ||
87 | /** | 89 | /** |
88 | * The revoked public key | 90 | * Length of the signature |
89 | */ | 91 | */ |
90 | struct GNUNET_CRYPTO_EcdsaPublicKey key; | 92 | uint32_t sig_len; |
93 | |||
94 | /** followed by a signature **/ | ||
91 | }; | 95 | }; |
92 | 96 | ||
93 | 97 | ||
@@ -104,7 +108,7 @@ struct GNUNET_REVOCATION_SignaturePurposePS | |||
104 | /** | 108 | /** |
105 | * The revoked public key | 109 | * The revoked public key |
106 | */ | 110 | */ |
107 | struct GNUNET_CRYPTO_EcdsaPublicKey key; | 111 | struct GNUNET_IDENTITY_PublicKey key; |
108 | 112 | ||
109 | /** | 113 | /** |
110 | * The timestamp of the revocation | 114 | * The timestamp of the revocation |
@@ -150,7 +154,7 @@ typedef void (*GNUNET_REVOCATION_Callback) (void *cls, | |||
150 | */ | 154 | */ |
151 | struct GNUNET_REVOCATION_Query * | 155 | struct GNUNET_REVOCATION_Query * |
152 | GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, | 156 | GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, |
153 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 157 | const struct GNUNET_IDENTITY_PublicKey *key, |
154 | GNUNET_REVOCATION_Callback func, void *func_cls); | 158 | GNUNET_REVOCATION_Callback func, void *func_cls); |
155 | 159 | ||
156 | 160 | ||
@@ -217,7 +221,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, | |||
217 | * @param pow the pow object to work with in the calculation. | 221 | * @param pow the pow object to work with in the calculation. |
218 | */ | 222 | */ |
219 | void | 223 | void |
220 | GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 224 | GNUNET_REVOCATION_pow_init (const struct GNUNET_IDENTITY_PrivateKey *key, |
221 | struct GNUNET_REVOCATION_PowP *pow); | 225 | struct GNUNET_REVOCATION_PowP *pow); |
222 | 226 | ||
223 | 227 | ||