aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNithinsen Kaithakadan <nkaithakadan@marvell.com>2025-03-09 18:46:01 +0530
committerDamjan Marion <dmarion@0xa5.net>2025-04-01 14:10:36 +0000
commit59c530f3d55ba4a1bec787fed1287fa276b36103 (patch)
treefae5e503fbfcca8940209097416ecb2d8b86236a /src
parent3eb2c50319a42dfce3f182a8a3e022fb91c4753c (diff)
octeon: fix invalid mac length in chacha poly
This patch fixes invalid mac length to resolve crash in Chacha Poly. Type: fix Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com> Change-Id: Ia940a721b5cb47f7b5fe68adbea78adaaa0f54f0
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dev_octeon/crypto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/dev_octeon/crypto.c b/src/plugins/dev_octeon/crypto.c
index 800f24a008a..cc0b07329a3 100644
--- a/src/plugins/dev_octeon/crypto.c
+++ b/src/plugins/dev_octeon/crypto.c
@@ -1354,7 +1354,7 @@ oct_crypto_aead_session_update (vlib_main_t *vm, oct_crypto_sess_t *sess,
vnet_crypto_key_t *key = vnet_crypto_get_key (key_index);
roc_se_cipher_type enc_type = 0;
roc_se_auth_type auth_type = 0;
- u32 digest_len = ~0;
+ u32 digest_len = 16;
i32 rv = 0;
switch (key->alg)
@@ -1366,9 +1366,6 @@ oct_crypto_aead_session_update (vlib_main_t *vm, oct_crypto_sess_t *sess,
sess->aes_gcm = 1;
sess->iv_offset = 0;
sess->iv_length = 16;
- sess->cpt_ctx.mac_len = 16;
- sess->cpt_op = type;
- digest_len = 16;
break;
case VNET_CRYPTO_ALG_CHACHA20_POLY1305:
enc_type = ROC_SE_CHACHA20;
@@ -1381,6 +1378,9 @@ oct_crypto_aead_session_update (vlib_main_t *vm, oct_crypto_sess_t *sess,
return -1;
}
+ sess->cpt_ctx.mac_len = digest_len;
+ sess->cpt_op = type;
+
rv = roc_se_ciph_key_set (&sess->cpt_ctx, enc_type, key->data, key->length);
if (rv)
{