#include <linux/crc32.h>
#include <linux/base64.h>
#include <linux/prandom.h>
#include <linux/unaligned.h>
#include <crypto/hash.h>
#include <crypto/dh.h>
#include "nvme.h"
#include "fabrics.h"
#include <linux/nvme-auth.h>
#define CHAP_BUF_SIZE …
static struct kmem_cache *nvme_chap_buf_cache;
static mempool_t *nvme_chap_buf_pool;
struct nvme_dhchap_queue_context { … };
static struct workqueue_struct *nvme_auth_wq;
static inline int ctrl_max_dhchaps(struct nvme_ctrl *ctrl)
{ … }
static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
void *data, size_t data_len, bool auth_send)
{ … }
static int nvme_auth_receive_validate(struct nvme_ctrl *ctrl, int qid,
struct nvmf_auth_dhchap_failure_data *data,
u16 transaction, u8 expected_msg)
{ … }
static int nvme_auth_set_dhchap_negotiate_data(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_process_dhchap_challenge(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_set_dhchap_reply_data(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_set_dhchap_success2_data(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_set_dhchap_failure2_data(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_dhchap_setup_host_response(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_dhchap_setup_ctrl_response(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static int nvme_auth_dhchap_exponential(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{ … }
static void nvme_auth_reset_dhchap(struct nvme_dhchap_queue_context *chap)
{ … }
static void nvme_auth_free_dhchap(struct nvme_dhchap_queue_context *chap)
{ … }
static void nvme_queue_auth_work(struct work_struct *work)
{ … }
int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid)
{ … }
EXPORT_SYMBOL_GPL(…);
int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
{ … }
EXPORT_SYMBOL_GPL(…);
static void nvme_ctrl_auth_work(struct work_struct *work)
{ … }
int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl)
{ … }
EXPORT_SYMBOL_GPL(…);
void nvme_auth_stop(struct nvme_ctrl *ctrl)
{ … }
EXPORT_SYMBOL_GPL(…);
void nvme_auth_free(struct nvme_ctrl *ctrl)
{ … }
EXPORT_SYMBOL_GPL(…);
int __init nvme_init_auth(void)
{ … }
void __exit nvme_exit_auth(void)
{ … }