fips_validation: fix GCM test
authorFan Zhang <roy.fan.zhang@intel.com>
Thu, 22 Oct 2020 09:59:27 +0000 (10:59 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 2 Nov 2020 08:24:41 +0000 (09:24 +0100)
This patch fixes FIPS GCM test of the redundant plaintext string
write and insufficient test case support check for some corner
cases.

Fixes: d09abf2d1007 ("examples/fips_validation: update GCM test")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
examples/fips_validation/fips_validation_gcm.c
examples/fips_validation/main.c

index df3caa2..250d09b 100644 (file)
@@ -175,7 +175,6 @@ parse_test_gcm_writeback(struct fips_val *val)
                if (vec.status == RTE_CRYPTO_OP_STATUS_SUCCESS) {
                        fprintf(info.fp_wr, "%s", PT_STR);
                        if (!info.interim_info.gcm_data.is_gmac) {
-                               fprintf(info.fp_wr, "%s", PT_STR);
                                tmp_val.val = val->val;
                                tmp_val.len = vec.pt.len;
 
index 81539df..cad6bcb 100644 (file)
@@ -927,10 +927,14 @@ prepare_gmac_xform(struct rte_crypto_sym_xform *xform)
 
        if (rte_cryptodev_sym_capability_check_auth(cap,
                        auth_xform->key.length,
-                       auth_xform->digest_length, 0) != 0) {
-               RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
+                       auth_xform->digest_length,
+                       auth_xform->iv.length) != 0) {
+
+               RTE_LOG(ERR, USER1,
+                       "PMD %s key length %u Digest length %u IV length %u\n",
                                info.device_name, auth_xform->key.length,
-                               auth_xform->digest_length);
+                               auth_xform->digest_length,
+                               auth_xform->iv.length);
                return -EPERM;
        }