diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-05-25 12:34:15 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-05-25 12:34:15 +0000 |
| commit | 233a6665b64cfaf318552d56cf991f9e5e9ef482 (patch) | |
| tree | b6391887835c1d875f37d47c6323771637870c7a /sys/dev/mlx5/mlx5_en | |
| parent | 9550e3403eefb9897ac893f078830e9020530d97 (diff) | |
Notes
Diffstat (limited to 'sys/dev/mlx5/mlx5_en')
| -rw-r--r-- | sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index f9b72ae35354f..8b91d27a758b1 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -251,18 +251,14 @@ mlx5e_tls_set_params(void *ctx, const struct tls_session_params *en) MLX5_SET(sw_tls_cntx, ctx, param.encryption_standard, 1); /* TLS */ /* copy the initial vector in place */ - if (en->iv_len == MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv)) { + switch (en->iv_len) { + case MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv): + case MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv) + + MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.implicit_iv): memcpy(MLX5_ADDR_OF(sw_tls_cntx, ctx, param.gcm_iv), - en->iv, MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv)); - } else if (en->iv_len == (MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv) + - MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.implicit_iv))) { - memcpy(MLX5_ADDR_OF(sw_tls_cntx, ctx, param.gcm_iv), - (char *)en->iv + MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.implicit_iv), - MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.gcm_iv)); - memcpy(MLX5_ADDR_OF(sw_tls_cntx, ctx, param.implicit_iv), - en->iv, - MLX5_FLD_SZ_BYTES(sw_tls_cntx, param.implicit_iv)); - } else { + en->iv, en->iv_len); + break; + default: return (EINVAL); } |
