ipsec: trunc_size -> icv_size
Change-Id: Idb661261c2191adda963a7815822fd7a27a9e7a0
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/ipsec/ah_decrypt.c b/src/vnet/ipsec/ah_decrypt.c
index e68accd..0cced35 100644
--- a/src/vnet/ipsec/ah_decrypt.c
+++ b/src/vnet/ipsec/ah_decrypt.c
@@ -161,7 +161,7 @@
(&ipsec_sa_counters, thread_index, sa_index0,
1, i_b0->current_length);
- icv_size = sa0->integ_trunc_size;
+ icv_size = sa0->integ_icv_size;
if (PREDICT_TRUE (sa0->integ_alg != IPSEC_INTEG_ALG_NONE))
{
u8 sig[64];
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c
index 2eab3ac..dc168d4 100644
--- a/src/vnet/ipsec/ah_encrypt.c
+++ b/src/vnet/ipsec/ah_encrypt.c
@@ -152,7 +152,7 @@
adv = -sizeof (ah_header_t);
}
- icv_size = sa0->integ_trunc_size;
+ icv_size = sa0->integ_icv_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 */
diff --git a/src/vnet/ipsec/esp.h b/src/vnet/ipsec/esp.h
index 0f75d54..b6942fa 100644
--- a/src/vnet/ipsec/esp.h
+++ b/src/vnet/ipsec/esp.h
@@ -103,7 +103,7 @@
op->src = data;
op->len = data_len;
op->dst = signature;
- op->hmac_trunc_len = sa->integ_trunc_size;
+ op->hmac_trunc_len = sa->integ_icv_size;
if (ipsec_sa_is_set_USE_ESN (sa))
{
@@ -114,7 +114,7 @@
}
vnet_crypto_process_ops (vm, op, 1);
- return sa->integ_trunc_size;
+ return sa->integ_icv_size;
}
#endif /* __ESP_H__ */
diff --git a/src/vnet/ipsec/esp_decrypt.c b/src/vnet/ipsec/esp_decrypt.c
index c6cb439..7737d18 100644
--- a/src/vnet/ipsec/esp_decrypt.c
+++ b/src/vnet/ipsec/esp_decrypt.c
@@ -157,7 +157,7 @@
{
current_sa_index = vnet_buffer (b[0])->ipsec.sad_index;
sa0 = pool_elt_at_index (im->sad, current_sa_index);
- cpd.icv_sz = sa0->integ_trunc_size;
+ cpd.icv_sz = sa0->integ_icv_size;
cpd.iv_sz = sa0->crypto_iv_size;
cpd.flags = sa0->flags;
cpd.sa_index = current_sa_index;
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index f5a2627..29e27d4 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -280,7 +280,7 @@
current_sa_packets = current_sa_bytes = 0;
spi = clib_net_to_host_u32 (sa0->spi);
block_sz = sa0->crypto_block_size;
- icv_sz = sa0->integ_trunc_size;
+ icv_sz = sa0->integ_icv_size;
iv_sz = sa0->crypto_iv_size;
}
diff --git a/src/vnet/ipsec/ipsec.c b/src/vnet/ipsec/ipsec.c
index 522b958..9719d3a 100644
--- a/src/vnet/ipsec/ipsec.c
+++ b/src/vnet/ipsec/ipsec.c
@@ -298,23 +298,23 @@
i = &im->integ_algs[IPSEC_INTEG_ALG_SHA1_96];
i->op_type = VNET_CRYPTO_OP_SHA1_HMAC;
- i->trunc_size = 12;
+ i->icv_size = 12;
i = &im->integ_algs[IPSEC_INTEG_ALG_SHA_256_96];
i->op_type = VNET_CRYPTO_OP_SHA1_HMAC;
- i->trunc_size = 12;
+ i->icv_size = 12;
i = &im->integ_algs[IPSEC_INTEG_ALG_SHA_256_128];
i->op_type = VNET_CRYPTO_OP_SHA256_HMAC;
- i->trunc_size = 16;
+ i->icv_size = 16;
i = &im->integ_algs[IPSEC_INTEG_ALG_SHA_384_192];
i->op_type = VNET_CRYPTO_OP_SHA384_HMAC;
- i->trunc_size = 24;
+ i->icv_size = 24;
i = &im->integ_algs[IPSEC_INTEG_ALG_SHA_512_256];
i->op_type = VNET_CRYPTO_OP_SHA512_HMAC;
- i->trunc_size = 32;
+ i->icv_size = 32;
vec_validate_aligned (im->ptd, vlib_num_workers (), CLIB_CACHE_LINE_BYTES);
diff --git a/src/vnet/ipsec/ipsec.h b/src/vnet/ipsec/ipsec.h
index c6ef1d0..821b7ed 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -75,7 +75,7 @@
typedef struct
{
vnet_crypto_op_type_t op_type;
- u8 trunc_size;
+ u8 icv_size;
} ipsec_main_integ_alg_t;
typedef struct
diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c
index 0ca2f37..4d20566 100644
--- a/src/vnet/ipsec/ipsec_sa.c
+++ b/src/vnet/ipsec/ipsec_sa.c
@@ -109,9 +109,9 @@
{
ipsec_main_t *im = &ipsec_main;
sa->integ_alg = integ_alg;
- sa->integ_trunc_size = im->integ_algs[integ_alg].trunc_size;
+ sa->integ_icv_size = im->integ_algs[integ_alg].icv_size;
sa->integ_op_type = im->integ_algs[integ_alg].op_type;
- ASSERT (sa->integ_trunc_size <= ESP_MAX_ICV_SIZE);
+ ASSERT (sa->integ_icv_size <= ESP_MAX_ICV_SIZE);
}
int
diff --git a/src/vnet/ipsec/ipsec_sa.h b/src/vnet/ipsec/ipsec_sa.h
index 66bdcc7..12700cc 100644
--- a/src/vnet/ipsec/ipsec_sa.h
+++ b/src/vnet/ipsec/ipsec_sa.h
@@ -111,7 +111,7 @@
u8 crypto_iv_size;
u8 crypto_block_size;
- u8 integ_trunc_size;
+ u8 integ_icv_size;
u32 spi;
u32 seq;
u32 seq_hi;