nvmet: implement basic In-Band Authentication
authorHannes Reinecke <hare@suse.de>
Mon, 27 Jun 2022 09:52:05 +0000 (11:52 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:49 +0000 (17:14 -0600)
commitdb1312dd95488b5e6ff362ff66fcf953a46b1821
tree654de0461850d595adb0f3788374aad4c8b1a7a4
parent6490c9ed06de4a97a1ba89f53cd6c045d5277bc4
nvmet: implement basic In-Band Authentication

Implement NVMe-oF In-Band authentication according to NVMe TPAR 8006.
This patch adds three additional configfs entries 'dhchap_key',
'dhchap_ctrl_key', and 'dhchap_hash' to the 'host' configfs directory.
The 'dhchap_key' and 'dhchap_ctrl_key' entries need to be in the ASCII
format as specified in NVMe Base Specification v2.0 section 8.13.5.8
'Secret representation'.
'dhchap_hash' defaults to 'hmac(sha256)', and can be written to to
switch to a different HMAC algorithm.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/Kconfig
drivers/nvme/target/Makefile
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/auth.c [new file with mode: 0644]
drivers/nvme/target/configfs.c
drivers/nvme/target/core.c
drivers/nvme/target/fabrics-cmd-auth.c [new file with mode: 0644]
drivers/nvme/target/fabrics-cmd.c
drivers/nvme/target/nvmet.h