*/
static void
t_hmac (struct MeshTunnel3 *t, const void *plaintext, size_t size, uint32_t iv,
- int outgoing, struct GNUNET_HashCode *hmac)
+ int outgoing, struct GNUNET_MeshHash *hmac)
{
struct GNUNET_CRYPTO_AuthKey auth_key;
static const char ctx[] = "mesh authentication key";
struct GNUNET_CRYPTO_SymmetricSessionKey *key;
+ struct GNUNET_HashCode hash;
key = outgoing ? &t->e_key : &t->d_key;
GNUNET_CRYPTO_hmac_derive_key (&auth_key, key,
key, sizeof (*key),
ctx, sizeof (ctx),
NULL);
- GNUNET_CRYPTO_hmac (&auth_key, plaintext, size, hmac);
+ GNUNET_CRYPTO_hmac (&auth_key, plaintext, size, &hash);
+ memcpy (hmac, &hash, sizeof (*hmac));
}
char cbuf [payload_size];
struct GNUNET_MessageHeader *msgh;
unsigned int off;
- struct GNUNET_HashCode hmac;
+ struct GNUNET_MeshHash hmac;
decrypted_size = t_decrypt (t, cbuf, &msg[1], payload_size, msg->iv);
t_hmac (t, &msg[1], payload_size, msg->iv, GNUNET_NO, &hmac);
- if (0 != memcmp (&hmac, &msg->hmac, sizeof (struct GNUNET_HashCode)))
+ if (0 != memcmp (&hmac, &msg->hmac, sizeof (hmac)))
{
/* checksum failed */
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
GMT_use_path (struct MeshTunnel3 *t, struct MeshPeerPath *p)
{
struct MeshConnection *c;
- struct GNUNET_HashCode cid;
+ struct GNUNET_MeshHash cid;
unsigned int own_pos;
if (NULL == t || NULL == p)
return NULL;
}
- GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_NONCE, &cid);
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, &cid, sizeof (cid));
c = GMC_new (&cid, t, p, own_pos);
if (NULL == c)
{