test/crypto: fix output buffer length

Input buffer length is getting appended with
padding length when the test case is encrypted
digest, but output buffer length is appended
with padding length for all the cases.

This patch fixes the output buffer length
by appending the padding length only when the
test case is of encrypted digest type.

Fixes: 6356c28642 ("test/crypto: add cases for block cipher encrypted digest")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
This commit is contained in:
Gagandeep Singh 2021-11-12 13:23:48 +05:30 committed by Akhil Goyal
parent 4b2cc736a5
commit 0e51e342ac

View File

@ -266,7 +266,10 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
}
memset(obuf->buf_addr, dst_pattern, obuf->buf_len);
buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
if (t->op_mask & BLOCKCIPHER_TEST_OP_DIGEST_ENCRYPTED)
buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
else
buf_p = rte_pktmbuf_append(obuf, buf_len);
if (!buf_p) {
snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
"FAILED: %s", __LINE__,