]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Minor AEAD patch cleanup
authorSteffan Karger <steffan@karger.me>
Sun, 21 Feb 2016 01:08:11 +0000 (02:08 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 21 Feb 2016 12:25:52 +0000 (13:25 +0100)
 * Remove stale function declaration.
   This slipped into the AEAD cipher modes patch, but the function is
   now implemented as a static function is ssl.c.
 * Add ASSERT() to ensure frame is not NULL.
 * Fix "ENCRYPT TO" log message in openvpn_encrypt_aead().

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1456016892-8671-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11233
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto.c
src/openvpn/crypto.h

index e8ab27a8fbae6e1038973bf9e0d0f49b1dde1140..6d9c119414c1fc4628d837751f7ed0229df3bd8b 100644 (file)
@@ -161,10 +161,10 @@ openvpn_encrypt_aead (struct buffer *buf, struct buffer work,
   /* Write authentication tag */
   ASSERT (cipher_ctx_get_tag (ctx->cipher, mac_out, mac_len));
 
-  dmsg (D_PACKET_CONTENT, "ENCRYPT TO: %s", format_hex (BPTR (buf), BLEN (buf), 80, &gc));
-
   *buf = work;
 
+  dmsg (D_PACKET_CONTENT, "ENCRYPT TO: %s", format_hex (BPTR (buf), BLEN (buf), 80, &gc));
+
 cleanup:
   gc_free (&gc);
   return;
@@ -397,6 +397,7 @@ openvpn_decrypt_aead (struct buffer *buf, struct buffer work,
   gc_init (&gc);
 
   ASSERT (opt);
+  ASSERT (frame);
   ASSERT (buf->len > 0);
   ASSERT (ctx->cipher);
   ASSERT (cipher_kt_mode_aead (cipher_kt));
index 14b6ab7cb0319545f9ede811eefbf9c2abfc180f..d3e08c1e6da7646c50abdf2f7d8a60e10422f320 100644 (file)
@@ -311,17 +311,6 @@ void free_key_ctx (struct key_ctx *ctx);
 
 void free_key_ctx_bi (struct key_ctx_bi *ctx);
 
-/**
- * Set an implicit IV for a key context.
- *
- * @param ctx  The key context to update
- * @param iv   The implicit IV to load into ctx
- * @param len  The length (in bytes) of iv
- */
-bool key_ctx_set_implicit_iv (struct key_ctx *ctx, const uint8_t *iv,
-    size_t len);
-
-
 
 /**************************************************************************/
 /** @name Functions for performing security operations on data channel packets