From 24677f5260fe910e899f9efc9ec70498e0109151 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 27 Apr 2015 19:14:28 +0000 Subject: [PATCH] - doxygen --- src/cadet/gnunet-service-cadet_tunnel.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 910ee255b..0ff474454 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -849,6 +849,14 @@ t_encrypt (struct CadetTunnel *t, void *dst, const void *src, } +/** + * Generate a new key with a HMAC mechanism from the existing chain key. + * + * @param ax Axolotl context. + * @param key[out] Derived key. + * @param source Source key material (data to HMAC). + * @param len Length of @a source. + */ void t_ax_hmac_hash (struct CadetTunnelAxolotl *ax, struct GNUNET_CRYPTO_SymmetricSessionKey *key, @@ -867,6 +875,7 @@ t_ax_hmac_hash (struct CadetTunnelAxolotl *ax, &hash, sizeof (hash)); } + /** * Encrypt daforce_newest_keyta with the tunnel key. * @@ -897,17 +906,17 @@ t_ax_encrypt (struct CadetTunnel *t, void *dst, const void *src, size_t size) t_ax_hmac_hash (ax, &MK, "0", 1); GNUNET_CRYPTO_symmetric_derive_iv (&iv, &MK, NULL, 0, NULL); - #if DUMP_KEYS_TO_STDERR LOG (GNUNET_ERROR_TYPE_INFO, " ENC with key %s\n", GNUNET_h2s ((struct GNUNET_HashCode *) &MK)); #endif - LOG (GNUNET_ERROR_TYPE_DEBUG, " t_encrypt IV derived\n"); + out_size = GNUNET_CRYPTO_symmetric_encrypt (src, size, &MK, &iv, dst); - LOG (GNUNET_ERROR_TYPE_DEBUG, " t_encrypt end\n"); t_ax_hmac_hash (ax, &ax->CKs, "1", 1); + LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt end\n"); + return out_size; } -- 2.25.1