summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ah_encrypt.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-03-20 16:07:09 +0100
committerNeale Ranns <nranns@cisco.com>2019-03-20 17:23:04 +0000
commitb966e8bfdd3c63e2436ab6e5d250c8b1bf4dd102 (patch)
tree7f3faba13dd462adc577bdc9798da99c209bee9c /src/vnet/ipsec/ah_encrypt.c
parentc372dc2190f2376f9b816f71120354fd53732fa7 (diff)
ipsec: keep crypto data inside SA
Change-Id: Ie8986bd3652d25c4befe681cea77df95aba37ebc Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ah_encrypt.c')
-rw-r--r--src/vnet/ipsec/ah_encrypt.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c
index ce930bd5529..c6dbe57f73b 100644
--- a/src/vnet/ipsec/ah_encrypt.c
+++ b/src/vnet/ipsec/ah_encrypt.c
@@ -152,7 +152,7 @@ ah_encrypt_inline (vlib_main_t * vm,
adv = -sizeof (ah_header_t);
}
- icv_size = im->integ_algs[sa0->integ_alg].trunc_size;
+ icv_size = sa0->integ_trunc_size;
const u8 padding_len = ah_calc_icv_padding_len (icv_size, is_ip6);
adv -= padding_len;
/* transport mode save the eth header before it is overwritten */
@@ -265,11 +265,8 @@ ah_encrypt_inline (vlib_main_t * vm,
sizeof (ah_header_t);
clib_memset (digest, 0, icv_size);
- unsigned size = hmac_calc (vm, sa0->integ_alg, sa0->integ_key.data,
- sa0->integ_key.len,
- vlib_buffer_get_current (i_b0),
- i_b0->current_length, sig, sa0->use_esn,
- sa0->seq_hi);
+ unsigned size = hmac_calc (vm, sa0, vlib_buffer_get_current (i_b0),
+ i_b0->current_length, sig);
memcpy (digest, sig, size);
if (is_ip6)