|
| void | GNR_derive_block_aes_key (unsigned char *ctr, unsigned char *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub) |
| | Derive session key and iv from label and public key.
|
| |
| void | GNR_derive_block_xsalsa_key (struct GNUNET_CRYPTO_XSalsa20Nonce *nonce, struct GNUNET_CRYPTO_XSalsa20SecretKey *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EddsaPublicKey *pub) |
| | Derive session key and iv from label and public key.
|
| |
| static enum GNUNET_GenericReturnValue | block_sign_ecdsa (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey, const char *label, struct GNUNET_GNSRECORD_Block *block) |
| |
| static enum GNUNET_GenericReturnValue | block_sign_eddsa (const struct GNUNET_CRYPTO_EddsaPrivateKey *key, const struct GNUNET_CRYPTO_EddsaPublicKey *pkey, const char *label, struct GNUNET_GNSRECORD_Block *block) |
| |
| enum GNUNET_GenericReturnValue | GNUNET_GNSRECORD_block_sign (const struct GNUNET_CRYPTO_BlindablePrivateKey *key, const char *label, struct GNUNET_GNSRECORD_Block *block) |
| | Sign a block create with GNUNET_GNSRECORD_block_create_unsigned.
|
| |
| static enum GNUNET_GenericReturnValue | block_create_ecdsa (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **block, int sign) |
| | Sign name and records.
|
| |
| static enum GNUNET_GenericReturnValue | block_create_eddsa (const struct GNUNET_CRYPTO_EddsaPrivateKey *key, const struct GNUNET_CRYPTO_EddsaPublicKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **block, int sign) |
| | Sign name and records (EDDSA version)
|
| |
| static enum GNUNET_GenericReturnValue | block_create2 (const struct GNUNET_CRYPTO_BlindablePrivateKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **result, int sign) |
| |
| enum GNUNET_GenericReturnValue | GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block) |
| | Check if a signature is valid.
|
| |
| static enum GNUNET_GenericReturnValue | block_decrypt_ecdsa (const struct GNUNET_GNSRECORD_Block *block, const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls) |
| |
| static enum GNUNET_GenericReturnValue | block_decrypt_eddsa (const struct GNUNET_GNSRECORD_Block *block, const struct GNUNET_CRYPTO_EddsaPublicKey *zone_key, const char *label, GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls) |
| |
| void | GNUNET_GNSRECORD_query_from_private_key (const struct GNUNET_CRYPTO_BlindablePrivateKey *zone, const char *label, struct GNUNET_HashCode *query) |
| | Calculate the DHT query for a given label in a given zone.
|
| |
| void | GNUNET_GNSRECORD_query_from_public_key (const struct GNUNET_CRYPTO_BlindablePublicKey *pub, const char *label, struct GNUNET_HashCode *query) |
| | Calculate the DHT query for a given label in a given zone.
|
| |
| static enum GNUNET_GenericReturnValue | block_open_ecdsa (void *cls, const char *label, const struct GNUNET_GNSRECORD_Block *block, GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls) |
| |
| static enum GNUNET_GenericReturnValue | block_open_eddsa (void *cls, const char *label, const struct GNUNET_GNSRECORD_Block *block, GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls) |
| |
| static enum GNUNET_GenericReturnValue | block_seal_not_implemented (void *cls, const char *label, struct GNUNET_TIME_Absolute expire, unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **result) |
| |
| static enum GNUNET_GenericReturnValue | block_seal (void *cls, const char *label, struct GNUNET_TIME_Absolute expire, unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **result) |
| |
| struct GNUNET_GNSRECORD_EncryptionContext * | GNUNET_GNSRECORD_encryption_context_setup_owner (const struct GNUNET_CRYPTO_BlindablePrivateKey *sk) |
| | Create a new encryption context for the zone owner.
|
| |
| struct GNUNET_GNSRECORD_EncryptionContext * | GNUNET_GNSRECORD_encryption_context_setup_resolver (const struct GNUNET_CRYPTO_BlindablePublicKey *zkey) |
| | Create a new encryption context for a resolver.
|
| |
| void | GNUNET_GNSRECORD_encryption_context_destroy (struct GNUNET_GNSRECORD_EncryptionContext *ec) |
| | Cleanup and free the encryption context.
|
| |
| enum GNUNET_GenericReturnValue | GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, const struct GNUNET_CRYPTO_BlindablePublicKey *zone_key, const char *label, GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls) |
| | Decrypt block.
|
| |
API for GNS record-related crypto.
- Author
- Martin Schanzenbach
-
Matthias Wachs
-
Christian Grothoff
Definition in file gnsrecord_crypto.c.
Definition at line 94 of file gnsrecord_crypto.c.
100{
103 size_t size = ntohl (block->
size) -
sizeof (*block) +
sizeof (*gnr_block);
104
106 ecblock = &(block)->ecdsa_block;
111
113 size -
sizeof (*gnr_block));
115 label,
116 "gns",
120 label,
121 "gns",
124 {
128 }
131}
static char * pkey
Public key of the zone to look in, in ASCII.
#define GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN
GNS record set signature (GNS)
void GNUNET_CRYPTO_ecdsa_public_key_derive(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EcdsaPublicKey *result)
Derive a public key from a given public key and a label.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_ecdsa_sign_derived(const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const char *label, const char *context, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EcdsaSignature *sig)
This is a signature function for ECDSA which takes a private key, derives/blinds it and signs the mes...
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
static unsigned int size
Size of the "table".
Information we have in an encrypted block with record data (i.e.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time of the block.
struct GNUNET_CRYPTO_SignaturePurpose purpose
Number of bytes signed; also specifies the number of bytes of encrypted data that follow.
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
uint32_t size
How many bytes does this signature sign? (including this purpose header); in network byte order (!...
uint32_t size
Size of the block.
Information we have in an encrypted block with record data (i.e.
struct GNUNET_CRYPTO_EcdsaSignature signature
Signature of the block.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time of the block.
struct GNUNET_CRYPTO_EcdsaPublicKey derived_key
Derived key used for signing; hash of this is the query.
References GNUNET_GNSRECORD_EcdsaBlock::derived_key, GNUNET_GNSRECORD_EcdsaBlock::expiration_time, GNRBlockPS::expiration_time, GNUNET_break, GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_ecdsa_sign_derived(), GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_OK, GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, GNUNET_SYSERR, key, pkey, GNUNET_CRYPTO_SignaturePurpose::purpose, GNRBlockPS::purpose, GNUNET_GNSRECORD_EcdsaBlock::signature, GNUNET_CRYPTO_SignaturePurpose::size, GNUNET_GNSRECORD_Block::size, and size.
Referenced by block_create_ecdsa(), and GNUNET_GNSRECORD_block_sign().
Definition at line 137 of file gnsrecord_crypto.c.
143{
146 size_t size = ntohl (block->
size) -
sizeof (*block) +
sizeof (*gnr_block);
148 edblock = &(block)->eddsa_block;
154 size -
sizeof (*gnr_block));
155
157 label,
158 "gns",
161 label,
162 "gns",
167}
void GNUNET_CRYPTO_eddsa_public_key_derive(const struct GNUNET_CRYPTO_EddsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EddsaPublicKey *result)
Derive a public key from a given public key and a label.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_derived(const struct GNUNET_CRYPTO_EddsaPrivateKey *pkey, const char *label, const char *context, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
This is a signature function for EdDSA which takes a private key and derives it using the label and c...
Information we have in an encrypted block with record data (i.e.
struct GNUNET_CRYPTO_EddsaPublicKey derived_key
Derived key used for signing; hash of this is the query.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time of the block.
struct GNUNET_CRYPTO_EddsaSignature signature
Signature of the block.
References GNUNET_GNSRECORD_EddsaBlock::derived_key, GNUNET_GNSRECORD_EddsaBlock::expiration_time, GNRBlockPS::expiration_time, GNUNET_CRYPTO_eddsa_public_key_derive(), GNUNET_CRYPTO_eddsa_sign_derived(), GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_OK, GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, key, pkey, GNUNET_CRYPTO_SignaturePurpose::purpose, GNRBlockPS::purpose, GNUNET_GNSRECORD_EddsaBlock::signature, GNUNET_CRYPTO_SignaturePurpose::size, GNUNET_GNSRECORD_Block::size, and size.
Referenced by block_create_eddsa(), and GNUNET_GNSRECORD_block_sign().
Sign name and records.
- Parameters
-
| key | the private key |
| pkey | associated public key |
| expire | block expiration |
| label | the name for the records |
| rd | record data |
| rd_count | number of records |
| block | the block result. Must be allocated sufficiently. |
| sign | sign the block GNUNET_NO if block will be signed later. |
- Returns
- GNUNET_SYSERR on error (otherwise GNUNET_OK)
Definition at line 220 of file gnsrecord_crypto.c.
228{
232
234 {
237 }
238
241 {
242 ecblock = &(*block)->ecdsa_block;
246 skey,
247 label,
251 rdata_len,
252 skey,
253 ctr,
254 &ecblock[1]);
255 }
260 {
264 }
266}
static enum GNUNET_GenericReturnValue block_sign_ecdsa(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey, const char *label, struct GNUNET_GNSRECORD_Block *block)
void GNR_derive_block_aes_key(unsigned char *ctr, unsigned char *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Derive session key and iv from label and public key.
#define GNUNET_GNSRECORD_TYPE_PKEY
WARNING: This header is generated! In order to add GNS record types, you must register them in GANA,...
static char * expire
DID Document expiration Date Attribute String.
void GNUNET_CRYPTO_aes_ctr(const void *in_buf, size_t in_buf_len, const unsigned char key[(256/8)], const unsigned char iv[(128/8)], void *out_buf)
Decrypt or encrypt a given block using a symmetric key using AES in counter mode.
#define GNUNET_GNSRECORD_MAX_BLOCK_SIZE
Maximum size of a value that can be stored in a GNS block.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
uint64_t abs_value_us__
The actual value (in network byte order).
References GNUNET_TIME_AbsoluteNBO::abs_value_us__, block_sign_ecdsa(), GNUNET_GNSRECORD_EcdsaBlock::expiration_time, expire, GNR_derive_block_aes_key(), GNUNET_break, GNUNET_CRYPTO_aes_ctr(), GNUNET_CRYPTO_AES_KEY_LENGTH, GNUNET_free, GNUNET_GNSRECORD_MAX_BLOCK_SIZE, GNUNET_GNSRECORD_TYPE_PKEY, GNUNET_malloc, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_hton(), GNUNET_YES, key, and pkey.
Referenced by block_create2().
Sign name and records (EDDSA version)
- Parameters
-
| key | the private key |
| pkey | associated public key |
| expire | block expiration |
| label | the name for the records |
| rd | record data |
| rd_count | number of records |
| block | where to store the block. Must be allocated sufficiently. |
| sign | GNUNET_YES if block shall be signed as well |
- Returns
- GNUNET_SYSERR on error (otherwise GNUNET_OK)
Definition at line 283 of file gnsrecord_crypto.c.
291{
295
297 {
300 }
301
303 + rdata_len + crypto_secretbox_MACBYTES);
305 + rdata_len + crypto_secretbox_MACBYTES);
306 {
307 edblock = &(*block)->eddsa_block;
311 &skey,
312 label,
317 rdata_len,
318 (unsigned char*) rdata,
319 &skey,
321 &edblock[1]));
325 }
327}
static enum GNUNET_GenericReturnValue block_sign_eddsa(const struct GNUNET_CRYPTO_EddsaPrivateKey *key, const struct GNUNET_CRYPTO_EddsaPublicKey *pkey, const char *label, struct GNUNET_GNSRECORD_Block *block)
void GNR_derive_block_xsalsa_key(struct GNUNET_CRYPTO_XSalsa20Nonce *nonce, struct GNUNET_CRYPTO_XSalsa20SecretKey *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Derive session key and iv from label and public key.
#define GNUNET_GNSRECORD_TYPE_EDKEY
GNS zone delegation (EDKEY)
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_xsalsa20poly1305_encrypt(size_t in_buf_len, const unsigned char in_buf[in_buf_len], const struct GNUNET_CRYPTO_XSalsa20SecretKey *key, const struct GNUNET_CRYPTO_XSalsa20Nonce *nonce, void *out_buf)
Encrypt the given data using XSalsa20-Poly1305.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
References GNUNET_TIME_AbsoluteNBO::abs_value_us__, block_sign_eddsa(), GNUNET_GNSRECORD_EddsaBlock::expiration_time, expire, GNR_derive_block_xsalsa_key(), GNUNET_assert, GNUNET_break, GNUNET_CRYPTO_xsalsa20poly1305_encrypt(), GNUNET_GNSRECORD_MAX_BLOCK_SIZE, GNUNET_GNSRECORD_TYPE_EDKEY, GNUNET_malloc, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_hton(), GNUNET_YES, key, GNUNET_CRYPTO_XSalsa20Nonce::nonce, and pkey.
Referenced by block_create2().
Definition at line 349 of file gnsrecord_crypto.c.
356{
360 char *norm_label;
361#define CSIZE 64
364
366
368 {
370
372 if (0 != memcmp (&
line->key,
375 {
376
380 }
384 norm_label,
385 rdata,
386 rdata_len,
388 sign);
389 }
391 {
393 &edpubkey);
395 &edpubkey,
397 norm_label,
398 rdata,
399 rdata_len,
401 sign);
402 }
403#undef CSIZE
406}
static enum GNUNET_GenericReturnValue block_create_ecdsa(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **block, int sign)
Sign name and records.
static enum GNUNET_GenericReturnValue block_create_eddsa(const struct GNUNET_CRYPTO_EddsaPrivateKey *key, const struct GNUNET_CRYPTO_EddsaPublicKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **block, int sign)
Sign name and records (EDDSA version)
static char * line
Desired phone line (string to be converted to a hash).
static char * res
Currently read line or NULL on EOF.
static int result
Global testing status.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Derive key.
char * GNUNET_GNSRECORD_string_normalize(const char *src)
Normalize a UTF-8 string to a GNS name.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_PUBLIC_KEY_TYPE_ECDSA
The identity type.
Private ECC key encoded for transmission.
Line in cache mapping private keys to public keys.
References block_create_ecdsa(), block_create_eddsa(), CSIZE, expire, GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_free, GNUNET_GNSRECORD_string_normalize(), GNUNET_PUBLIC_KEY_TYPE_ECDSA, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_SYSERR, key, KeyCacheLine::key, line, pkey, res, and result.
Referenced by block_seal().
Definition at line 467 of file gnsrecord_crypto.c.
473{
474 size_t payload_len = ntohl (block->
size)
478
479 if (ntohl (block->
size) <
481 {
484 }
488 label,
490 zone_key);
491 {
494
496 payload_len,
498 ctr,
503 {
504
507 }
508 {
510 unsigned int j;
512
518 {
521 }
522
524 j = 0;
525 for (
unsigned int i = 0; i <
rd_count; i++)
526 {
528 {
529
531 continue;
532 }
533
535 {
537
538 for (
unsigned int k = 0; k <
rd_count; k++)
539 {
540 if (k == i)
541 continue;
542 if (
rd[i].expiration_time < now.abs_value_us)
544 if ((
rd[k].record_type ==
rd[i].record_type) &&
545 (
rd[k].expiration_time >= now.abs_value_us) &&
547 {
550 "Ignoring shadow record\n");
551 break;
552 }
553 }
555 {
557 if (j != i)
559 j++;
560 }
561 }
562 else if (
rd[i].expiration_time >= now.abs_value_us)
563 {
564
565 if (j != i)
567 j++;
568 }
569 else
570 {
572
575 "Excluding record that expired %s (%llu ago)\n",
577 (
unsigned long long)
rd[i].expiration_time
578 - now.abs_value_us);
579 }
580 }
582 if (NULL != proc)
583 proc (proc_cls,
586 }
587 }
589}
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static unsigned long long payload
How much data are we currently storing in the database?
int GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *dest)
Deserialize the given records to the given destination.
unsigned int GNUNET_GNSRECORD_records_deserialize_get_size(size_t len, const char *src)
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
@ GNUNET_GNSRECORD_RF_SHADOW
This record should not be used unless all (other) records in the set with an absolute expiration time...
#define GNUNET_log(kind,...)
#define GNUNET_NZL(l)
Macro used to avoid using 0 for the length of a variable-size array (Non-Zero-Length).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
struct GNUNET_GNSRECORD_EcdsaBlock ecdsa_block
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_TIME_AbsoluteNBO::abs_value_us__, GNUNET_GNSRECORD_Block::ecdsa_block, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_EcdsaBlock::expiration_time, GNUNET_GNSRECORD_Data::flags, GNR_derive_block_aes_key(), GNUNET_assert, GNUNET_break_op, GNUNET_CRYPTO_aes_ctr(), GNUNET_CRYPTO_AES_KEY_LENGTH, GNUNET_ERROR_TYPE_INFO, GNUNET_GNSRECORD_records_deserialize(), GNUNET_GNSRECORD_records_deserialize_get_size(), GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW, GNUNET_log, GNUNET_NO, GNUNET_NZL, GNUNET_OK, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_YES, key, payload, rd, rd_count, and GNUNET_GNSRECORD_Block::size.
Referenced by block_open_ecdsa().
Definition at line 593 of file gnsrecord_crypto.c.
599{
600 size_t payload_len = ntohl (block->
size)
604
605
606 if (ntohl (block->
size) <
608 {
611 }
613 &skey,
614 label,
616 ,
617 zone_key);
618 {
621
624 payload_len,
625 (unsigned char*) &block[1],
626 &skey,
629 payload_len -= crypto_secretbox_MACBYTES;
633 {
634
637 }
638 {
640 unsigned int j;
642
648 {
651 }
652
654 j = 0;
655 for (
unsigned int i = 0; i <
rd_count; i++)
656 {
658 {
659
661 continue;
662 }
663
665 {
667
668 for (
unsigned int k = 0; k <
rd_count; k++)
669 {
670 if (k == i)
671 continue;
672 if (
rd[i].expiration_time < now.abs_value_us)
674 if ((
rd[k].record_type ==
rd[i].record_type) &&
675 (
rd[k].expiration_time >= now.abs_value_us) &&
677 {
680 "Ignoring shadow record\n");
681 break;
682 }
683 }
685 {
687 if (j != i)
689 j++;
690 }
691 }
692 else if (
rd[i].expiration_time >= now.abs_value_us)
693 {
694
695 if (j != i)
697 j++;
698 }
699 else
700 {
702
705 "Excluding record that expired %s (%llu ago)\n",
707 (
unsigned long long)
rd[i].expiration_time
708 - now.abs_value_us);
709 }
710 }
712 if (NULL != proc)
713 proc (proc_cls,
716 }
717 }
719}
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_xsalsa20poly1305_decrypt(size_t in_buf_len, const unsigned char in_buf[in_buf_len], const struct GNUNET_CRYPTO_XSalsa20SecretKey *key, const struct GNUNET_CRYPTO_XSalsa20Nonce *nonce, void *out_buf)
Encrypt the given data using XSalsa20-Poly1305.
struct GNUNET_GNSRECORD_EddsaBlock eddsa_block
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_TIME_AbsoluteNBO::abs_value_us__, GNUNET_GNSRECORD_Block::eddsa_block, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_EddsaBlock::expiration_time, GNUNET_GNSRECORD_Data::flags, GNR_derive_block_xsalsa_key(), GNUNET_assert, GNUNET_break_op, GNUNET_CRYPTO_xsalsa20poly1305_decrypt(), GNUNET_ERROR_TYPE_INFO, GNUNET_GNSRECORD_records_deserialize(), GNUNET_GNSRECORD_records_deserialize_get_size(), GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW, GNUNET_log, GNUNET_NO, GNUNET_NZL, GNUNET_OK, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_YES, GNUNET_CRYPTO_XSalsa20Nonce::nonce, payload, rd, rd_count, and GNUNET_GNSRECORD_Block::size.
Referenced by block_open_eddsa().