linux/net/ceph/crypto.c

// SPDX-License-Identifier: GPL-2.0

#include <linux/ceph/ceph_debug.h>

#include <linux/err.h>
#include <linux/scatterlist.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <crypto/aes.h>
#include <crypto/skcipher.h>
#include <linux/key-type.h>
#include <linux/sched/mm.h>

#include <keys/ceph-type.h>
#include <keys/user-type.h>
#include <linux/ceph/decode.h>
#include "crypto.h"

/*
 * Set ->key and ->tfm.  The rest of the key should be filled in before
 * this function is called.
 */
static int set_secret(struct ceph_crypto_key *key, void *buf)
{}

int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
			  const struct ceph_crypto_key *src)
{}

int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end)
{}

int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end)
{}

int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey)
{}

void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
{}

static const u8 *aes_iv =;

/*
 * Should be used for buffers allocated with kvmalloc().
 * Currently these are encrypt out-buffer (ceph_buffer) and decrypt
 * in-buffer (msg front).
 *
 * Dispose of @sgt with teardown_sgtable().
 *
 * @prealloc_sg is to avoid memory allocation inside sg_alloc_table()
 * in cases where a single sg is sufficient.  No attempt to reduce the
 * number of sgs by squeezing physically contiguous pages together is
 * made though, for simplicity.
 */
static int setup_sgtable(struct sg_table *sgt, struct scatterlist *prealloc_sg,
			 const void *buf, unsigned int buf_len)
{}

static void teardown_sgtable(struct sg_table *sgt)
{}

static int ceph_aes_crypt(const struct ceph_crypto_key *key, bool encrypt,
			  void *buf, int buf_len, int in_len, int *pout_len)
{}

int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,
	       void *buf, int buf_len, int in_len, int *pout_len)
{}

static int ceph_key_preparse(struct key_preparsed_payload *prep)
{}

static void ceph_key_free_preparse(struct key_preparsed_payload *prep)
{}

static void ceph_key_destroy(struct key *key)
{}

struct key_type key_type_ceph =;

int __init ceph_crypto_init(void)
{}

void ceph_crypto_shutdown(void)
{}