X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=examples%2Fipsec-secgw%2Fsa.c;h=c75a5a15f561f76b4cd71b79125757c4e62a9371;hb=cc07a42da2504e684f430fe9e2c4e50927df0e02;hp=4cb90857c7c71390368eb0552f5c49dcafda256e;hpb=ba66534fc763b30ac4dc17225f18a65ebfe72b33;p=dpdk.git diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 4cb90857c7..c75a5a15f5 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -115,7 +115,7 @@ const struct supported_auth_algo auth_algos[] = { { .keyword = "sha256-hmac", .algo = RTE_CRYPTO_AUTH_SHA256_HMAC, - .digest_len = 12, + .digest_len = 16, .key_len = 32 } }; @@ -314,6 +314,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->cipher_algo = algo->algo; rule->block_size = algo->block_size; rule->iv_len = algo->iv_len; @@ -378,6 +381,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->auth_algo = algo->algo; rule->auth_key_len = algo->key_len; rule->digest_len = algo->digest_len; @@ -433,6 +439,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->aead_algo = algo->algo; rule->cipher_key_len = algo->key_len; rule->digest_len = algo->digest_len; @@ -985,7 +994,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], if (sa->aead_algo == RTE_CRYPTO_AEAD_AES_GCM) { struct rte_ipsec_session *ips; - iv_length = 16; + iv_length = 12; sa_ctx->xf[idx].a.type = RTE_CRYPTO_SYM_XFORM_AEAD; sa_ctx->xf[idx].a.aead.algo = sa->aead_algo; @@ -1115,7 +1124,7 @@ fill_ipsec_app_sa_prm(struct rte_ipsec_sa_prm *prm, prm->flags = app_prm->flags; prm->ipsec_xform.options.esn = app_prm->enable_esn; - prm->replay_win_sz = app_prm->window_size; + prm->ipsec_xform.replay_win_sz = app_prm->window_size; } static int