summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-04-04 12:25:44 +0200
committerNeale Ranns <nranns@cisco.com>2019-04-04 12:49:39 +0000
commit7c22ff72aa54d15484fdc70e0c1b8a9ec5e880e0 (patch)
tree6fb0b991a946a69793e5585ab69ccc5b3b4322e4 /src/vnet/ipsec
parent085637f5d5d25023c4e7b13c9dcacfcf512aceee (diff)
ipsec: trunc_size -> icv_size
Change-Id: Idb661261c2191adda963a7815822fd7a27a9e7a0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ipsec')
-rw-r--r--src/vnet/ipsec/ah_decrypt.c2
-rw-r--r--src/vnet/ipsec/ah_encrypt.c2
-rw-r--r--src/vnet/ipsec/esp.h4
-rw-r--r--src/vnet/ipsec/esp_decrypt.c2
-rw-r--r--src/vnet/ipsec/esp_encrypt.c2
-rw-r--r--src/vnet/ipsec/ipsec.c10
-rw-r--r--src/vnet/ipsec/ipsec.h2
-rw-r--r--src/vnet/ipsec/ipsec_sa.c4
-rw-r--r--src/vnet/ipsec/ipsec_sa.h2
9 files changed, 15 insertions, 15 deletions
diff --git a/src/vnet/ipsec/ah_decrypt.c b/src/vnet/ipsec/ah_decrypt.c
index e68accd9da2..0cced35b5cd 100644
--- a/src/vnet/ipsec/ah_decrypt.c
+++ b/src/vnet/ipsec/ah_decrypt.c
@@ -161,7 +161,7 @@ ah_decrypt_inline (vlib_main_t * vm,
(&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 2eab3ac1746..dc168d46924 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 = 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 0f75d5459ad..b6942fadf97 100644
--- a/src/vnet/ipsec/esp.h
+++ b/src/vnet/ipsec/esp.h
@@ -103,7 +103,7 @@ hmac_calc (vlib_main_t * vm, ipsec_sa_t * sa, u8 * data, int data_len,
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 @@ hmac_calc (vlib_main_t * vm, ipsec_sa_t * sa, u8 * data, int data_len,
}
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 c6cb439f1f8..7737d186865 100644
--- a/src/vnet/ipsec/esp_decrypt.c
+++ b/src/vnet/ipsec/esp_decrypt.c
@@ -157,7 +157,7 @@ esp_decrypt_inline (vlib_main_t * vm,
{
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 f5a2627f9b1..29e27d4488c 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -280,7 +280,7 @@ esp_encrypt_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
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 522b9589972..9719d3a2d09 100644
--- a/src/vnet/ipsec/ipsec.c
+++ b/src/vnet/ipsec/ipsec.c
@@ -298,23 +298,23 @@ ipsec_init (vlib_main_t * vm)
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 c6ef1d0ca25..821b7ed3107 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -75,7 +75,7 @@ typedef struct
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 0ca2f376c67..4d20566686d 100644
--- a/src/vnet/ipsec/ipsec_sa.c
+++ b/src/vnet/ipsec/ipsec_sa.c
@@ -109,9 +109,9 @@ ipsec_sa_set_integ_alg (ipsec_sa_t * sa, ipsec_integ_alg_t integ_alg)
{
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 66bdcc72308..12700ccaa39 100644
--- a/src/vnet/ipsec/ipsec_sa.h
+++ b/src/vnet/ipsec/ipsec_sa.h
@@ -111,7 +111,7 @@ typedef struct
u8 crypto_iv_size;
u8 crypto_block_size;
- u8 integ_trunc_size;
+ u8 integ_icv_size;
u32 spi;
u32 seq;
u32 seq_hi;