diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-14 22:31:38 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:19 +0200 |
commit | 25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a (patch) | |
tree | 97ba1f700217697979449cec7528b4eab5e22a22 /src/include | |
parent | 96c802b46be51e5c45f34e2de823f787d26c2929 (diff) | |
download | gnunet-25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a.tar.gz gnunet-25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a.zip |
- better wire format for rrblocks
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_gnsrecord_lib.h | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index 6124b2925..20d8e2517 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -263,21 +263,20 @@ struct GNUNET_GNSRECORD_PlaceData | |||
263 | /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */ | 263 | /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */ |
264 | }; | 264 | }; |
265 | 265 | ||
266 | |||
267 | /** | 266 | /** |
268 | * Information we have in an encrypted block with record data (i.e. in the DHT). | 267 | * Information we have in an encrypted block with record data (i.e. in the DHT). |
269 | */ | 268 | */ |
270 | struct GNUNET_GNSRECORD_Block | 269 | struct GNUNET_GNSRECORD_EcdsaBlock |
271 | { | 270 | { |
272 | /** | 271 | /** |
273 | * Signature of the block. | 272 | * Derived key used for signing; hash of this is the query. |
274 | */ | 273 | */ |
275 | struct GNUNET_CRYPTO_EcdsaSignature signature; | 274 | struct GNUNET_CRYPTO_EcdsaPublicKey derived_key; |
276 | 275 | ||
277 | /** | 276 | /** |
278 | * Derived key used for signing; hash of this is the query. | 277 | * Signature of the block. |
279 | */ | 278 | */ |
280 | struct GNUNET_IDENTITY_PublicKey derived_key; | 279 | struct GNUNET_CRYPTO_EcdsaSignature signature; |
281 | 280 | ||
282 | /** | 281 | /** |
283 | * Number of bytes signed; also specifies the number of bytes | 282 | * Number of bytes signed; also specifies the number of bytes |
@@ -293,6 +292,17 @@ struct GNUNET_GNSRECORD_Block | |||
293 | /* followed by encrypted data */ | 292 | /* followed by encrypted data */ |
294 | }; | 293 | }; |
295 | 294 | ||
295 | struct GNUNET_GNSRECORD_Block | ||
296 | { | ||
297 | uint32_t type; | ||
298 | |||
299 | union | ||
300 | { | ||
301 | struct GNUNET_GNSRECORD_EcdsaBlock ecdsa_block; | ||
302 | //struct GNUNET_GNSRECORD_EddsaBlock eddsa_block; | ||
303 | }; | ||
304 | }; | ||
305 | |||
296 | 306 | ||
297 | /** | 307 | /** |
298 | * Record type used to box up SRV and TLSA records. For example, a | 308 | * Record type used to box up SRV and TLSA records. For example, a |
@@ -638,6 +648,31 @@ GNUNET_GNSRECORD_record_get_expiration_time ( | |||
638 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); | 648 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); |
639 | 649 | ||
640 | 650 | ||
651 | /** | ||
652 | * Returns the length of this block in bytes. | ||
653 | * Block length strongly depends on the zone type. | ||
654 | * | ||
655 | * @param block the block. | ||
656 | * @return the length of this block in bytes | ||
657 | */ | ||
658 | size_t | ||
659 | GNUNET_GNSRECORD_block_get_size (const struct GNUNET_GNSRECORD_Block *block); | ||
660 | |||
661 | /** | ||
662 | * Returns the expiration of a block | ||
663 | */ | ||
664 | struct GNUNET_TIME_Absolute | ||
665 | GNUNET_GNSRECORD_block_get_expiration (const struct GNUNET_GNSRECORD_Block *block); | ||
666 | |||
667 | |||
668 | /** | ||
669 | * Builds the query from a block | ||
670 | */ | ||
671 | enum GNUNET_GenericReturnValue | ||
672 | GNUNET_GNSRECORD_query_from_block (const struct GNUNET_GNSRECORD_Block *block, | ||
673 | struct GNUNET_HashCode *query); | ||
674 | |||
675 | |||
641 | #if 0 /* keep Emacsens' auto-indent happy */ | 676 | #if 0 /* keep Emacsens' auto-indent happy */ |
642 | { | 677 | { |
643 | #endif | 678 | #endif |