summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/esp.h
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/esp.h
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/esp.h')
-rw-r--r--src/vnet/ipsec/esp.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vnet/ipsec/esp.h b/src/vnet/ipsec/esp.h
index 17300383e16..74ab1f05778 100644
--- a/src/vnet/ipsec/esp.h
+++ b/src/vnet/ipsec/esp.h
@@ -205,19 +205,17 @@ esp_seq_advance (ipsec_sa_t * sa)
always_inline unsigned int
-hmac_calc (vlib_main_t * vm, ipsec_integ_alg_t alg, u8 * key, int key_len,
- u8 * data, int data_len, u8 * signature, u8 use_esn, u32 seq_hi)
+hmac_calc (vlib_main_t * vm, ipsec_sa_t * sa, u8 * data, int data_len,
+ u8 * signature)
{
- ipsec_main_t *im = &ipsec_main;
vnet_crypto_op_t _op, *op = &_op;
- ASSERT (alg < IPSEC_INTEG_N_ALG);
- if (PREDICT_FALSE (im->integ_algs[alg].op_type == 0))
+ if (PREDICT_FALSE (sa->integ_op_type == 0))
return 0;
- op->op = im->integ_algs[alg].op_type;
- op->key = key;
- op->key_len = key_len;
+ op->op = sa->integ_op_type;
+ op->key = sa->integ_key.data;
+ op->key_len = sa->integ_key.len;
op->src = data;
op->len = data_len;
op->dst = signature;
@@ -233,7 +231,7 @@ hmac_calc (vlib_main_t * vm, ipsec_integ_alg_t alg, u8 * key, int key_len,
#endif
vnet_crypto_process_ops (vm, op, 1);
- return im->integ_algs[alg].trunc_size;
+ return sa->integ_trunc_size;
}
#endif /* __ESP_H__ */