dpdk: fix key length for linked crypto algs 39/42739/2
authorMatthew Smith <[email protected]>
Tue, 8 Apr 2025 14:41:31 +0000 (14:41 +0000)
committerDamjan Marion <[email protected]>
Sun, 13 Apr 2025 19:04:59 +0000 (19:04 +0000)
Change to key storage in vnet crypto was not propagated to linked algs
in dpdk cryptodev code. There is an explicit key length field now
instead of using vec_len() on the key data.

Type: fix
Fixes: 6676d95169

Signed-off-by: Matthew Smith <[email protected]>
Change-Id: I27fbfa5b2da3db0930cf2b2f2addd00d7400c74d

src/plugins/dpdk/cryptodev/cryptodev.c

index c60f9c8..a8817a1 100644 (file)
@@ -128,14 +128,14 @@ prepare_linked_xform (struct rte_crypto_sym_xform *xforms,
 
   xform_cipher->cipher.algo = cipher_algo;
   xform_cipher->cipher.key.data = key_cipher->data;
-  xform_cipher->cipher.key.length = vec_len (key_cipher->data);
+  xform_cipher->cipher.key.length = key_cipher->length;
   xform_cipher->cipher.iv.length = 16;
   xform_cipher->cipher.iv.offset = CRYPTODEV_IV_OFFSET;
 
   xform_auth->auth.algo = auth_algo;
   xform_auth->auth.digest_length = digest_len;
   xform_auth->auth.key.data = key_auth->data;
-  xform_auth->auth.key.length = vec_len (key_auth->data);
+  xform_auth->auth.key.length = key_auth->length;
 
   return 0;
 }