New upstream version 18.11-rc1
[deb_dpdk.git] / examples / ipsec-secgw / sa.c
index 4ab8e09..d2d3550 100644 (file)
@@ -81,6 +81,13 @@ const struct supported_cipher_algo cipher_algos[] = {
                .iv_len = 8,
                .block_size = 16, /* XXX AESNI MB limition, should be 4 */
                .key_len = 20
+       },
+       {
+               .keyword = "3des-cbc",
+               .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
+               .iv_len = 8,
+               .block_size = 8,
+               .key_len = 24
        }
 };
 
@@ -327,7 +334,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
                        if (status->status < 0)
                                return;
 
-                       if (algo->algo == RTE_CRYPTO_CIPHER_AES_CBC)
+                       if (algo->algo == RTE_CRYPTO_CIPHER_AES_CBC ||
+                               algo->algo == RTE_CRYPTO_CIPHER_3DES_CBC)
                                rule->salt = (uint32_t)rte_rand();
 
                        if (algo->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
@@ -810,6 +818,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
                } else {
                        switch (sa->cipher_algo) {
                        case RTE_CRYPTO_CIPHER_NULL:
+                       case RTE_CRYPTO_CIPHER_3DES_CBC:
                        case RTE_CRYPTO_CIPHER_AES_CBC:
                                iv_length = sa->iv_len;
                                break;