aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat/api_format.c
diff options
context:
space:
mode:
authorRadu Nicolau <radu.nicolau@intel.com>2016-11-29 11:00:30 +0000
committerDamjan Marion <dmarion.lists@gmail.com>2016-11-30 20:37:45 +0000
commit6929ea9225cf229ed59a480ceefb972b85971e50 (patch)
tree9366bec3e281de9cfe20fd3c58cb357c26ab6e43 /vpp-api-test/vat/api_format.c
parent2fee4c8fadd31979bd3e72c51d276773d17798d1 (diff)
Enabling AES-GCM-128 with 16B ICV support
Change-Id: Ib57b6f6b71ba14952ad77477a4df3ab33b36fef4 Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Diffstat (limited to 'vpp-api-test/vat/api_format.c')
-rw-r--r--vpp-api-test/vat/api_format.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 8522428ea88..800fa2b3df0 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -11732,7 +11732,7 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam)
(i, "crypto_alg %U", unformat_ipsec_crypto_alg, &crypto_alg))
{
if (crypto_alg < IPSEC_CRYPTO_ALG_AES_CBC_128 ||
- crypto_alg > IPSEC_INTEG_ALG_SHA_512_256)
+ crypto_alg >= IPSEC_CRYPTO_N_ALG)
{
clib_warning ("unsupported crypto-alg: '%U'",
format_ipsec_crypto_alg, crypto_alg);
@@ -11745,8 +11745,12 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam)
if (unformat
(i, "integ_alg %U", unformat_ipsec_integ_alg, &integ_alg))
{
+#if DPDK_CRYPTO==1
+ if (integ_alg < IPSEC_INTEG_ALG_NONE ||
+#else
if (integ_alg < IPSEC_INTEG_ALG_SHA1_96 ||
- integ_alg > IPSEC_INTEG_ALG_SHA_512_256)
+#endif
+ integ_alg >= IPSEC_INTEG_N_ALG)
{
clib_warning ("unsupported integ-alg: '%U'",
format_ipsec_integ_alg, integ_alg);
@@ -11763,6 +11767,33 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam)
}
+#if DPDK_CRYPTO==1
+ /*Special cases, aes-gcm-128 encryption */
+ if (crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128)
+ {
+ if (integ_alg != IPSEC_INTEG_ALG_NONE
+ && integ_alg != IPSEC_INTEG_ALG_AES_GCM_128)
+ {
+ clib_warning
+ ("unsupported: aes-gcm-128 crypto-alg needs none as integ-alg");
+ return -99;
+ }
+ else /*set integ-alg internally to aes-gcm-128 */
+ integ_alg = IPSEC_INTEG_ALG_AES_GCM_128;
+ }
+ else if (integ_alg == IPSEC_INTEG_ALG_AES_GCM_128)
+ {
+ clib_warning ("unsupported integ-alg: aes-gcm-128");
+ return -99;
+ }
+ else if (integ_alg == IPSEC_INTEG_ALG_NONE)
+ {
+ clib_warning ("unsupported integ-alg: none");
+ return -99;
+ }
+#endif
+
+
M (IPSEC_SAD_ADD_DEL_ENTRY, ipsec_sad_add_del_entry);
mp->sad_id = ntohl (sad_id);