* (excluding this value itself) will be encrypted and authenticated.
* ENCRYPTED_HEADER_SIZE must be set to the offset of the *next* field.
*/
- GNUNET_HashCode hmac;
+ struct GNUNET_HashCode hmac;
/**
* Sequence number, in network byte order. This field
GNUNET_CRYPTO_AesSessionKey),
kx->public_key,
&skm->encrypted_key));
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Encrypting key %x for %s resulting in message %u (origin: %s)\n",
(unsigned int) GNUNET_CRYPTO_crc32_n (&kx->encrypt_key, sizeof (struct GNUNET_CRYPTO_AesSessionKey)),
GNUNET_i2s (&kx->peer),
1, GNUNET_NO);
GSC_SESSIONS_end (&kx->peer);
kx->status = KX_STATE_DOWN;
+ send_key (kx);
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending KEEPALIVE to `%s'\n",
{
struct GSC_KeyExchangeInfo *kx = cls;
+ GNUNET_break (KX_STATE_UP == kx->status);
kx->status = KX_STATE_REKEY;
kx->set_key_retry_frequency = INITIAL_SET_KEY_RETRY_FREQUENCY;
kx->retry_set_key_task =
{
const struct EncryptedMessage *m;
struct EncryptedMessage *pt; /* plaintext */
- GNUNET_HashCode ph;
+ struct GNUNET_HashCode ph;
uint32_t snum;
struct GNUNET_TIME_Absolute t;
struct GNUNET_CRYPTO_AesInitializationVector iv;
kx->decrypt_key_created);
GNUNET_CRYPTO_hmac (&auth_key, &m->sequence_number,
size - ENCRYPTED_HEADER_SIZE, &ph);
- if (0 != memcmp (&ph, &m->hmac, sizeof (GNUNET_HashCode)))
+ if (0 != memcmp (&ph, &m->hmac, sizeof (struct GNUNET_HashCode)))
{
/* checksum failed */
GNUNET_break_op (0);
* @param client who sent us the message (struct GSC_KeyExchangeInfo)
* @param m the message
*/
-static void
+static int
deliver_message (void *cls, void *client, const struct GNUNET_MessageHeader *m)
{
struct DeliverMessageContext *dmc = client;
case GNUNET_MESSAGE_TYPE_CORE_BINARY_TYPE_MAP:
case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP:
GSC_SESSIONS_set_typemap (dmc->peer, m);
- return;
+ return GNUNET_OK;
default:
GSC_CLIENTS_deliver_message (dmc->peer, dmc->atsi, dmc->atsi_count, m,
ntohs (m->size),
sizeof (struct GNUNET_MessageHeader),
GNUNET_CORE_OPTION_SEND_HDR_INBOUND);
}
+ return GNUNET_OK;
}