sec_ctx
int (*buf_map)(struct sec_ctx *ctx, struct sec_req *req);
void (*buf_unmap)(struct sec_ctx *ctx, struct sec_req *req);
void (*do_transfer)(struct sec_ctx *ctx, struct sec_req *req);
int (*bd_fill)(struct sec_ctx *ctx, struct sec_req *req);
int (*bd_send)(struct sec_ctx *ctx, struct sec_req *req);
void (*callback)(struct sec_ctx *ctx, struct sec_req *req, int err);
int (*process)(struct sec_ctx *ctx, struct sec_req *req);
struct sec_ctx *ctx;
struct sec_ctx *ctx;
static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,
static int sec_cipher_map_inner(struct sec_ctx *ctx, struct sec_req *req,
static int sec_aead_soft_crypto(struct sec_ctx *ctx,
static int sec_cipher_map(struct sec_ctx *ctx, struct sec_req *req,
static int sec_skcipher_soft_crypto(struct sec_ctx *ctx,
static void sec_cipher_unmap(struct sec_ctx *ctx, struct sec_req *req,
static int sec_skcipher_sgl_map(struct sec_ctx *ctx, struct sec_req *req)
static void sec_skcipher_sgl_unmap(struct sec_ctx *ctx, struct sec_req *req)
struct sec_ctx *ctx = crypto_tfm_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
static int sec_aead_sgl_map(struct sec_ctx *ctx, struct sec_req *req)
static void sec_aead_sgl_unmap(struct sec_ctx *ctx, struct sec_req *req)
static int sec_request_transfer(struct sec_ctx *ctx, struct sec_req *req)
static void sec_request_untransfer(struct sec_ctx *ctx, struct sec_req *req)
static void sec_skcipher_copy_iv(struct sec_ctx *ctx, struct sec_req *req)
static int sec_skcipher_bd_fill(struct sec_ctx *ctx, struct sec_req *req)
static int sec_skcipher_bd_fill_v3(struct sec_ctx *ctx, struct sec_req *req)
static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req,
static void set_aead_auth_iv(struct sec_ctx *ctx, struct sec_req *req)
static void sec_aead_set_iv(struct sec_ctx *ctx, struct sec_req *req)
struct sec_ctx *ctx = req->ctx;
static int sec_aead_bd_fill(struct sec_ctx *ctx, struct sec_req *req)
static int sec_aead_bd_fill_v3(struct sec_ctx *ctx, struct sec_req *req)
static void sec_aead_callback(struct sec_ctx *c, struct sec_req *req, int err)
static int sec_request_init(struct sec_ctx *ctx, struct sec_req *req)
static int sec_process(struct sec_ctx *ctx, struct sec_req *req)
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
static int sec_skcipher_cryptlen_check(struct sec_ctx *ctx, struct sec_req *sreq)
static int sec_skcipher_param_check(struct sec_ctx *ctx,
static int sec_skcipher_soft_crypto(struct sec_ctx *ctx,
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
static void sec_alg_send_backlog_soft(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
.cra_ctxsize = sizeof(struct sec_ctx),\
static int sec_aead_spec_check(struct sec_ctx *ctx, struct sec_req *sreq)
static int sec_aead_param_check(struct sec_ctx *ctx, struct sec_req *sreq, bool *need_fallback)
static int sec_aead_soft_crypto(struct sec_ctx *ctx,
struct sec_ctx *ctx = crypto_aead_ctx(tfm);
.cra_ctxsize = sizeof(struct sec_ctx),\
static void sec_alg_send_backlog(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
struct sec_ctx *ctx = req->ctx;
struct sec_ctx *ctx;
static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)
static int sec_alg_resource_alloc(struct sec_ctx *ctx,
static void sec_alg_resource_free(struct sec_ctx *ctx,
static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
static void sec_free_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
static int sec_create_qp_ctx(struct sec_ctx *ctx, int qp_ctx_id)
static void sec_release_qp_ctx(struct sec_ctx *ctx,
static int sec_ctx_base_init(struct sec_ctx *ctx)
static void sec_ctx_base_uninit(struct sec_ctx *ctx)
static int sec_cipher_init(struct sec_ctx *ctx)
static void sec_cipher_uninit(struct sec_ctx *ctx)
static int sec_auth_init(struct sec_ctx *ctx)
static void sec_auth_uninit(struct sec_ctx *ctx)
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
static int sec_cipher_pbuf_map(struct sec_ctx *ctx, struct sec_req *req,
struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp)
struct xfrm_user_sec_ctx *sec_ctx)
struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp);
int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
struct xfrm_user_sec_ctx *sec_ctx,
struct xfrm_user_sec_ctx *sec_ctx)
sec_ctx = skb_put(skb,
sec_ctx->sadb_x_sec_len =
sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi;
sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg;
sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len;
memcpy(sec_ctx + 1, xfrm_ctx->ctx_str,
const struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL);
struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = skb_put(skb, ctx_size);
sec_ctx->sadb_x_sec_len = ctx_size / sizeof(uint64_t);
sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi;
sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg;
sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len;
memcpy(sec_ctx + 1, xfrm_ctx->ctx_str,
struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL);
struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL);
struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = skb_put(skb,
sec_ctx->sadb_x_sec_len =
sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi;
sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg;
sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len;
memcpy(sec_ctx + 1, xfrm_ctx->ctx_str,
struct sadb_x_sec_ctx *sec_ctx;
sec_ctx = (struct sadb_x_sec_ctx *)p;
sec_ctx->sadb_x_sec_len*8) {
uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_ATOMIC);
static inline int pfkey_sec_ctx_len(const struct sadb_x_sec_ctx *sec_ctx)
sec_ctx->sadb_x_ctx_len,
const struct sadb_x_sec_ctx *sec_ctx = p;
int len = sec_ctx->sadb_x_ctx_len;
len = pfkey_sec_ctx_len(sec_ctx);
if (sec_ctx->sadb_x_sec_len != len)
static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx,
int ctx_size = sec_ctx->sadb_x_ctx_len;
uctx->len = pfkey_sec_ctx_len(sec_ctx);
uctx->exttype = sec_ctx->sadb_x_sec_exttype;
uctx->ctx_doi = sec_ctx->sadb_x_ctx_doi;
uctx->ctx_alg = sec_ctx->sadb_x_ctx_alg;
uctx->ctx_len = sec_ctx->sadb_x_ctx_len;
memcpy(uctx + 1, sec_ctx + 1,
struct sadb_x_sec_ctx *sec_ctx;
struct xfrm_user_sec_ctx *sec_ctx,
return call_int_hook(xfrm_policy_alloc_security, ctxp, sec_ctx, gfp);
struct xfrm_user_sec_ctx *sec_ctx)
return call_int_hook(xfrm_state_alloc, x, sec_ctx);