[PATCH v3 32/32] common/cnxk: add check for null auth and anti-replay

Jerin Jacob jerinjacobk at gmail.com
Fri May 26 10:55:28 CEST 2023


On Thu, May 25, 2023 at 3:41 PM Nithin Dabilpuram
<ndabilpuram at marvell.com> wrote:
>
> From: Srujana Challa <schalla at marvell.com>
>
> As per IPsec RFC, the anti-replay service can be selected for
> an SA only if the integrity service is selected for that SA.
> This patch adds the validation check for the same.
>
> Signed-off-by: Srujana Challa <schalla at marvell.com>


Series applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/common/cnxk/cnxk_security.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
> index 13ca2c7791..a8c3ba90cd 100644
> --- a/drivers/common/cnxk/cnxk_security.c
> +++ b/drivers/common/cnxk/cnxk_security.c
> @@ -155,6 +155,10 @@ ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2,
>
>                 switch (auth_xfrm->auth.algo) {
>                 case RTE_CRYPTO_AUTH_NULL:
> +                       if (w2->s.dir == ROC_IE_SA_DIR_INBOUND && ipsec_xfrm->replay_win_sz) {
> +                               plt_err("anti-replay can't be supported with integrity service disabled");
> +                               return -EINVAL;
> +                       }
>                         w2->s.auth_type = ROC_IE_OT_SA_AUTH_NULL;
>                         break;
>                 case RTE_CRYPTO_AUTH_SHA1_HMAC:
> @@ -1392,6 +1396,11 @@ cnxk_on_ipsec_inb_sa_create(struct rte_security_ipsec_xform *ipsec,
>         if (ret)
>                 return ret;
>
> +       if (crypto_xform->type != RTE_CRYPTO_SYM_XFORM_AEAD &&
> +           crypto_xform->auth.algo == RTE_CRYPTO_AUTH_NULL && ipsec->replay_win_sz) {
> +               plt_err("anti-replay can't be supported with integrity service disabled");
> +               return -EINVAL;
> +       }
>         if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD ||
>             auth_xform->auth.algo == RTE_CRYPTO_AUTH_NULL ||
>             auth_xform->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC) {
> --
> 2.25.1
>


More information about the dev mailing list