GNUnet debian-0.24.3-23-g589b01d60
messenger_api_epoch_announcement.h File Reference
Include dependency graph for messenger_api_epoch_announcement.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_MESSENGER_EpochAnnouncement
 

Functions

struct GNUNET_MESSENGER_EpochAnnouncementcreate_epoch_announcement (struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
 Creates and allocates a new epoch announcement for a given epoch using a specific announcement identifier or NULL. More...
 
void destroy_epoch_announcement (struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Destroys a given epoch announcement and frees its resources. More...
 
uint32_t get_epoch_announcement_size (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns the size of a given epoch announcement in terms of members. More...
 
uint32_t get_epoch_announcement_members_count (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns the current amount of members of a given epoch announcement. More...
 
enum GNUNET_GenericReturnValue is_epoch_announcement_completed (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns whether a given epoch announcement is complete in terms of confirmed announcements from its members. More...
 
enum GNUNET_GenericReturnValue is_epoch_announcement_announced (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns whether the client has announced being part of a given epoch announcement owning its secret key. More...
 
void set_epoch_announcement_appeal (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_TIME_Relative timeout)
 Sets a specified timeout for a given epoch announcement of the client for its own appeal of the announced secret key. More...
 
enum GNUNET_GenericReturnValue is_epoch_announcement_appealed (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns whether a given epoch announcement of the client is currently appealing for its secret key from other members. More...
 
void set_epoch_announcement_key (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
 Sets the secret key of a given epoch announcement to a shared key. More...
 
const struct GNUNET_CRYPTO_SymmetricSessionKeyget_epoch_announcement_key (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Returns the secret key of a given epoch announcement or NULL. More...
 
void handle_epoch_announcement_message (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles an encrypted message with hash by a given epoch announcement using its secret key for decryption if available. More...
 
enum GNUNET_GenericReturnValue confirm_epoch_announcement_member (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact, enum GNUNET_GenericReturnValue sent)
 Confirms an announcement message with its hash to a given epoch announcement as confirmation for a specific contact. More...
 
enum GNUNET_GenericReturnValue revoke_epoch_announcement_member (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact)
 Revokes an announcement message with its hash from a given epoch announcement removing the caused confirmation for a specific contact to be its member. More...
 
enum GNUNET_GenericReturnValue is_epoch_announcement_member (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
 Returns whether a specific contact is confirmed member of a given epoch announcement. More...
 
enum GNUNET_GenericReturnValue get_epoch_announcement_member_hash (const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
 Provides an announcement hash of a member from a given epoch announcement. More...
 
void invalidate_epoch_announcement (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
 Invalidates a given epoch announcement by a specific contact. More...
 
enum GNUNET_GenericReturnValue send_epoch_announcement (struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Tries to send an announcement message by the client for a given epoch announcement using its secret key. More...
 
enum GNUNET_GenericReturnValue send_epoch_announcement_appeal (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
 Tries to send an appeal message by the client responding to a previous event in regards to a given epoch announcement requesting its secret key from other members. More...
 
enum GNUNET_GenericReturnValue send_epoch_announcement_access (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
 Tries to send an access message by the client responding to a previous event in regards to a given epoch announcement using its secret key. More...
 
enum GNUNET_GenericReturnValue send_epoch_announcement_revolution (struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
 Tries to send a revolution message by the client for a given epoch announcement using its secret key. More...
 
enum GNUNET_GenericReturnValue send_epoch_announcement_authorization (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *event)
 Tries to send an authorization message by the client responding to a previous event in regards to a given epoch announcement using the secret key from a permitted epoch group. More...
 
void handle_epoch_announcement (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
 Handles an announcement message with hash from its sender inside a given epoch announcement as first stage. More...
 
void handle_epoch_announcement_delay (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
 Handles an announcement message with hash from its sender inside a given epoch announcement as second stage after custom delay. More...
 
void handle_epoch_announcement_access (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles an access message with hash from its sender inside a given epoch announcement. More...
 
void write_epoch_announcement_record (struct GNUNET_MESSENGER_EpochAnnouncement *announcement, enum GNUNET_GenericReturnValue deleted)
 Writes/Deletes the GNS record of a given epoch announcement depending on a provided flag that states wether an existing record should be deleted. More...
 

Function Documentation

◆ create_epoch_announcement()

struct GNUNET_MESSENGER_EpochAnnouncement * create_epoch_announcement ( struct GNUNET_MESSENGER_Epoch epoch,
const union GNUNET_MESSENGER_EpochIdentifier identifier,
enum GNUNET_GenericReturnValue  valid 
)

Creates and allocates a new epoch announcement for a given epoch using a specific announcement identifier or NULL.

Additionally a flag specifies whether that group needs to be valid to allow key derivation based on that property.

Parameters
[in,out]epochEpoch
[in]identifierAnnouncement identifier
[in]validValidity flag
Returns
New epoch announcement or NULL

Definition at line 82 of file messenger_api_epoch_announcement.c.

86{
87 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
88 const struct GNUNET_MESSENGER_EpochAnnouncement *previous;
89
91
92 announcement = GNUNET_new (struct GNUNET_MESSENGER_EpochAnnouncement);
93
94 if (! announcement)
95 return NULL;
96
98
99 if ((GNUNET_YES == valid) && (previous) &&
100 (GNUNET_YES != previous->valid))
101 previous = NULL;
102
103 if (previous)
104 identifier = &(previous->identifier);
105
106 if (identifier)
107 GNUNET_memcpy (&(announcement->identifier), identifier,
108 sizeof (announcement->identifier));
109 else
111
112 GNUNET_assert (! announcement->identifier.code.group_bit);
113
115 announcement->appeal = NULL;
116
117 announcement->appeal_task = NULL;
118
119 announcement->epoch = epoch;
120 announcement->membership = create_epoch_membership (
121 get_epoch_announcement_size (announcement));
122 announcement->shared_key = NULL;
123 announcement->query = NULL;
124
126
127 announcement->valid = GNUNET_YES;
128 announcement->stored = GNUNET_NO;
129
130 if (previous)
131 {
133
134 if (GNUNET_OK == derive_epoch_announcement_key (announcement,
135 previous,
136 &key))
137 {
138 set_epoch_announcement_key (announcement, &key, GNUNET_YES);
139
140 announcement->valid = previous->valid;
141 }
142 }
143
144 return announcement;
145}
struct GNUNET_HashCode key
The key used in the DHT.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero_(void)
Return absolute time of 0ms.
Definition: time.c:142
const struct GNUNET_MESSENGER_EpochAnnouncement * get_epoch_previous_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier)
Returns the epoch announcement of a previous epoch from a given epoch using a specific announcement i...
uint32_t get_epoch_announcement_size(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the size of a given epoch announcement in terms of members.
static enum GNUNET_GenericReturnValue derive_epoch_announcement_key(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_EpochAnnouncement *previous, struct GNUNET_CRYPTO_SymmetricSessionKey *key)
static void random_epoch_announcement_identifier(union GNUNET_MESSENGER_EpochIdentifier *identifier)
void set_epoch_announcement_key(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
Sets the secret key of a given epoch announcement to a shared key.
struct GNUNET_MESSENGER_EpochMembership * create_epoch_membership(uint32_t size)
Creates and allocates a new membership for subgroups of an epoch with specified size.
struct GNUNET_NAMESTORE_QueueEntry * query
struct GNUNET_MESSENGER_EpochMembership * membership
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
struct GNUNET_CONTAINER_MultiHashMap * messages
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_MESSENGER_EpochIdentifierCode code

References GNUNET_MESSENGER_EpochAnnouncement::announcement_expiration, GNUNET_MESSENGER_EpochAnnouncement::appeal, GNUNET_MESSENGER_EpochAnnouncement::appeal_task, GNUNET_MESSENGER_EpochIdentifier::code, create_epoch_membership(), derive_epoch_announcement_key(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_size(), get_epoch_previous_announcement(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_TIME_absolute_get_zero_(), GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_EpochAnnouncement::identifier, key, GNUNET_MESSENGER_EpochAnnouncement::membership, GNUNET_MESSENGER_EpochAnnouncement::messages, GNUNET_MESSENGER_EpochAnnouncement::query, random_epoch_announcement_identifier(), set_epoch_announcement_key(), GNUNET_MESSENGER_EpochAnnouncement::shared_key, GNUNET_MESSENGER_EpochAnnouncement::stored, and GNUNET_MESSENGER_EpochAnnouncement::valid.

Referenced by generate_room_epoch_announcement(), and get_epoch_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_epoch_announcement()

void destroy_epoch_announcement ( struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Destroys a given epoch announcement and frees its resources.

Parameters
[in,out]announcementEpoch announcement

Definition at line 149 of file messenger_api_epoch_announcement.c.

151{
152 GNUNET_assert (announcement);
153
154 if (announcement->messages)
156
157 if (announcement->membership)
158 destroy_epoch_membership (announcement->membership);
159
160 if (announcement->shared_key)
161 GNUNET_free (announcement->shared_key);
162
163 if (announcement->query)
164 GNUNET_NAMESTORE_cancel (announcement->query);
165
166 if (announcement->appeal_task)
167 GNUNET_SCHEDULER_cancel (announcement->appeal_task);
168
169 if (announcement->appeal)
170 GNUNET_free (announcement->appeal);
171
172 GNUNET_free (announcement);
173}
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:980
void destroy_epoch_membership(struct GNUNET_MESSENGER_EpochMembership *membership)
Destroys and frees resources of a given membership.

References GNUNET_MESSENGER_EpochAnnouncement::appeal, GNUNET_MESSENGER_EpochAnnouncement::appeal_task, destroy_epoch_membership(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_free, GNUNET_NAMESTORE_cancel(), GNUNET_SCHEDULER_cancel(), GNUNET_MESSENGER_EpochAnnouncement::membership, GNUNET_MESSENGER_EpochAnnouncement::messages, GNUNET_MESSENGER_EpochAnnouncement::query, and GNUNET_MESSENGER_EpochAnnouncement::shared_key.

Referenced by generate_room_epoch_announcement(), get_epoch_announcement(), and iterate_destroy_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_epoch_announcement_size()

uint32_t get_epoch_announcement_size ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Returns the size of a given epoch announcement in terms of members.

Parameters
[in]announcementEpoch announcement
Returns
Maximum announcement size

Definition at line 177 of file messenger_api_epoch_announcement.c.

179{
180 GNUNET_assert (announcement);
181
182 return get_epoch_size (announcement->epoch);
183}
uint32_t get_epoch_size(const struct GNUNET_MESSENGER_Epoch *epoch)
Returns the amount of members by a given epoch or zero as long as it's not fully initialized yet.

References GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_size(), and GNUNET_assert.

Referenced by create_epoch_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_epoch_announcement_members_count()

uint32_t get_epoch_announcement_members_count ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Returns the current amount of members of a given epoch announcement.

Parameters
[in]announcementEpoch announcement
Returns
Amount of confirmed members of announcement

Definition at line 187 of file messenger_api_epoch_announcement.c.

190{
191 GNUNET_assert (announcement);
192
193 return get_epoch_membership_count (announcement->membership);
194}
uint32_t get_epoch_membership_count(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns the current amount of individual members inside a given epoch membership.

References get_epoch_membership_count(), GNUNET_assert, and GNUNET_MESSENGER_EpochAnnouncement::membership.

Referenced by is_epoch_group_missing_announcement(), is_other_epoch_announcement_better(), and send_epoch_announcement_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_epoch_announcement_completed()

enum GNUNET_GenericReturnValue is_epoch_announcement_completed ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Returns whether a given epoch announcement is complete in terms of confirmed announcements from its members.

Parameters
[in]announcementEpoch announcement
Returns
GNUNET_YES if complete, otherwise GNUNET_NO

Definition at line 198 of file messenger_api_epoch_announcement.c.

201{
202 GNUNET_assert (announcement);
203
204 return is_epoch_membership_completed (announcement->membership);
205}
enum GNUNET_GenericReturnValue is_epoch_membership_completed(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns whether a given epoch membership is complete, meaning that all of its intended members have p...

References GNUNET_assert, is_epoch_membership_completed(), and GNUNET_MESSENGER_EpochAnnouncement::membership.

Referenced by handle_epoch_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_epoch_announcement_announced()

enum GNUNET_GenericReturnValue is_epoch_announcement_announced ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Returns whether the client has announced being part of a given epoch announcement owning its secret key.

Parameters
[in]announcementEpoch announcement
Returns
GNUNET_YES if client is active member of the group, otherwise GNUNET_NO

Definition at line 209 of file messenger_api_epoch_announcement.c.

212{
213 GNUNET_assert (announcement);
214
215 return is_epoch_membership_member (announcement->membership, NULL);
216}
enum GNUNET_GenericReturnValue is_epoch_membership_member(const struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is announced member of a given epoch membership.

References GNUNET_assert, is_epoch_membership_member(), and GNUNET_MESSENGER_EpochAnnouncement::membership.

Referenced by handle_epoch_announcement(), and propose_epoch_group().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_epoch_announcement_appeal()

void set_epoch_announcement_appeal ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
struct GNUNET_TIME_Relative  timeout 
)

Sets a specified timeout for a given epoch announcement of the client for its own appeal of the announced secret key.

Parameters
[in,out]announcementEpoch announcement
[in]timeoutTimeout of appeal

Definition at line 242 of file messenger_api_epoch_announcement.c.

245{
246 struct GNUNET_TIME_Absolute timepoint;
247
248 GNUNET_assert (announcement);
249
251
252 if (! announcement->appeal)
253 announcement->appeal = GNUNET_new (struct GNUNET_TIME_Absolute);
254 else if (GNUNET_TIME_absolute_cmp (*(announcement->appeal), >, timepoint))
255 return;
256
257 GNUNET_memcpy (announcement->appeal, &timepoint, sizeof (timepoint));
258
259 if (announcement->appeal_task)
260 GNUNET_SCHEDULER_cancel (announcement->appeal_task);
261
263 *(announcement->appeal),
266 announcement);
267}
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
Definition: gnunet-arm.c:118
@ GNUNET_SCHEDULER_PRIORITY_HIGH
Run with high priority (important requests).
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_at_with_priority(struct GNUNET_TIME_Absolute at, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run at the specified time.
Definition: scheduler.c:1118
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:111
#define GNUNET_TIME_absolute_cmp(t1, op, t2)
Compare two absolute times.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Add a given relative duration to the given start time.
Definition: time.c:452
static void task_epoch_announcement_appeal(void *cls)
Time for absolute times used by GNUnet, in microseconds.

References GNUNET_MESSENGER_EpochAnnouncement::appeal, GNUNET_MESSENGER_EpochAnnouncement::appeal_task, GNUNET_assert, GNUNET_memcpy, GNUNET_new, GNUNET_SCHEDULER_add_at_with_priority(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_PRIORITY_HIGH, GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_cmp, GNUNET_TIME_absolute_get(), task_epoch_announcement_appeal(), and timeout.

Referenced by handle_appeal_message(), and send_epoch_announcement_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_epoch_announcement_appealed()

enum GNUNET_GenericReturnValue is_epoch_announcement_appealed ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Returns whether a given epoch announcement of the client is currently appealing for its secret key from other members.

Parameters
[in]announcementEpoch announcement
Returns
GNUNET_YES if it is appealing, otherwise GNUNET_NO

Definition at line 271 of file messenger_api_epoch_announcement.c.

274{
275 struct GNUNET_TIME_Relative time;
276
277 GNUNET_assert (announcement);
278
279 if (! announcement->appeal)
280 return GNUNET_NO;
281
282 time = GNUNET_TIME_absolute_get_remaining (*(announcement->appeal));
283
285 return GNUNET_NO;
286
287 return GNUNET_YES;
288}
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
Definition: time.c:406
bool GNUNET_TIME_relative_is_zero(struct GNUNET_TIME_Relative rel)
Test if rel is zero.
Definition: time.c:664
Time for relative time used by GNUnet, in microseconds.

References GNUNET_MESSENGER_EpochAnnouncement::appeal, GNUNET_assert, GNUNET_NO, GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_is_zero(), and GNUNET_YES.

Referenced by handle_epoch_announcement_delay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_epoch_announcement_key()

void set_epoch_announcement_key ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_CRYPTO_SymmetricSessionKey shared_key,
enum GNUNET_GenericReturnValue  write_record 
)

Sets the secret key of a given epoch announcement to a shared key.

An additional flag decides whether the shared key has been loaded from storage or whether it should write its record afterwards.

Parameters
[in,out]announcementEpoch announcement
[in]shared_keyShared key or NULL
[in]write_recordGNUNET_YES if the record should be written, otherwise GNUNET_NO

Definition at line 296 of file messenger_api_epoch_announcement.c.

301{
302 GNUNET_assert (announcement);
303
304 if ((GNUNET_NO == write_record) && (shared_key))
305 announcement->stored = GNUNET_YES;
306
307 if (announcement->shared_key)
308 return;
309
310 announcement->shared_key = GNUNET_new (struct
312
313 if (! announcement->shared_key)
314 return;
315
316 if (shared_key)
317 GNUNET_memcpy (announcement->shared_key, shared_key,
318 sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey));
319 else
321
322 update_epoch_announcement (announcement->epoch, announcement);
323
324 if (GNUNET_YES != announcement->stored)
326
327 handle_secret_messages_with_key (announcement);
328}
void GNUNET_CRYPTO_symmetric_create_session_key(struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Create a new random session key.
void update_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Updates the main announcement of a given epoch, looking into replacing the current main announcement ...
static void handle_secret_messages_with_key(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
void write_epoch_announcement_record(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, enum GNUNET_GenericReturnValue deleted)
Writes/Deletes the GNS record of a given epoch announcement depending on a provided flag that states ...

References GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_assert, GNUNET_CRYPTO_symmetric_create_session_key(), GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_YES, handle_secret_messages_with_key(), GNUNET_MESSENGER_EpochAnnouncement::shared_key, GNUNET_MESSENGER_EpochAnnouncement::stored, update_epoch_announcement(), and write_epoch_announcement_record().

Referenced by cb_key_monitor(), create_epoch_announcement(), generate_room_epoch_announcement(), handle_authorization_message(), and handle_epoch_announcement_access().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_epoch_announcement_key()

◆ handle_epoch_announcement_message()

void handle_epoch_announcement_message ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles an encrypted message with hash by a given epoch announcement using its secret key for decryption if available.

Parameters
[in,out]announcementEpoch announcement
[in]messageMessage
[in]hashHash of message

Definition at line 422 of file messenger_api_epoch_announcement.c.

427{
428 GNUNET_assert ((announcement) && (message) && (hash) &&
430
431 if (! get_epoch_announcement_key (announcement))
432 {
434 messages, hash))
435 return;
436
438 hash, NULL,
440 return;
441 }
442
443 handle_secret_message_with_key (announcement, hash, GNUNET_NO);
444}
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
@ GNUNET_MESSENGER_KIND_SECRET
The secret kind.
static void handle_secret_message_with_key(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue update)
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_announcement_key(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the secret key of a given epoch announcement or NULL.
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
struct GNUNET_MESSENGER_MessageHeader header
Header.

References get_epoch_announcement_key(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_MESSENGER_KIND_SECRET, GNUNET_NO, GNUNET_YES, handle_secret_message_with_key(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, and GNUNET_MESSENGER_EpochAnnouncement::messages.

Referenced by handle_secret_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ confirm_epoch_announcement_member()

enum GNUNET_GenericReturnValue confirm_epoch_announcement_member ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_HashCode hash,
const struct GNUNET_MESSENGER_Message message,
struct GNUNET_MESSENGER_Contact contact,
enum GNUNET_GenericReturnValue  sent 
)

Confirms an announcement message with its hash to a given epoch announcement as confirmation for a specific contact.

An additional flag specifies whether the message has been sent by the client or not.

Parameters
[in,out]announcementEpoch announcement
[in]hashHash of message
[in]messageMessage
[in,out]contactContact
[in]sentSent flag
Returns
GNUNET_YES on success, GNUNET_SYSERR on internal failure, otherwise GNUNET_NO

Definition at line 448 of file messenger_api_epoch_announcement.c.

455{
457
458 GNUNET_assert ((announcement) && (hash) && (message) && (contact));
459
460 if (GNUNET_YES != is_epoch_member (announcement->epoch, contact))
461 return GNUNET_SYSERR;
462
464 hash,
465 message,
466 contact,
467 sent);
468
469 if (GNUNET_YES != result)
470 return result;
471
472 update_epoch_announcement (announcement->epoch, announcement);
473 return GNUNET_YES;
474}
static int result
Global testing status.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_SYSERR
enum GNUNET_GenericReturnValue is_epoch_member(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is member of a given epoch.
enum GNUNET_GenericReturnValue confirm_epoch_membership_announcment(struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact, enum GNUNET_GenericReturnValue sent)
Adds an announcement message with its hash to a given epoch membership as confirmation for a specific...

References confirm_epoch_membership_announcment(), GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_assert, GNUNET_SYSERR, GNUNET_YES, is_epoch_member(), GNUNET_MESSENGER_EpochAnnouncement::membership, result, and update_epoch_announcement().

Referenced by handle_epoch_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ revoke_epoch_announcement_member()

enum GNUNET_GenericReturnValue revoke_epoch_announcement_member ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_HashCode hash,
const struct GNUNET_MESSENGER_Message message,
struct GNUNET_MESSENGER_Contact contact 
)

Revokes an announcement message with its hash from a given epoch announcement removing the caused confirmation for a specific contact to be its member.

This might be caused by deletion of the original announcement message by that member.

Parameters
[in,out]announcementEpoch announcement
[in]hashHash of message
[in]messageMessage
[in,out]contactContact
Returns
GNUNET_YES on success, otherwise GNUNET_NO

Definition at line 478 of file messenger_api_epoch_announcement.c.

484{
485 GNUNET_assert ((announcement) && (hash) && (message) && (contact));
486
488 return GNUNET_SYSERR;
489
491 hash, contact);
492}
@ GNUNET_MESSENGER_KIND_ANNOUNCEMENT
The announcement kind.
enum GNUNET_GenericReturnValue revoke_epoch_membership_announcement(struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *contact)
Drops an announcement message with a provided hash from a given epoch membership to revoke the confir...

References GNUNET_assert, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_SYSERR, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_EpochAnnouncement::membership, and revoke_epoch_membership_announcement().

Referenced by handle_room_delayed_deletion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_epoch_announcement_member()

enum GNUNET_GenericReturnValue is_epoch_announcement_member ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Contact contact 
)

Returns whether a specific contact is confirmed member of a given epoch announcement.

Parameters
[in]announcementEpoch announcement
[in]contactContact
Returns
GNUNET_YES if the contact is a member, otherwise GNUNET_NO

Definition at line 496 of file messenger_api_epoch_announcement.c.

499{
500 GNUNET_assert (announcement);
501
502 return is_epoch_membership_member (announcement->membership, contact);
503}

References GNUNET_assert, is_epoch_membership_member(), and GNUNET_MESSENGER_EpochAnnouncement::membership.

Referenced by handle_appeal_message(), handle_epoch_announcement(), handle_room_delayed_appeal(), it_check_epoch_announcement_member(), and task_epoch_announcement_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_epoch_announcement_member_hash()

enum GNUNET_GenericReturnValue get_epoch_announcement_member_hash ( const struct GNUNET_MESSENGER_EpochAnnouncement announcement,
struct GNUNET_HashCode hash,
enum GNUNET_GenericReturnValue  other 
)

Provides an announcement hash of a member from a given epoch announcement.

Depending on a flag it provides some hash of another member or the clients own announcement.

Parameters
[in]announcementEpoch announcement
[out]hashHash of announcement
[in]otherOther flag
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 507 of file messenger_api_epoch_announcement.c.

512{
513 GNUNET_assert ((announcement) && (hash));
514
516 announcement->membership, hash, other);
517}
enum GNUNET_GenericReturnValue get_epoch_membership_member_hash(const struct GNUNET_MESSENGER_EpochMembership *membership, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch membership.

References get_epoch_membership_member_hash(), GNUNET_assert, and GNUNET_MESSENGER_EpochAnnouncement::membership.

Referenced by handle_access_message(), propose_epoch_group(), and task_epoch_announcement_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invalidate_epoch_announcement()

void invalidate_epoch_announcement ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Contact contact 
)

Invalidates a given epoch announcement by a specific contact.

Parameters
[in,out]announcementEpoch announcement
[in]contactContact

Definition at line 521 of file messenger_api_epoch_announcement.c.

525{
526 const struct GNUNET_MESSENGER_Message *message;
527 struct GNUNET_MESSENGER_EpochAnnouncement *previous;
528 struct GNUNET_MESSENGER_Epoch *epoch;
529
530 GNUNET_assert (announcement);
531
532 if (GNUNET_NO == announcement->valid)
533 return;
534
535 if ((contact) && (GNUNET_YES != is_epoch_member (announcement->epoch,
536 contact)))
537 return;
538
539 announcement->valid = GNUNET_NO;
541
542 message = get_room_message (announcement->epoch->room,
543 &(announcement->epoch->hash));
544
545 if (! message)
546 goto skip_traversal;
547
548 switch (message->header.kind)
549 {
551 epoch = get_room_epoch (
552 announcement->epoch->room, &(message->body.join.epoch), GNUNET_NO);
553
554 if (epoch)
555 previous = get_epoch_announcement (
556 epoch, &(announcement->identifier), GNUNET_SYSERR);
557 else
558 previous = NULL;
559 break;
561 epoch = get_room_epoch (
562 announcement->epoch->room, &(message->body.leave.epoch), GNUNET_NO);
563
564 if (epoch)
565 previous = get_epoch_announcement (
566 epoch, &(announcement->identifier), GNUNET_SYSERR);
567 else
568 previous = NULL;
569 break;
571 epoch = get_room_epoch (
572 announcement->epoch->room, &(message->body.merge.epochs[0]), GNUNET_NO);
573
574 if (epoch)
575 {
576 previous = get_epoch_announcement (
577 epoch, &(announcement->identifier), GNUNET_SYSERR);
578
579 if ((previous) &&
581 announcement)))
582 previous = NULL;
583 }
584 else
585 previous = NULL;
586
587 if (! previous)
588 {
589 epoch = get_room_epoch (
590 announcement->epoch->room, &(message->body.merge.epochs[1]), GNUNET_NO);
591
592 if (epoch)
593 previous = get_epoch_announcement (
594 epoch, &(announcement->identifier), GNUNET_SYSERR);
595 }
596 break;
597 default:
598 previous = NULL;
599 break;
600 }
601
602 if ((previous) &&
604 announcement)))
605 previous = NULL;
606
607 if (previous)
608 invalidate_epoch_announcement (previous, contact);
609
610skip_traversal:
611 if (announcement->epoch->main_announcement != announcement)
612 return;
613
615 announcement->epoch, NULL, GNUNET_YES);
616}
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
struct GNUNET_MESSENGER_EpochAnnouncement * get_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Returns the epoch announcement of a given epoch using a specific unique identifier or NULL.
void invalidate_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates a given epoch announcement by a specific contact.
static enum GNUNET_GenericReturnValue is_epoch_announcement_key_derived_from(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_EpochAnnouncement *previous)
const struct GNUNET_MESSENGER_Message * get_room_message(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a message locally stored from a map for a given hash in a room.
struct GNUNET_MESSENGER_Epoch * get_room_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue recent)
Returns the epoch in a given room from a specific epoch hash that represents the exact message the ep...
struct GNUNET_MESSENGER_Room * room
struct GNUNET_MESSENGER_EpochAnnouncement * main_announcement
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_MESSENGER_MessageLeave leave
struct GNUNET_MESSENGER_MessageJoin join
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_HashCode epochs[2]
The previous epochs the message was sent from.
struct GNUNET_MESSENGER_MessageBody body
Body.

References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_MessageJoin::epoch, GNUNET_MESSENGER_MessageLeave::epoch, GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_MessageMerge::epochs, get_epoch_announcement(), get_room_epoch(), get_room_message(), GNUNET_assert, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_LEAVE, GNUNET_MESSENGER_KIND_MERGE, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_EpochAnnouncement::identifier, invalidate_epoch_announcement(), is_epoch_announcement_key_derived_from(), is_epoch_member(), GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageBody::leave, GNUNET_MESSENGER_Epoch::main_announcement, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_EpochAnnouncement::valid, and write_epoch_announcement_record().

Referenced by handle_revolution_message(), invalidate_epoch_announcement(), and iterate_epoch_announcement_invalidation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_epoch_announcement()

enum GNUNET_GenericReturnValue send_epoch_announcement ( struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Tries to send an announcement message by the client for a given epoch announcement using its secret key.

Parameters
[in,out]announcementEpoch announcement
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 620 of file messenger_api_epoch_announcement.c.

622{
624 const struct GNUNET_CRYPTO_EcdhePrivateKey *private_key;
626 struct GNUNET_MESSENGER_Message *message;
627
628 GNUNET_assert (announcement);
629
630 key = get_epoch_announcement_key (announcement);
631
632 if (! key)
633 return GNUNET_SYSERR;
634
636 announcement->announcement_expiration);
637
639 return GNUNET_NO;
640
643
644 private_key = get_epoch_private_key (announcement->epoch,
645 timeout);
646
647 if (! private_key)
648 return GNUNET_SYSERR;
649
651
652 message = create_message_announcement (&(announcement->identifier),
653 private_key,
654 key,
655 timeout);
656
657 if (! message)
658 return GNUNET_SYSERR;
659
660 send_epoch_message (announcement->epoch, message);
661
664
665 return GNUNET_OK;
666}
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_hour_(void)
Return relative time of 1 hour.
Definition: time.c:187
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:486
const struct GNUNET_TIME_Relative get_epoch_private_key_timeout(const struct GNUNET_MESSENGER_Epoch *epoch)
Returns the current relative timeout for the private key (ECDHE) of a given epoch that limits the usa...
const struct GNUNET_CRYPTO_EcdhePrivateKey * get_epoch_private_key(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_TIME_Relative timeout)
Returns the asymmetric private key (ECDHE) from a handle for a given epoch that can be used for HPKE ...
void send_epoch_message(const struct GNUNET_MESSENGER_Epoch *epoch, struct GNUNET_MESSENGER_Message *message)
Sends a created and allocated message in a room of a given epoch enforcing the message gets interpret...
struct GNUNET_MESSENGER_Message * create_message_announcement(const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_CRYPTO_EcdhePrivateKey *private_key, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, const struct GNUNET_TIME_Relative timeout)
Creates and allocates a new announcement message for an announcement of a given epoch or group under ...
Private ECC key encoded for transmission.

References GNUNET_MESSENGER_EpochAnnouncement::announcement_expiration, create_message_announcement(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_key(), get_epoch_private_key(), get_epoch_private_key_timeout(), GNUNET_assert, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_get_hour_(), GNUNET_TIME_relative_is_zero(), GNUNET_TIME_relative_multiply(), GNUNET_YES, GNUNET_MESSENGER_EpochAnnouncement::identifier, key, send_epoch_message(), and timeout.

Referenced by generate_room_epoch_announcement(), handle_authorization_message(), handle_epoch_announcement(), and handle_epoch_announcement_access().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_epoch_announcement_appeal()

enum GNUNET_GenericReturnValue send_epoch_announcement_appeal ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_HashCode event 
)

Tries to send an appeal message by the client responding to a previous event in regards to a given epoch announcement requesting its secret key from other members.

Parameters
[in,out]announcementEpoch announcement
[in]eventHash of event message
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 686 of file messenger_api_epoch_announcement.c.

689{
690 const struct GNUNET_CRYPTO_EcdhePrivateKey *private_key;
692 struct GNUNET_HashCode event_hash;
693 struct GNUNET_MESSENGER_Message *message;
694
695 GNUNET_assert (announcement);
696
698 private_key = get_epoch_private_key (announcement->epoch,
699 timeout);
700
701 if (! private_key)
702 return GNUNET_SYSERR;
703
705
706 if ((! event) ||
708 membership->members
709 , event)))
710 {
711 if (get_epoch_announcement_members_count (announcement) <= 0)
712 return GNUNET_SYSERR;
713
716 &event_hash);
717
718 event = &event_hash;
719 }
720
721 message = create_message_appeal (event,
722 private_key,
723 timeout);
724
725 if (! message)
726 return GNUNET_SYSERR;
727
729 send_epoch_message (announcement->epoch, message);
730 return GNUNET_OK;
731}
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void set_epoch_announcement_appeal(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_TIME_Relative timeout)
Sets a specified timeout for a given epoch announcement of the client for its own appeal of the annou...
static enum GNUNET_GenericReturnValue it_store_any_event(void *cls, const struct GNUNET_HashCode *key, void *value)
uint32_t get_epoch_announcement_members_count(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the current amount of members of a given epoch announcement.
struct GNUNET_MESSENGER_Message * create_message_appeal(const struct GNUNET_HashCode *event, const struct GNUNET_CRYPTO_EcdhePrivateKey *private_key, const struct GNUNET_TIME_Relative timeout)
Creates and allocates a new appeal message for an epoch announcement using a specific private_key to ...
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * members

References create_message_appeal(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_members_count(), get_epoch_private_key(), get_epoch_private_key_timeout(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_relative_get_hour_(), GNUNET_YES, it_store_any_event(), GNUNET_MESSENGER_EpochMembership::members, GNUNET_MESSENGER_EpochAnnouncement::membership, send_epoch_message(), set_epoch_announcement_appeal(), and timeout.

Referenced by handle_epoch_announcement_delay(), and task_epoch_announcement_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_epoch_announcement_access()

enum GNUNET_GenericReturnValue send_epoch_announcement_access ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_HashCode event 
)

Tries to send an access message by the client responding to a previous event in regards to a given epoch announcement using its secret key.

Parameters
[in,out]announcementEpoch announcement
[in]eventHash of event message
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 735 of file messenger_api_epoch_announcement.c.

738{
739 struct GNUNET_MESSENGER_Room *room;
741 const struct GNUNET_MESSENGER_Message *appeal_message;
742 const struct GNUNET_CRYPTO_EcdhePublicKey *public_key;
743 struct GNUNET_MESSENGER_Message *message;
744
745 GNUNET_assert ((announcement) && (event));
746
747 room = announcement->epoch->room;
748 key = get_epoch_announcement_key (announcement);
749
750 if (! key)
751 return GNUNET_SYSERR;
752
753 appeal_message = get_room_message (room, event);
754
755 if (! appeal_message)
756 return GNUNET_SYSERR;
757
758 if (GNUNET_MESSENGER_KIND_APPEAL != appeal_message->header.kind)
759 return GNUNET_SYSERR;
760
762 membership->members,
763 &(appeal_message->
765 ))
766 return GNUNET_SYSERR;
767
768 public_key = &(appeal_message->body.appeal.key);
769 message = create_message_access (event,
770 public_key,
771 key);
772
773 if (! message)
774 return GNUNET_SYSERR;
775
776 send_epoch_message (announcement->epoch, message);
777 return GNUNET_OK;
778}
@ GNUNET_MESSENGER_KIND_APPEAL
The appeal kind.
struct GNUNET_MESSENGER_Message * create_message_access(const struct GNUNET_HashCode *event, const struct GNUNET_CRYPTO_EcdhePublicKey *public_key, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Creates and allocates a new access message to grant access to the shared_key of an announced epoch or...
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
struct GNUNET_CRYPTO_EcdhePublicKey key
The public key to receive access.
struct GNUNET_HashCode event
The hash of the linked announcement message event.
struct GNUNET_MESSENGER_MessageAppeal appeal

References GNUNET_MESSENGER_MessageBody::appeal, GNUNET_MESSENGER_Message::body, create_message_access(), GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_MessageAppeal::event, get_epoch_announcement_key(), get_room_message(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_MESSENGER_KIND_APPEAL, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_Message::header, key, GNUNET_MESSENGER_MessageAppeal::key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_Epoch::room, and send_epoch_message().

Referenced by handle_room_delayed_appeal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_epoch_announcement_revolution()

enum GNUNET_GenericReturnValue send_epoch_announcement_revolution ( struct GNUNET_MESSENGER_EpochAnnouncement announcement)

Tries to send a revolution message by the client for a given epoch announcement using its secret key.

Parameters
[in,out]announcementEpoch announcement
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 782 of file messenger_api_epoch_announcement.c.

784{
786 struct GNUNET_MESSENGER_Message *message;
787
788 GNUNET_assert (announcement);
789
790 key = get_epoch_announcement_key (announcement);
791
792 if (! key)
793 return GNUNET_SYSERR;
794
795 message = create_message_revolution (&(announcement->identifier),
796 key);
797
798 if (! message)
799 return GNUNET_SYSERR;
800
801 send_epoch_message (announcement->epoch, message);
802 return GNUNET_OK;
803}
struct GNUNET_MESSENGER_Message * create_message_revolution(const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Creates and allocates a new revolution message for an announced epoch or group selected by its identi...

References create_message_revolution(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_key(), GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, GNUNET_MESSENGER_EpochAnnouncement::identifier, key, and send_epoch_message().

Referenced by handle_epoch_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_epoch_announcement_authorization()

enum GNUNET_GenericReturnValue send_epoch_announcement_authorization ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_EpochGroup group,
const struct GNUNET_HashCode event 
)

Tries to send an authorization message by the client responding to a previous event in regards to a given epoch announcement using the secret key from a permitted epoch group.

Parameters
[in,out]announcementEpoch announcement
[in]groupEpoch group
[in]eventHash of event message
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 807 of file messenger_api_epoch_announcement.c.

813{
814 struct GNUNET_MESSENGER_Room *room;
816 const struct GNUNET_MESSENGER_Message *announcement_message;
817 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
818 const struct GNUNET_CRYPTO_SymmetricSessionKey *group_key;
819 struct GNUNET_MESSENGER_Message *message;
820
821 GNUNET_assert ((announcement) && (group) && (event));
822
823 room = group->epoch->room;
824 key = get_epoch_announcement_key (announcement);
825
826 if (! key)
827 return GNUNET_SYSERR;
828
829 if (! group->identifier.code.group_bit)
830 return GNUNET_SYSERR;
831
832 announcement_message = get_room_message (room, event);
833
834 if ((! announcement_message) ||
835 (GNUNET_MESSENGER_KIND_ANNOUNCEMENT != announcement_message->header.kind))
836 return GNUNET_SYSERR;
837
838 identifier = &(announcement_message->body.announcement.identifier);
839
840 if (0 != GNUNET_memcmp (&(announcement->identifier), identifier))
841 return GNUNET_SYSERR;
842
843 if (GNUNET_YES != verify_message_by_key (announcement_message, key))
844 return GNUNET_SYSERR;
845
846 group_key = get_epoch_group_key (group);
847
848 if (! group_key)
849 return GNUNET_SYSERR;
850
851 message = create_message_authorization (&(group->identifier),
852 event,
853 group_key,
854 key);
855
856 if (! message)
857 return GNUNET_SYSERR;
858
859 send_epoch_message (announcement->epoch, message);
860 return GNUNET_OK;
861}
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_group_key(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the secret key of a given epoch group or NULL.
enum GNUNET_GenericReturnValue verify_message_by_key(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Verifies the hmac of a given message body with a specific shared key.
struct GNUNET_MESSENGER_Message * create_message_authorization(const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_HashCode *event, const struct GNUNET_CRYPTO_SymmetricSessionKey *group_key, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Creates and allocates a new authorization message to grant access to the shared_key of a specific gro...
struct GNUNET_MESSENGER_Epoch * epoch
union GNUNET_MESSENGER_EpochIdentifier identifier
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_MESSENGER_MessageAnnouncement announcement
An epoch identifier unifies an epoch identifier code and its 256bit hash representation.

References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, create_message_authorization(), GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_announcement_key(), get_epoch_group_key(), get_room_message(), GNUNET_assert, GNUNET_memcmp, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_Epoch::room, send_epoch_message(), and verify_message_by_key().

Referenced by handle_epoch_announcement_access().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_epoch_announcement()

void handle_epoch_announcement ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash,
struct GNUNET_MESSENGER_Contact sender,
enum GNUNET_GenericReturnValue  sent 
)

Handles an announcement message with hash from its sender inside a given epoch announcement as first stage.

Parameters
[in,out]announcementEpoch announcement
[in]messageMessage
[in]hashHash of message
[in]senderSender of message
[in]sentSent flag

Definition at line 865 of file messenger_api_epoch_announcement.c.

871{
874
875 GNUNET_assert ((announcement) && (message) && (hash) && (sender));
876
877 key = get_epoch_announcement_key (announcement);
878
879 if (key)
880 {
881 if (GNUNET_OK != verify_message_by_key (message, key))
882 return;
883
884 cancel_room_actions_by (announcement->epoch->room,
886 &(announcement->epoch->hash),
887 &(announcement->identifier),
888 sender);
889
890 if ((GNUNET_YES == is_epoch_announcement_completed (announcement)) &&
891 (GNUNET_YES != is_epoch_announcement_member (announcement, sender)))
892 {
894 return;
895 }
896 }
897
899 hash,
900 message,
901 sender,
902 sent))
903 return;
904
905 if ((GNUNET_YES != sent) &&
907 {
908 const struct GNUNET_MESSENGER_Contact *contact;
909
910 contact = get_handle_contact (
911 get_room_handle (announcement->epoch->room),
912 get_room_key (announcement->epoch->room));
913
914 send_epoch_announcement (announcement);
915
917 get_message_timeout (message),
918 get_epoch_position_factor (announcement->epoch, contact,
919 announcement->membership));
920 }
921 else if (announcement->epoch->main_group)
923 get_message_timeout (message),
925 else
927
928 delay_room_action (announcement->epoch->room, hash, timeout);
929}
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
Definition: time.c:133
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply_double(struct GNUNET_TIME_Relative rel, double factor)
Multiply relative time by a given factor.
Definition: time.c:506
double get_epoch_position_factor(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns a relative member positon of a specific contact inside a given epoch in relation to its list ...
enum GNUNET_GenericReturnValue send_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Tries to send an announcement message by the client for a given epoch announcement using its secret k...
enum GNUNET_GenericReturnValue is_epoch_announcement_completed(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether a given epoch announcement is complete in terms of confirmed announcements from its m...
enum GNUNET_GenericReturnValue send_epoch_announcement_revolution(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Tries to send a revolution message by the client for a given epoch announcement using its secret key.
enum GNUNET_GenericReturnValue is_epoch_announcement_member(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is confirmed member of a given epoch announcement.
enum GNUNET_GenericReturnValue confirm_epoch_announcement_member(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact, enum GNUNET_GenericReturnValue sent)
Confirms an announcement message with its hash to a given epoch announcement as confirmation for a sp...
enum GNUNET_GenericReturnValue is_epoch_announcement_announced(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether the client has announced being part of a given epoch announcement owning its secret k...
double get_epoch_group_position_factor(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns a relative member positon of the client inside a given epoch group in relation to its list of...
struct GNUNET_MESSENGER_Contact * get_handle_contact(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Returns the contact of a given handle in a room identified by a given key.
struct GNUNET_TIME_Relative get_message_timeout(const struct GNUNET_MESSENGER_Message *message)
Return the relative timeout of the content from a given message that controls when a delayed handling...
void cancel_room_actions_by(struct GNUNET_MESSENGER_Room *room, enum GNUNET_MESSENGER_MessageKind kind, const struct GNUNET_HashCode *epoch_hash, const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_MESSENGER_Contact *contact)
Searches queued actions to handle messages of a specific message kind in a room with any delay and ca...
const struct GNUNET_HashCode * get_room_key(const struct GNUNET_MESSENGER_Room *room)
Return a the hash representation of a given room.
struct GNUNET_MESSENGER_Handle * get_room_handle(struct GNUNET_MESSENGER_Room *room)
Returns the messenger handle of the room.
void delay_room_action(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Enqueues delayed handling of a message in a room under a given hash once a specific delay has timed o...
struct GNUNET_MESSENGER_EpochGroup * main_group

References cancel_room_actions_by(), confirm_epoch_announcement_member(), delay_room_action(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_key(), get_epoch_group_position_factor(), get_epoch_position_factor(), get_handle_contact(), get_message_timeout(), get_room_handle(), get_room_key(), GNUNET_assert, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_OK, GNUNET_TIME_relative_get_zero_(), GNUNET_TIME_relative_multiply_double(), GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_EpochAnnouncement::identifier, is_epoch_announcement_announced(), is_epoch_announcement_completed(), is_epoch_announcement_member(), key, GNUNET_MESSENGER_Epoch::main_group, GNUNET_MESSENGER_EpochAnnouncement::membership, GNUNET_MESSENGER_Epoch::room, send_epoch_announcement(), send_epoch_announcement_revolution(), timeout, and verify_message_by_key().

Referenced by handle_announcement_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_epoch_announcement_delay()

void handle_epoch_announcement_delay ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash,
struct GNUNET_MESSENGER_Contact sender,
enum GNUNET_GenericReturnValue  sent 
)

Handles an announcement message with hash from its sender inside a given epoch announcement as second stage after custom delay.

Parameters
[in,out]announcementEpoch announcement
[in]messageMessage
[in]hashHash of message
[in]senderSender of message
[in]sentSent flag

Definition at line 933 of file messenger_api_epoch_announcement.c.

940{
942
943 GNUNET_assert ((announcement) && (message) && (hash) && (sender));
944
945 if (GNUNET_YES == is_room_public (announcement->epoch->room))
946 return;
947
948 if ((GNUNET_YES == sent) && (GNUNET_YES == announcement->valid))
950 announcement->epoch,
952
953 if ((get_epoch_announcement_key (announcement)) ||
954 (GNUNET_YES == is_epoch_announcement_appealed (announcement)))
955 return;
956
957 timeout = get_message_timeout (message);
958
960 return;
961
962 send_epoch_announcement_appeal (announcement, hash);
963}
void propose_epoch_group(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_TIME_Relative timeout)
Tries to propose a new group inside a given epoch that will automatically be formed by using the clie...
enum GNUNET_GenericReturnValue send_epoch_announcement_appeal(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
Tries to send an appeal message by the client responding to a previous event in regards to a given ep...
enum GNUNET_GenericReturnValue is_epoch_announcement_appealed(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether a given epoch announcement of the client is currently appealing for its secret key fr...
enum GNUNET_GenericReturnValue is_room_public(const struct GNUNET_MESSENGER_Room *room)
Returns whether a given room is public or using epoch keys to encrypt private traffic and sync those ...

References GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_key(), get_message_timeout(), GNUNET_assert, GNUNET_TIME_relative_get_hour_(), GNUNET_TIME_relative_is_zero(), GNUNET_YES, is_epoch_announcement_appealed(), is_room_public(), propose_epoch_group(), GNUNET_MESSENGER_Epoch::room, send_epoch_announcement_appeal(), timeout, and GNUNET_MESSENGER_EpochAnnouncement::valid.

Referenced by handle_room_delayed_announcement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_epoch_announcement_access()

void handle_epoch_announcement_access ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles an access message with hash from its sender inside a given epoch announcement.

Parameters
[in,out]announcementEpoch announcement
[in]messageMessage
[in]hashHash of message
[in]senderSender of message
[in]sentSent flag

Definition at line 967 of file messenger_api_epoch_announcement.c.

972{
973 const struct GNUNET_CRYPTO_EcdhePrivateKey *private_key;
974 struct GNUNET_CRYPTO_SymmetricSessionKey shared_key;
975 const struct GNUNET_MESSENGER_Message *appeal_message;
976
977 GNUNET_assert ((announcement) && (message) && (hash));
978
979 private_key = get_epoch_private_key (announcement->epoch,
981
982 if (! private_key)
983 {
985 "Private key for decrypting shared key is missing!\n");
986 return;
987 }
988
990 message, private_key, &shared_key))
991 return;
992
993 if (get_epoch_announcement_key (announcement))
994 return;
995
996 set_epoch_announcement_key (announcement, &shared_key, GNUNET_YES);
997
998 appeal_message = get_room_message (
999 announcement->epoch->room,
1000 &(message->body.access.event));
1001
1002 if ((announcement->epoch->main_group) &&
1003 (appeal_message) &&
1004 (GNUNET_MESSENGER_KIND_APPEAL == appeal_message->header.kind) &&
1006 announcement->epoch)) &&
1008 announcement->epoch->main_group, announcement)))
1010 announcement, announcement->epoch->main_group,
1011 &(appeal_message->body.appeal.event));
1012
1013 send_epoch_announcement (announcement);
1014}
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
enum GNUNET_GenericReturnValue send_epoch_announcement_authorization(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *event)
Tries to send an authorization message by the client responding to a previous event in regards to a g...
enum GNUNET_GenericReturnValue is_epoch_group_compatible(const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Epoch *epoch)
Returns whether a given epoch group is compatible with a specific epoch with its members.
enum GNUNET_GenericReturnValue is_epoch_group_missing_announcement(const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether any member of a given epoch group is missing in a provided epoch announcement.
enum GNUNET_GenericReturnValue extract_access_message_key(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_EcdhePrivateKey *key, struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Extracts the shared epoch or group key from an access message using the private ephemeral key from an...
struct GNUNET_HashCode event
The hash of the linked announcement or group message event.
struct GNUNET_MESSENGER_MessageAccess access

References GNUNET_MESSENGER_MessageBody::access, GNUNET_MESSENGER_MessageBody::appeal, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_MessageAppeal::event, GNUNET_MESSENGER_MessageAccess::event, extract_access_message_key(), get_epoch_announcement_key(), get_epoch_private_key(), get_room_message(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_NO, GNUNET_TIME_relative_get_hour_(), GNUNET_YES, GNUNET_MESSENGER_Message::header, is_epoch_group_compatible(), is_epoch_group_missing_announcement(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_Epoch::main_group, GNUNET_MESSENGER_Epoch::room, send_epoch_announcement(), send_epoch_announcement_authorization(), and set_epoch_announcement_key().

Referenced by handle_access_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_epoch_announcement_record()

void write_epoch_announcement_record ( struct GNUNET_MESSENGER_EpochAnnouncement announcement,
enum GNUNET_GenericReturnValue  deleted 
)

Writes/Deletes the GNS record of a given epoch announcement depending on a provided flag that states wether an existing record should be deleted.

Parameters
[in,out]announcementEpoch announcement
[in]deletedDeleted flag

Definition at line 1036 of file messenger_api_epoch_announcement.c.

1039{
1040 const struct GNUNET_MESSENGER_Handle *handle;
1041 const struct GNUNET_HashCode *key;
1042 const struct GNUNET_HashCode *hash;
1043 const struct GNUNET_ShortHashCode *identifier;
1044 const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key;
1045
1046 GNUNET_assert ((announcement) && (announcement->epoch));
1047
1048 handle = get_room_handle (announcement->epoch->room);
1049
1050 if (! handle)
1051 return;
1052
1053 key = get_room_key (announcement->epoch->room);
1054 hash = &(announcement->epoch->hash);
1055 identifier = &(announcement->identifier.hash);
1056
1057 if (GNUNET_YES == deleted)
1058 {
1059 shared_key = NULL;
1060 }
1061 else
1062 {
1063 shared_key = announcement->shared_key;
1064
1065 if (! shared_key)
1066 return;
1067 }
1068
1070 handle, key, hash, identifier, shared_key,
1071 GNUNET_YES == announcement->valid?
1075 announcement,
1076 &(announcement->query));
1077}
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
@ GNUNET_MESSENGER_FLAG_EPOCH_NONE
The none flag.
@ GNUNET_MESSENGER_FLAG_EPOCH_VALID
The valid flag.
static void cont_write_epoch_announcement_record(void *cls, enum GNUNET_ErrorCode ec)
enum GNUNET_GenericReturnValue store_handle_epoch_key(const struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_HashCode *hash, const struct GNUNET_ShortHashCode *identifier, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, uint32_t flags, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls, struct GNUNET_NAMESTORE_QueueEntry **query)
Stores/deletes a shared_key for a given room from a handle identified by its key in an epoch with cer...
A 256-bit hashcode.

References cont_write_epoch_announcement_record(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_room_handle(), get_room_key(), GNUNET_assert, GNUNET_MESSENGER_FLAG_EPOCH_NONE, GNUNET_MESSENGER_FLAG_EPOCH_VALID, GNUNET_YES, handle, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_EpochAnnouncement::identifier, key, GNUNET_MESSENGER_EpochAnnouncement::query, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_EpochAnnouncement::shared_key, store_handle_epoch_key(), and GNUNET_MESSENGER_EpochAnnouncement::valid.

Referenced by invalidate_epoch_announcement(), it_announcement_store_key(), and set_epoch_announcement_key().

Here is the call graph for this function:
Here is the caller graph for this function: