Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme-auth: rename nvme_auth_generate_key() to nvme_auth_parse_key()

This function does not generate a key. It parses the key from the
string that the caller passes in.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Eric Biggers and committed by
Keith Busch
0beeca72 f990ad67

+8 -9
+2 -2
drivers/nvme/common/auth.c
··· 436 436 } 437 437 EXPORT_SYMBOL_GPL(nvme_auth_gen_shared_secret); 438 438 439 - int nvme_auth_generate_key(const char *secret, struct nvme_dhchap_key **ret_key) 439 + int nvme_auth_parse_key(const char *secret, struct nvme_dhchap_key **ret_key) 440 440 { 441 441 struct nvme_dhchap_key *key; 442 442 u8 key_hash; ··· 459 459 *ret_key = key; 460 460 return 0; 461 461 } 462 - EXPORT_SYMBOL_GPL(nvme_auth_generate_key); 462 + EXPORT_SYMBOL_GPL(nvme_auth_parse_key); 463 463 464 464 /** 465 465 * nvme_auth_generate_psk - Generate a PSK for TLS
+3 -4
drivers/nvme/host/auth.c
··· 1072 1072 INIT_WORK(&ctrl->dhchap_auth_work, nvme_ctrl_auth_work); 1073 1073 if (!ctrl->opts) 1074 1074 return 0; 1075 - ret = nvme_auth_generate_key(ctrl->opts->dhchap_secret, 1076 - &ctrl->host_key); 1075 + ret = nvme_auth_parse_key(ctrl->opts->dhchap_secret, &ctrl->host_key); 1077 1076 if (ret) 1078 1077 return ret; 1079 - ret = nvme_auth_generate_key(ctrl->opts->dhchap_ctrl_secret, 1080 - &ctrl->ctrl_key); 1078 + ret = nvme_auth_parse_key(ctrl->opts->dhchap_ctrl_secret, 1079 + &ctrl->ctrl_key); 1081 1080 if (ret) 1082 1081 goto err_free_dhchap_secret; 1083 1082
+2 -2
drivers/nvme/host/sysfs.c
··· 658 658 struct nvme_dhchap_key *key, *host_key; 659 659 int ret; 660 660 661 - ret = nvme_auth_generate_key(dhchap_secret, &key); 661 + ret = nvme_auth_parse_key(dhchap_secret, &key); 662 662 if (ret) { 663 663 kfree(dhchap_secret); 664 664 return ret; ··· 716 716 struct nvme_dhchap_key *key, *ctrl_key; 717 717 int ret; 718 718 719 - ret = nvme_auth_generate_key(dhchap_secret, &key); 719 + ret = nvme_auth_parse_key(dhchap_secret, &key); 720 720 if (ret) { 721 721 kfree(dhchap_secret); 722 722 return ret;
+1 -1
include/linux/nvme-auth.h
··· 30 30 struct nvme_dhchap_key *nvme_auth_alloc_key(u32 len, u8 hash); 31 31 struct nvme_dhchap_key *nvme_auth_transform_key( 32 32 const struct nvme_dhchap_key *key, const char *nqn); 33 - int nvme_auth_generate_key(const char *secret, struct nvme_dhchap_key **ret_key); 33 + int nvme_auth_parse_key(const char *secret, struct nvme_dhchap_key **ret_key); 34 34 int nvme_auth_augmented_challenge(u8 hmac_id, const u8 *skey, size_t skey_len, 35 35 const u8 *challenge, u8 *aug, size_t hlen); 36 36 int nvme_auth_gen_privkey(struct crypto_kpp *dh_tfm, u8 dh_gid);