bdev/crypto: Fixes with json export

- Fixed bug in vbdev_crypto_config_json(). crypto_bdev->key was used
  for "key2" json field.
- Fixed bug in vbdev_crypto_dump_info_json(). crypto_bdev->key was used
  for "key2" json field.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iac441bc30b03234c96d646db14ee36ad56a546dc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11621
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Yuriy Umanets 2022-01-27 12:21:55 +02:00 committed by Tomasz Zawadzki
parent 2a6ddeb837
commit 706d2c1dc1

View File

@ -1297,7 +1297,7 @@ vbdev_crypto_dump_info_json(void *ctx, struct spdk_json_write_ctx *w)
spdk_json_write_named_string(w, "crypto_pmd", crypto_bdev->drv_name);
spdk_json_write_named_string(w, "key", crypto_bdev->key);
if (strcmp(crypto_bdev->cipher, AES_XTS) == 0) {
spdk_json_write_named_string(w, "key2", crypto_bdev->key);
spdk_json_write_named_string(w, "key2", crypto_bdev->key2);
}
spdk_json_write_named_string(w, "cipher", crypto_bdev->cipher);
spdk_json_write_object_end(w);
@ -1318,7 +1318,7 @@ vbdev_crypto_config_json(struct spdk_json_write_ctx *w)
spdk_json_write_named_string(w, "crypto_pmd", crypto_bdev->drv_name);
spdk_json_write_named_string(w, "key", crypto_bdev->key);
if (strcmp(crypto_bdev->cipher, AES_XTS) == 0) {
spdk_json_write_named_string(w, "key2", crypto_bdev->key);
spdk_json_write_named_string(w, "key2", crypto_bdev->key2);
}
spdk_json_write_named_string(w, "cipher", crypto_bdev->cipher);
spdk_json_write_object_end(w);