linux/drivers/nvme/common/auth.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2020 Hannes Reinecke, SUSE Linux
 */

#include <linux/module.h>
#include <linux/crc32.h>
#include <linux/base64.h>
#include <linux/prandom.h>
#include <linux/scatterlist.h>
#include <asm/unaligned.h>
#include <crypto/hash.h>
#include <crypto/dh.h>
#include <linux/nvme.h>
#include <linux/nvme-auth.h>

static u32 nvme_dhchap_seqnum;
static DEFINE_MUTEX(nvme_dhchap_mutex);

u32 nvme_auth_get_seqnum(void)
{}
EXPORT_SYMBOL_GPL();

static struct nvme_auth_dhgroup_map {} dhgroup_map[] =;

const char *nvme_auth_dhgroup_name(u8 dhgroup_id)
{}
EXPORT_SYMBOL_GPL();

const char *nvme_auth_dhgroup_kpp(u8 dhgroup_id)
{}
EXPORT_SYMBOL_GPL();

u8 nvme_auth_dhgroup_id(const char *dhgroup_name)
{}
EXPORT_SYMBOL_GPL();

static struct nvme_dhchap_hash_map {} hash_map[] =;

const char *nvme_auth_hmac_name(u8 hmac_id)
{}
EXPORT_SYMBOL_GPL();

const char *nvme_auth_digest_name(u8 hmac_id)
{}
EXPORT_SYMBOL_GPL();

u8 nvme_auth_hmac_id(const char *hmac_name)
{}
EXPORT_SYMBOL_GPL();

size_t nvme_auth_hmac_hash_len(u8 hmac_id)
{}
EXPORT_SYMBOL_GPL();

u32 nvme_auth_key_struct_size(u32 key_len)
{}
EXPORT_SYMBOL_GPL();

struct nvme_dhchap_key *nvme_auth_extract_key(unsigned char *secret,
					      u8 key_hash)
{}
EXPORT_SYMBOL_GPL();

struct nvme_dhchap_key *nvme_auth_alloc_key(u32 len, u8 hash)
{}
EXPORT_SYMBOL_GPL();

void nvme_auth_free_key(struct nvme_dhchap_key *key)
{}
EXPORT_SYMBOL_GPL();

struct nvme_dhchap_key *nvme_auth_transform_key(
		struct nvme_dhchap_key *key, char *nqn)
{}
EXPORT_SYMBOL_GPL();

static int nvme_auth_hash_skey(int hmac_id, u8 *skey, size_t skey_len, u8 *hkey)
{}

int nvme_auth_augmented_challenge(u8 hmac_id, u8 *skey, size_t skey_len,
		u8 *challenge, u8 *aug, size_t hlen)
{}
EXPORT_SYMBOL_GPL();

int nvme_auth_gen_privkey(struct crypto_kpp *dh_tfm, u8 dh_gid)
{}
EXPORT_SYMBOL_GPL();

int nvme_auth_gen_pubkey(struct crypto_kpp *dh_tfm,
		u8 *host_key, size_t host_key_len)
{}
EXPORT_SYMBOL_GPL();

int nvme_auth_gen_shared_secret(struct crypto_kpp *dh_tfm,
		u8 *ctrl_key, size_t ctrl_key_len,
		u8 *sess_key, size_t sess_key_len)
{}
EXPORT_SYMBOL_GPL();

int nvme_auth_generate_key(u8 *secret, struct nvme_dhchap_key **ret_key)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();