300#define member_size(type, member) sizeof(((type*) NULL)->member)
554 uint16_t minimum_size;
580 if (kind_size > padding)
588#define max(x, y) (x > y? x : y)
593 static uint16_t usual_padding = 0;
594 uint16_t padded_length;
599 padded_length =
max (
617#define min(x, y) (x < y? x : y)
619#define encode_step_ext(dst, offset, src, size) do { \
620 GNUNET_memcpy (dst + offset, src, size); \
624#define encode_step(dst, offset, src) do { \
625 encode_step_ext (dst, offset, src, sizeof(*src)); \
628#define encode_step_key(dst, offset, src, length) do { \
629 ssize_t result = GNUNET_CRYPTO_write_public_key_to_buffer ( \
630 src, dst + offset, length - offset); \
637#define encode_step_signature(dst, offset, src, length) do { \
638 ssize_t result = GNUNET_CRYPTO_write_signature_to_buffer ( \
639 src, dst + offset, length - offset); \
653 uint32_t value0, value1;
823 if (offset >= length)
828 uint16_t used_padding;
830 padding = length - offset;
831 used_padding =
sizeof(padding) +
sizeof(
char);
835 buffer[offset++] =
'\0';
837 if (padding > used_padding)
839 padding - used_padding);
876 length, buffer, offset);
891 offset =
sizeof(hash);
899 buffer +
sizeof(hash),
900 length -
sizeof(hash),
907#define decode_step_ext(src, offset, dst, size) do { \
908 GNUNET_memcpy (dst, src + offset, size); \
912#define decode_step(src, offset, dst) do { \
913 decode_step_ext (src, offset, dst, sizeof(*dst)); \
916#define decode_step_malloc(src, offset, dst, size, zero) do { \
917 dst = GNUNET_malloc (size + zero); \
918 if (zero) dst[size] = 0; \
919 decode_step_ext (src, offset, dst, size); \
922#define decode_step_key(src, offset, dst, length) do { \
923 enum GNUNET_GenericReturnValue result; \
925 result = GNUNET_CRYPTO_read_public_key_from_buffer ( \
926 src + offset, length - offset, dst, &read); \
927 if (GNUNET_SYSERR == result) \
941 uint32_t value0, value1;
947 GNUNET_memcpy (&padding, buffer + length -
sizeof(padding),
sizeof(padding));
949 if (padding > length - offset)
954 end_zero = length - padding;
956 if ((padding) && (buffer[end_zero] !=
'\0'))
1007 if (length > offset)
1016 if (length > offset)
1022 if (length > offset)
1047 if (length > offset)
1057 if (length > offset)
1061 length - offset, 0);
1072 if (length > offset)
1087 if (length > offset)
1112 if (length > offset)
1193 count = length - offset;
1216 &(message->
body), length, buffer, offset);
1237 offset =
sizeof(hash);
1245 buffer +
sizeof(hash),
1246 length -
sizeof(hash),
1302 signature.
purpose.
size = htonl (
sizeof(signature));
1311 uint16_t offset = 0;
1336 signature.
purpose.
size = htonl (
sizeof (signature));
1347 uint16_t offset = 0;
1473 signature.
purpose.
size = htonl (
sizeof(signature));
1496 signature.
purpose.
size = htonl (
sizeof(signature));
1554 uint16_t length, padded_length, encoded_length;
1586 strlen (
"messenger"),
1588 (
const uint8_t*)
data,
1590 (uint8_t*) message->
body.
1615 uint16_t padded_length, encoded_length;
1626 "Message length too short to decrypt!\n");
1641 (uint8_t*)
"messenger",
1642 strlen (
"messenger"),
1661 "Decoding decrypted message failed!\n");
1700 uint16_t data_length;
1725 uint16_t length, padded_length;
1798 uint16_t padded_length;
1841 "Decrypted message does not match HMAC!\n");
1854 "Decoding decrypted message failed!\n");
1872 uint16_t data_length;
1885 "Decoding decrypted message failed!\n");
1906 (uint8_t*)
"messenger",
1907 strlen (
"messenger"),
1911 (uint8_t*) shared_key,
1978 switch (message->header.kind)
2015 uint16_t length, padded_length;
2022 "Packing message kind=%u and sender: %s\n",
2032 buffer = (
char*) &(header[1]);
2047 sign (cls, message, length, buffer, hash);
struct GNUNET_MQ_Envelope * env
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
static uint64_t timestamp(void)
Get current timestamp.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static int result
Global testing status.
static void cleanup()
Cleanup task.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
static enum @44 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
#define GNUNET_SIGNATURE_PURPOSE_CHAT_MESSAGE
Signature of a chat message.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_sign_by_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
Sign a given block with a specific purpose using the host's peer identity.
void GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, void *buffer, size_t length)
Fill block with a random values.
ssize_t GNUNET_CRYPTO_symmetric_encrypt(const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result)
Encrypt a block using a symmetric sessionkey.
void GNUNET_CRYPTO_symmetric_derive_iv(struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, const void *salt, size_t salt_len,...)
Derive an IV.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_verify_peer_identity(uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_PeerIdentity *identity)
Verify a given signature with a peer's identity.
ssize_t GNUNET_CRYPTO_symmetric_decrypt(const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result)
Decrypt a given block using a symmetric sessionkey.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
@ GNUNET_CRYPTO_QUALITY_NONCE
Randomness for IVs etc.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void GNUNET_CRYPTO_hmac(const struct GNUNET_CRYPTO_AuthKey *key, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac)
Calculate HMAC of a message (RFC 2104)
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
void GNUNET_CRYPTO_hmac_derive_key(struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len,...)
Derive an authentication key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_open_oneshot(const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const uint8_t *info, size_t info_len, const uint8_t *aad, size_t aad_len, const uint8_t *ct, size_t ct_len, uint8_t *pt, unsigned long long *pt_len)
RFC9180 HPKE encryption.
ssize_t GNUNET_CRYPTO_read_signature_from_buffer(struct GNUNET_CRYPTO_Signature *sig, const void *buffer, size_t len)
Reads a GNUNET_CRYPTO_Signature from a compact buffer.
ssize_t GNUNET_CRYPTO_public_key_get_length(const struct GNUNET_CRYPTO_PublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_PublicKey.
#define GNUNET_log(kind,...)
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_seal_oneshot(const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const uint8_t *info, size_t info_len, const uint8_t *aad, size_t aad_len, const uint8_t *pt, size_t pt_len, uint8_t *ct, unsigned long long *ct_len)
RFC9180 HPKE encryption.
#define GNUNET_be32toh(x)
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_sk_to_x25519(const struct GNUNET_CRYPTO_PrivateKey *sk, struct GNUNET_CRYPTO_EcdhePrivateKey *x25519)
Convert a GNUnet identity key to a key sutiable for HPKE (X25519)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
ssize_t GNUNET_CRYPTO_signature_get_length(const struct GNUNET_CRYPTO_Signature *sig)
Get the compacted length of a GNUNET_CRYPTO_Signature.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_pk_to_x25519(const struct GNUNET_CRYPTO_PublicKey *pk, struct GNUNET_CRYPTO_EcdhePublicKey *x25519)
Convert a GNUnet identity key to a key sutiable for HPKE (X25519)
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_CRYPTO_sign(priv, ps, sig)
Sign a given block with GNUNET_CRYPTO_PrivateKey.
#define GNUNET_CRYPTO_signature_verify(purp, ps, sig, pub)
Verify a given signature with GNUNET_CRYPTO_PublicKey.
#define GNUNET_htobe32(x)
#define GNUNET_PACKED
gcc-ism to get packed structs.
#define GNUNET_CRYPTO_HPKE_SEAL_ONESHOT_OVERHEAD_BYTES
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MESSENGER_AUTHORIZATION_KEY_BYTES
#define GNUNET_MESSENGER_ACCESS_KEY_BYTES
GNUNET_MESSENGER_MessageKind
Enum for the different supported kinds of messages.
#define GNUNET_MESSENGER_EPOCH_NONCE_BYTES
#define GNUNET_MESSENGER_SECRET_IV_BYTES
#define GNUNET_MESSENGER_KIND_MAX
@ GNUNET_MESSENGER_KIND_INFO
The info kind.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_INVITE
The invite kind.
@ GNUNET_MESSENGER_KIND_AUTHORIZATION
The authorization kind.
@ GNUNET_MESSENGER_KIND_ANNOUNCEMENT
The announcement kind.
@ GNUNET_MESSENGER_KIND_PRIVATE
The private kind.
@ GNUNET_MESSENGER_KIND_TAG
The tag kind.
@ GNUNET_MESSENGER_KIND_FILE
The file kind.
@ GNUNET_MESSENGER_KIND_APPEAL
The appeal kind.
@ GNUNET_MESSENGER_KIND_REQUEST
The request kind.
@ GNUNET_MESSENGER_KIND_NAME
The name kind.
@ GNUNET_MESSENGER_KIND_ACCESS
The access kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_TALK
The talk kind.
@ GNUNET_MESSENGER_KIND_REVOLUTION
The revolution kind.
@ GNUNET_MESSENGER_KIND_PEER
The peer kind.
@ GNUNET_MESSENGER_KIND_UNKNOWN
The unknown kind.
@ GNUNET_MESSENGER_KIND_TRANSCRIPT
The transcript kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_TEXT
The text kind.
@ GNUNET_MESSENGER_KIND_SECRET
The secret kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_SUBSCRIBTION
The subscribtion kind.
@ GNUNET_MESSENGER_KIND_DELETION
The deletion kind.
@ GNUNET_MESSENGER_KIND_CONNECTION
The connection kind.
@ GNUNET_MESSENGER_KIND_TICKET
The ticket kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_GROUP
The group kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MESSAGE_TYPE_CADET_CLI
Traffic (net-cat style) used by the Command Line Interface.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_minute_(void)
Return relative time of 1 minute.
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?
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
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.
static void destroy_message_body(enum GNUNET_MESSENGER_MessageKind kind, struct GNUNET_MESSENGER_MessageBody *body)
#define decode_step(src, offset, dst)
#define encode_step_ext(dst, offset, src, size)
static uint16_t get_short_message_size(const struct GNUNET_MESSENGER_ShortMessage *message, enum GNUNET_GenericReturnValue include_body)
enum GNUNET_GenericReturnValue verify_message(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_PublicKey *key)
Verifies the signature of a given message and its hash with a specific public key.
static uint16_t get_message_body_kind_size(enum GNUNET_MESSENGER_MessageKind kind)
void encode_message(const struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, enum GNUNET_GenericReturnValue include_header)
Encodes a given message into a buffer of a maximal length in bytes.
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 sign_message(struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_PrivateKey *key)
Signs the hash of a message with a given private key and writes the signature into the buffer as well...
enum GNUNET_GenericReturnValue is_service_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a specific kind of message contains service critical information.
enum GNUNET_GenericReturnValue encrypt_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_PublicKey *key)
Encrypts a message using a given public key and replaces its body and kind with the now private encry...
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.
static uint16_t get_message_body_size(enum GNUNET_MESSENGER_MessageKind kind, const struct GNUNET_MESSENGER_MessageBody *body)
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
static void fold_short_message(const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_ShortMessage *shortened)
#define decode_step_key(src, offset, dst, length)
static uint16_t calc_padded_length(uint16_t length)
enum GNUNET_GenericReturnValue filter_message_sending(const struct GNUNET_MESSENGER_Message *message)
Returns whether a specific kind of message should be sent by a client.
#define decode_step_malloc(src, offset, dst, size, zero)
#define encode_step(dst, offset, src)
enum GNUNET_GenericReturnValue extract_authorization_message_key(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Extracts the shared epoch or group key from an authorization message using a previously exchanged sha...
const uint16_t encryption_overhead
static void encode_message_body(enum GNUNET_MESSENGER_MessageKind kind, const struct GNUNET_MESSENGER_MessageBody *body, uint16_t length, char *buffer, uint16_t offset)
enum GNUNET_GenericReturnValue is_peer_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a specific kind of message can be sent by the service without usage of a clients priv...
static void encode_short_message(const struct GNUNET_MESSENGER_ShortMessage *message, uint16_t length, char *buffer)
static enum GNUNET_GenericReturnValue decode_short_message(struct GNUNET_MESSENGER_ShortMessage *message, uint16_t length, const char *buffer)
const struct GNUNET_ShortHashCode * get_message_discourse(const struct GNUNET_MESSENGER_Message *message)
Returns the discourse hash of a message depending on its kind.
enum GNUNET_GenericReturnValue is_epoch_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a certain kind of message from storage contains some specific details that might be r...
enum GNUNET_GenericReturnValue verify_message_by_peer(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_PeerIdentity *identity)
Verifies the signature of a given message and its hash with a specific peer's identity.
void hash_message(const struct GNUNET_MESSENGER_Message *message, uint16_t length, const char *buffer, struct GNUNET_HashCode *hash)
Calculates a hash of a given buffer with a length in bytes from a message.
struct GNUNET_MESSENGER_Message * create_message(enum GNUNET_MESSENGER_MessageKind kind)
Creates and allocates a new message with a specific kind.
struct GNUNET_MQ_Envelope * pack_message(struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, const GNUNET_MESSENGER_SignFunction sign, enum GNUNET_MESSENGER_PackMode mode, const void *cls)
Encodes the message to pack it into a newly allocated envelope if mode is equal to GNUNET_MESSENGER_P...
#define decode_step_ext(src, offset, dst, size)
static void unfold_short_message(struct GNUNET_MESSENGER_ShortMessage *shortened, struct GNUNET_MESSENGER_Message *message)
enum GNUNET_GenericReturnValue decrypt_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_PrivateKey *key)
Decrypts a private message using a given private key and replaces its body and kind with the inner en...
#define encode_step_signature(dst, offset, src, length)
static uint16_t calc_usual_padding()
static uint16_t decode_message_body(enum GNUNET_MESSENGER_MessageKind *kind, struct GNUNET_MESSENGER_MessageBody *body, uint16_t length, const char *buffer, uint16_t offset)
static void calc_message_hmac(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, struct GNUNET_HashCode *hmac)
enum GNUNET_GenericReturnValue decrypt_secret_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Decrypts a secret message using a given shared key and replaces its body and kind with the inner encr...
void sign_message_by_key(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Signs the message body via it's own hmac with a specific shared key.
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...
void copy_message_header(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_MESSENGER_MessageHeader *header)
Copy message header details from another message to a given message.
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
uint16_t get_message_kind_size(enum GNUNET_MESSENGER_MessageKind kind, enum GNUNET_GenericReturnValue include_header)
Returns the minimal size in bytes to encode a message of a specific kind.
struct GNUNET_MESSENGER_Message * transcribe_message(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_PublicKey *key)
Transcribes a message as a new transcript message using a given public key from the recipient of the ...
void sign_message_by_peer(struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash, const struct GNUNET_CONFIGURATION_Handle *cfg)
Signs the hash of a message with the peer identity of a given config and writes the signature into th...
enum GNUNET_GenericReturnValue read_transcript_message(struct GNUNET_MESSENGER_Message *message)
Read the original message from a transcript message and replaces its body and kind with the inner enc...
#define encode_step_key(dst, offset, src, length)
enum GNUNET_GenericReturnValue is_message_session_bound(const struct GNUNET_MESSENGER_Message *message)
Returns if the message should be bound to a member session.
uint16_t get_message_size(const struct GNUNET_MESSENGER_Message *message, enum GNUNET_GenericReturnValue include_header)
Returns the exact size in bytes to encode a given message.
enum GNUNET_GenericReturnValue decode_message(struct GNUNET_MESSENGER_Message *message, uint16_t length, const char *buffer, enum GNUNET_GenericReturnValue include_header, uint16_t *padding)
Decodes a message from a given buffer of a maximal length in bytes.
enum GNUNET_GenericReturnValue encrypt_secret_message(struct GNUNET_MESSENGER_Message *message, const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Encrypts a message using a given shared key from an announcement of an epoch and replaces its body an...
#define member_size(type, member)
void cleanup_message(struct GNUNET_MESSENGER_Message *message)
Frees the messages body memory.
#define GNUNET_MESSENGER_MAX_MESSAGE_SIZE
GNUNET_MESSENGER_PackMode
@ GNUNET_MESSENGER_PACK_MODE_ENVELOPE
#define GNUNET_MESSENGER_PADDING_LEVEL0
#define GNUNET_MESSENGER_PADDING_MIN
void(* GNUNET_MESSENGER_SignFunction)(const void *cls, struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash)
#define GNUNET_MESSENGER_PADDING_LEVEL2
#define GNUNET_MESSENGER_PADDING_LEVEL1
type for (message) authentication keys
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
uint32_t size
How many bytes does this signature sign? (including this purpose header); in network byte order (!...
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
uint32_t type
Type of signature.
struct GNUNET_HashCode hmac
The hmac of the access.
struct GNUNET_HashCode event
The hash of the linked announcement or group message event.
uint8_t key[sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey)+16+sizeof(struct GNUNET_CRYPTO_HpkeEncapsulation)]
The encrypted group or epoch key.
union GNUNET_MESSENGER_EpochNonce nonce
The nonce of the announcement.
struct GNUNET_HashCode hmac
The hmac of the announcement.
struct GNUNET_TIME_RelativeNBO timeout
The timeout of the announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_CRYPTO_EcdhePublicKey key
The public key to appeal access.
struct GNUNET_CRYPTO_EcdhePublicKey key
The public key to receive access.
struct GNUNET_TIME_RelativeNBO timeout
The timeout of the appeal.
struct GNUNET_HashCode event
The hash of the linked announcement message event.
struct GNUNET_HashCode event
The hash of the linked group message event.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_HashCode hmac
The hmac of the authorization.
uint8_t key[sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey)]
The encrypted group or epoch key.
The unified body of a GNUNET_MESSENGER_Message.
struct GNUNET_MESSENGER_MessageAnnouncement announcement
struct GNUNET_MESSENGER_MessageSubscribtion subscribtion
struct GNUNET_MESSENGER_MessageGroup group
struct GNUNET_MESSENGER_MessageSecret secret
struct GNUNET_MESSENGER_MessageDeletion deletion
struct GNUNET_MESSENGER_MessagePrivate privacy
struct GNUNET_MESSENGER_MessageConnection connection
struct GNUNET_MESSENGER_MessageText text
struct GNUNET_MESSENGER_MessageRequest request
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_MESSENGER_MessageName name
struct GNUNET_MESSENGER_MessageLeave leave
struct GNUNET_MESSENGER_MessageTranscript transcript
struct GNUNET_MESSENGER_MessageRevolution revolution
struct GNUNET_MESSENGER_MessageTalk talk
struct GNUNET_MESSENGER_MessageFile file
struct GNUNET_MESSENGER_MessageTag tag
struct GNUNET_MESSENGER_MessageKey key
struct GNUNET_MESSENGER_MessageInvite invite
struct GNUNET_MESSENGER_MessageAccess access
struct GNUNET_MESSENGER_MessageAuthorization authorization
struct GNUNET_MESSENGER_MessageAppeal appeal
struct GNUNET_MESSENGER_MessageMiss miss
struct GNUNET_MESSENGER_MessagePeer peer
struct GNUNET_MESSENGER_MessageJoin join
struct GNUNET_MESSENGER_MessageTicket ticket
struct GNUNET_MESSENGER_MessageInfo info
uint32_t amount
The amount of connections of a peer.
uint32_t flags
The flags about the connections of a peer.
struct GNUNET_HashCode hash
The hash of the message to delete.
struct GNUNET_TIME_RelativeNBO delay
The delay of the delete operation to get processed.
char * uri
The uri of the encrypted file.
struct GNUNET_HashCode hash
The hash of the original file.
struct GNUNET_CRYPTO_SymmetricSessionKey key
The symmetric key to decrypt the file.
char name[NAME_MAX]
The name of the original file.
struct GNUNET_TIME_RelativeNBO timeout
The timeout of the group formation.
struct GNUNET_HashCode initiator
The hash of the initiator group announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_HashCode partner
The hash of the partner group announcement.
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
uint32_t messenger_version
The version of GNUnet Messenger API.
union GNUNET_MESSENGER_RoomKey key
The hash identifying the port of the room.
struct GNUNET_PeerIdentity door
The peer identity of an open door to a room.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_CRYPTO_PublicKey key
The senders public key to verify its signatures.
struct GNUNET_CRYPTO_PublicKey key
The new public key which replaces the current senders public key.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_HashCode previous
The hash of a second previous message.
struct GNUNET_HashCode epochs[2]
The previous epochs the message was sent from.
struct GNUNET_PeerIdentity peer
The peer identity of a disconnected door to a room.
char * name
The new name which replaces the current senders name.
struct GNUNET_PeerIdentity peer
The peer identity of the sender opening a room.
uint16_t length
The length of the encrypted message.
char * data
The data of the encrypted message.
struct GNUNET_HashCode hash
The hash of the requested message.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
union GNUNET_MESSENGER_EpochNonce nonce
The nonce of the revolution.
struct GNUNET_HashCode hmac
The hmac of the revolution.
uint8_t iv[sizeof(struct GNUNET_CRYPTO_SymmetricInitializationVector)]
The IV of the secret message.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
char * data
The data of the encrypted message.
struct GNUNET_HashCode hmac
The hmac of the encrypted message.
uint16_t length
The length of the encrypted message.
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
struct GNUNET_HashCode hash
uint32_t flags
The flags about the subscription to a discourse.
struct GNUNET_TIME_RelativeNBO time
The time window of the subscription.
struct GNUNET_ShortHashCode discourse
The hash of the discourse to subscribtion.
char * tag
The custom tag.
struct GNUNET_HashCode hash
The hash of the message to tag.
uint16_t length
The length of the talk message data.
char * data
The data of the talk message.
struct GNUNET_ShortHashCode discourse
The hash of the discourse to talk.
char * text
The containing text.
char * identifier
The identifier of a ticket.
uint16_t length
The length of the transcribed message.
struct GNUNET_HashCode hash
The hash of the original message.
struct GNUNET_CRYPTO_PublicKey key
The key from the recipient of the original message.
char * data
The data of the transcribed message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_MessageBody body
enum GNUNET_MESSENGER_MessageKind kind
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
An epoch identifier unifies an epoch identifier code and its 256bit hash representation.