Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | crypto/ahash.c |
int crypto_hash_walk_first(struct ahash_request *req,
struct crypto_hash_walk *walk) {
walk->total = req->nbytes;
if (!walk->total) {
walk->entrylen = 0;
return 0;
}
walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req));
walk->sg = req->src;
walk->flags = r... | [
0,
0
] |
Linux Kernel | crypto/ahash.c |
static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen) {
return -ENOSYS;
} | [
0,
0
] |
Linux Kernel | crypto/ahash.c |
static int crypto_ahash_op(struct ahash_request *req,
int (*op)(struct ahash_request *)) {
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
unsigned long alignmask = crypto_ahash_alignmask(tfm);
if ((unsigned long)req->result & alignmask)
return ahash_op_unaligned(req, op);
... | [
1,
0
] |
Linux Kernel | crypto/ahash.c |
int crypto_grab_ahash(struct crypto_ahash_spawn *spawn,
struct crypto_instance *inst, const char *name, u32 type,
u32 mask) {
spawn->base.frontend = &crypto_ahash_type;
return crypto_grab_spawn(&spawn->base, inst, name, type, mask);
} | [
0,
0
] |
Linux Kernel | crypto/ahash.c |
int crypto_has_ahash(const char *alg_name, u32 type, u32 mask) {
return crypto_type_has_alg(alg_name, &crypto_ahash_type, type, mask);
} | [
0,
0
] |
Linux Kernel | crypto/akcipher.c | static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) {
struct crypto_report_akcipher rakcipher;
memset(&rakcipher, 0, sizeof(rakcipher));
strscpy(rakcipher.type, "akcipher", sizeof(rakcipher.type));
return nla_put(skb, CRYPTOCFGA_REPORT_AKCIPHER, sizeof(rakcipher),
... | [
1,
0
] |
Linux Kernel | crypto/akcipher.c | static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) {
return -ENOSYS;
}
#endif | [
0,
0
] |
Linux Kernel | crypto/akcipher.c |
static void crypto_akcipher_free_instance(struct crypto_instance *inst) {
struct akcipher_instance *akcipher = akcipher_instance(inst);
akcipher->free(akcipher);
} | [
0,
0
] |
Linux Kernel | crypto/akcipher.c |
void crypto_unregister_akcipher(struct akcipher_alg *alg) {
crypto_unregister_alg(&alg->base);
} | [
0,
0
] |
Linux Kernel | crypto/algapi.c | static int crypto_check_alg(struct crypto_alg *alg) {
crypto_check_module_sig(alg->cra_module);
if (!alg->cra_name[0] || !alg->cra_driver_name[0])
return -EINVAL;
if (alg->cra_alignmask & (alg->cra_alignmask + 1))
return -EINVAL;
if (alg->cra_alignmask > MAX_ALGAPI_ALIGNMASK)
return -EINVAL;
i... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
static void crypto_free_instance(struct crypto_instance *inst) {
inst->alg.cra_type->free(inst);
} | [
0,
0
] |
Linux Kernel | crypto/algapi.c | static struct list_head *
crypto_more_spawns(struct crypto_alg *alg, struct list_head *stack,
struct list_head *top, struct list_head *secondary_spawns) {
struct crypto_spawn *spawn, *n;
spawn = list_first_entry_or_null(stack, struct crypto_spawn, list);
if (!spawn)
return NULL;
n = lis... | [
1,
0
] |
Linux Kernel | crypto/algapi.c | static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) {
struct crypto_alg *q;
struct crypto_larval *larval;
int ret = -EAGAIN;
if (crypto_is_dead(alg))
goto err;
INIT_LIST_HEAD(&alg->cra_users);
alg->cra_flags &= ~CRYPTO_ALG_TESTED;
ret = -EEXIST;
list_for_each_entry(q, &cr... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_unregister_instance(struct crypto_instance *inst) {
LIST_HEAD(list);
down_write(&crypto_alg_sem);
crypto_remove_spawns(&inst->alg, &list, NULL);
crypto_remove_instance(inst, &list);
up_write(&crypto_alg_sem);
crypto_remove_final(&list);
} | [
0,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_enqueue_request_head(struct crypto_queue *queue,
struct crypto_async_request *request) {
queue->qlen++;
list_add(&request->list, &queue->list);
} | [
0,
0
] |
Linux Kernel | crypto/algapi.c | void crypto_stats_init(struct crypto_alg *alg) {
memset(&alg->stats, 0, sizeof(alg->stats));
} | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg,
int ret) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
atomic64_inc(&alg->stats.aead.err_cnt);
} else {
atomic64_inc(&alg->stats.aead.decrypt_cnt);
atomic64_add(cryptlen, &alg->stats.aead... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_akcipher_encrypt(unsigned int src_len, int ret,
struct crypto_alg *alg) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
atomic64_inc(&alg->stats.akcipher.err_cnt);
} else {
atomic64_inc(&alg->stats.akcipher.encrypt_cnt);
atomic64_add(src_len, &a... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_akcipher_verify(int ret, struct crypto_alg *alg) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
atomic64_inc(&alg->stats.akcipher.err_cnt);
else
atomic64_inc(&alg->stats.akcipher.verify_cnt);
crypto_alg_put(alg);
} | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
atomic64_inc(&alg->stats.compress.err_cnt);
} else {
atomic64_inc(&alg->stats.compress.compress_cnt);
atomic64_add(slen, &alg->stats.compress.compress_tlen);
}
crypto_... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_decompress(unsigned int slen, int ret,
struct crypto_alg *alg) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
atomic64_inc(&alg->stats.compress.err_cnt);
} else {
atomic64_inc(&alg->stats.compress.decompress_cnt);
atomic64_add(slen, &alg->stats.compr... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_ahash_final(unsigned int nbytes, int ret,
struct crypto_alg *alg) {
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
atomic64_inc(&alg->stats.hash.err_cnt);
} else {
atomic64_inc(&alg->stats.hash.hash_cnt);
atomic64_add(nbytes, &alg->stats.hash.hash_tle... | [
1,
0
] |
Linux Kernel | crypto/algapi.c |
void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret) {
if (ret)
atomic64_inc(&alg->stats.kpp.err_cnt);
else
atomic64_inc(&alg->stats.kpp.setsecret_cnt);
crypto_alg_put(alg);
} | [
0,
0
] |
Linux Kernel | crypto/algapi.c |
static void __init crypto_start_tests(void) {
for (;;) {
struct crypto_larval *larval = NULL;
struct crypto_alg *q;
down_write(&crypto_alg_sem);
list_for_each_entry(q, &crypto_alg_list, cra_list) {
struct crypto_larval *l;
if (!crypto_is_larval(q))
continue;
l = (void *)... | [
0,
0
] |
Linux Kernel | crypto/algboss.c | static int cryptomgr_schedule_test(struct crypto_alg *alg) {
struct task_struct *thread;
struct crypto_test_param *param;
u32 type;
if (!try_module_get(THIS_MODULE))
goto err;
param = kzalloc(sizeof(*param), GFP_KERNEL);
if (!param)
goto err_put_module;
memcpy(param->driver, alg->cra_driver_nam... | [
1,
0
] |
Linux Kernel | crypto/algif_aead.c | static inline bool aead_sufficient_data(struct sock *sk) {
struct alg_sock *ask = alg_sk(sk);
struct sock *psk = ask->parent;
struct alg_sock *pask = alg_sk(psk);
struct af_alg_ctx *ctx = ask->private;
struct aead_tfm *aeadc = pask->private;
struct crypto_aead *tfm = aeadc->aead;
unsigned int as = crypto_... | [
1,
0
] |
Linux Kernel | crypto/algif_aead.c |
static int crypto_aead_copy_sgl(struct crypto_sync_skcipher *null_tfm,
struct scatterlist *src,
struct scatterlist *dst, unsigned int len) {
SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, null_tfm);
skcipher_request_set_sync_tfm(skreq, null_tfm);
skcipher_r... | [
0,
0
] |
Linux Kernel | crypto/algif_aead.c |
static int aead_sendmsg_nokey(struct socket *sock, struct msghdr *msg,
size_t size) {
int err;
err = aead_check_key(sock);
if (err)
return err;
return aead_sendmsg(sock, msg, size);
} | [
0,
0
] |
Linux Kernel | crypto/algif_aead.c |
static int aead_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
size_t ignored, int flags) {
int err;
err = aead_check_key(sock);
if (err)
return err;
return aead_recvmsg(sock, msg, ignored, flags);
} | [
0,
0
] |
Linux Kernel | crypto/algif_aead.c |
static void *aead_bind(const char *name, u32 type, u32 mask) {
struct aead_tfm *tfm;
struct crypto_aead *aead;
struct crypto_sync_skcipher *null_tfm;
tfm = kzalloc(sizeof(*tfm), GFP_KERNEL);
if (!tfm)
return ERR_PTR(-ENOMEM);
aead = crypto_alloc_aead(name, type, mask);
if (IS_ERR(aead)) {
kfree... | [
0,
0
] |
Linux Kernel | crypto/algif_aead.c |
static void aead_release(void *private) {
struct aead_tfm *tfm = private;
crypto_free_aead(tfm->aead);
crypto_put_default_null_skcipher();
kfree(tfm);
} | [
0,
0
] |
Linux Kernel | crypto/algif_aead.c |
static int aead_setauthsize(void *private, unsigned int authsize) {
struct aead_tfm *tfm = private;
return crypto_aead_setauthsize(tfm->aead, authsize);
} | [
0,
0
] |
Linux Kernel | crypto/algif_hash.c |
static ssize_t hash_sendpage(struct socket *sock, struct page *page, int offset,
size_t size, int flags) {
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
struct hash_ctx *ctx = ask->private;
int err;
if (flags & MSG_SENDPAGE_NOTLAST)
flags |= MSG_MORE;
loc... | [
0,
0
] |
Linux Kernel | crypto/algif_hash.c |
static void hash_release(void *private) { crypto_free_ahash(private); } | [
0,
0
] |
Linux Kernel | crypto/algif_hash.c |
static int hash_setkey(void *private, const u8 *key, unsigned int keylen) {
return crypto_ahash_setkey(private, key, keylen);
} | [
0,
0
] |
Linux Kernel | crypto/algif_hash.c |
static int hash_accept_parent(void *private, struct sock *sk) {
struct crypto_ahash *tfm = private;
if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
return -ENOKEY;
return hash_accept_parent_nokey(private, sk);
} | [
0,
0
] |
Linux Kernel | crypto/algif_rng.c |
static int rng_test_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
int flags) {
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
struct rng_ctx *ctx = ask->private;
int ret;
lock_sock(sock->sk);
ret = _rng_recvmsg(ctx->drng, msg, len, ctx->addtl, ctx... | [
0,
0
] |
Linux Kernel | crypto/algif_rng.c | static int rng_setkey(void *private, const u8 *seed, unsigned int seedlen) {
struct rng_parent_ctx *pctx = private;
return crypto_rng_reset(pctx->drng, seed, seedlen);
} | [
0,
0
] |
Linux Kernel | crypto/algif_rng.c | static int __maybe_unused rng_setentropy(void *private, sockptr_t entropy,
unsigned int len) {
struct rng_parent_ctx *pctx = private;
u8 *kentropy = NULL;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (pctx->entropy)
return -EINVAL;
if (len > MAXSIZE)
... | [
0,
0
] |
Linux Kernel | crypto/algif_skcipher.c |
static void *skcipher_bind(const char *name, u32 type, u32 mask) {
return crypto_alloc_skcipher(name, type, mask);
} | [
0,
0
] |
Linux Kernel | crypto/algif_skcipher.c |
static void skcipher_release(void *private) { crypto_free_skcipher(private); } | [
0,
0
] |
Linux Kernel | crypto/algif_skcipher.c |
static int skcipher_accept_parent_nokey(void *private, struct sock *sk) {
struct af_alg_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
struct crypto_skcipher *tfm = private;
unsigned int len = sizeof(*ctx);
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
return -ENOMEM;
memset(ctx, 0, len);
ctx-... | [
1,
0
] |
Linux Kernel | crypto/ansi_cprng.c | static int __init prng_mod_init(void) {
return crypto_register_rngs(rng_algs, ARRAY_SIZE(rng_algs));
} | [
0,
0
] |
Linux Kernel | crypto/ansi_cprng.c |
static void __exit prng_mod_fini(void) {
crypto_unregister_rngs(rng_algs, ARRAY_SIZE(rng_algs));
} | [
0,
0
] |
Linux Kernel | crypto/anubis.c |
static void anubis_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) {
struct anubis_ctx *ctx = crypto_tfm_ctx(tfm);
anubis_crypt(ctx->E, dst, src, ctx->R);
} | [
0,
0
] |
Linux Kernel | crypto/api.c |
struct crypto_larval *crypto_larval_alloc(const char *name, u32 type,
u32 mask) {
struct crypto_larval *larval;
larval = kzalloc(sizeof(*larval), GFP_KERNEL);
if (!larval)
return ERR_PTR(-ENOMEM);
larval->mask = mask;
larval->alg.cra_flags = CRYPTO_ALG_LARVAL |... | [
0,
0
] |
Linux Kernel | crypto/api.c |
int crypto_probing_notify(unsigned long val, void *v) {
int ok;
ok = blocking_notifier_call_chain(&crypto_chain, val, v);
if (ok == NOTIFY_DONE) {
request_module("cryptomgr");
ok = blocking_notifier_call_chain(&crypto_chain, val, v);
}
return ok;
} | [
0,
0
] |
Linux Kernel | crypto/api.c |
void crypto_shoot_alg(struct crypto_alg *alg) {
down_write(&crypto_alg_sem);
alg->cra_flags |= CRYPTO_ALG_DYING;
up_write(&crypto_alg_sem);
} | [
0,
0
] |
Linux Kernel | crypto/api.c |
struct crypto_alg *crypto_find_alg(const char *alg_name,
const struct crypto_type *frontend, u32 type,
u32 mask) {
if (frontend) {
type &= frontend->maskclear;
mask &= frontend->maskclear;
type |= frontend->type;
mask |= frontend->... | [
0,
0
] |
Linux Kernel | crypto/api.c | void *crypto_alloc_tfm_node(const char *alg_name,
const struct crypto_type *frontend, u32 type,
u32 mask, int node) {
void *tfm;
int err;
for (;;) {
struct crypto_alg *alg;
alg = crypto_find_alg(alg_name, frontend, type, mask);
if (IS_ERR(alg))... | [
1,
0
] |
Linux Kernel | crypto/api.c | void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm) {
struct crypto_alg *alg;
if (IS_ERR_OR_NULL(mem))
return;
alg = tfm->__crt_alg;
if (!tfm->exit && alg->cra_exit)
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
crypto_mod_put(alg);
kfree_sensitive(mem);
} | [
1,
0
] |
Linux Kernel | crypto/api.c |
int crypto_has_alg(const char *name, u32 type, u32 mask) {
int ret = 0;
struct crypto_alg *alg = crypto_alg_mod_lookup(name, type, mask);
if (!IS_ERR(alg)) {
crypto_mod_put(alg);
ret = 1;
}
return ret;
} | [
0,
0
] |
Linux Kernel | crypto/arc4.c |
static int crypto_arc4_init(struct crypto_skcipher *tfm) {
pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
current->comm, (unsigned long)current->pid);
return 0;
} | [
0,
0
] |
Linux Kernel | crypto/aria_generic.c |
void aria_decrypt(void *_ctx, u8 *out, const u8 *in) {
struct aria_ctx *ctx = (struct aria_ctx *)_ctx;
__aria_crypt(ctx, out, in, ctx->dec_key);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | struct asymmetric_key_id *asymmetric_key_generate_id(const void *val_1,
size_t len_1,
const void *val_2,
size_t len_2) {
struct asymmetric_key_id *kid;
kid ... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | inline int __asymmetric_key_hex_to_key_id(const char *id,
struct asymmetric_key_id *match_id,
size_t hexlen) {
match_id->len = hexlen;
return hex2bin(match_id->data, id, hexlen);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | struct asymmetric_key_id *asymmetric_key_hex_to_key_id(const char *id) {
struct asymmetric_key_id *match_id;
size_t asciihexlen;
int ret;
if (!*id)
return ERR_PTR(-EINVAL);
asciihexlen = strlen(id);
if (asciihexlen & 1)
return ERR_PTR(-EINVAL);
match_id =
kmalloc(sizeof(struct asymmetric_k... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | static int asymmetric_key_match_preparse(struct key_match_data *match_data) {
struct asymmetric_key_id *match_id;
const char *spec = match_data->raw_data;
const char *id;
bool (*cmp)(const struct key *, const struct key_match_data *) =
asymmetric_key_cmp;
if (!spec || !*spec)
return -EINVAL;
if (... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | static void asymmetric_key_destroy(struct key *key) {
struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
struct asymmetric_key_ids *kids = key->payload.data[asym_key_ids];
void *data = key->payload.data[asym_crypto];
void *auth = key->payload.data[asym_auth];
key->payload.data[asym_crypto]... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c |
static struct key_restriction *
asymmetric_restriction_alloc(key_restrict_link_func_t check, struct key *key) {
struct key_restriction *keyres =
kzalloc(sizeof(struct key_restriction), GFP_KERNEL);
if (!keyres)
return ERR_PTR(-ENOMEM);
keyres->check = check;
keyres->key = key;
keyres->keytype = &... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | static struct key_restriction *
asymmetric_lookup_restriction(const char *restriction) {
char *restrict_method;
char *parse_buf;
char *next;
struct key_restriction *ret = ERR_PTR(-EINVAL);
if (strcmp("builtin_trusted", restriction) == 0)
return asymmetric_restriction_alloc(restrict_link_by_builtin_truste... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | void unregister_asymmetric_key_parser(struct asymmetric_key_parser *parser) {
down_write(&asymmetric_key_parsers_sem);
list_del(&parser->link);
up_write(&asymmetric_key_parsers_sem);
pr_notice("Asymmetric key parser '%s' unregistered\n", parser->name);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/asymmetric_type.c | static int __init asymmetric_key_init(void) {
return register_key_type(&key_type_asymmetric);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/mscode_parser.c | int mscode_note_digest_algo(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct pefile_context *ctx = context;
char buffer[50];
enum OID oid;
oid = look_up_OID(value, vlen);
switch (oid) {
case OID_md4:
ctx->digest_algo = "md4";
brea... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_key_type.c | static int pkcs7_view_content(void *ctx, const void *data, size_t len,
size_t asn1hdrlen) {
struct key_preparsed_payload *prep = ctx;
const void *saved_prep_data;
size_t saved_prep_datalen;
int ret;
saved_prep_data = prep->data;
saved_prep_datalen = prep->datalen;
prep->data... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | struct pkcs7_message *pkcs7_parse_message(const void *data, size_t datalen) {
struct pkcs7_parse_context *ctx;
struct pkcs7_message *msg = ERR_PTR(-ENOMEM);
int ret;
ctx = kzalloc(sizeof(struct pkcs7_parse_context), GFP_KERNEL);
if (!ctx)
goto out_no_ctx;
ctx->msg = kzalloc(sizeof(struct pkcs7_message)... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | int pkcs7_note_signeddata_version(void *context, size_t hdrlen,
unsigned char tag, const void *value,
size_t vlen) {
struct pkcs7_parse_context *ctx = context;
unsigned version;
if (vlen != 1)
goto unsupported;
ctx->msg->version = version... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | int pkcs7_note_signerinfo_version(void *context, size_t hdrlen,
unsigned char tag, const void *value,
size_t vlen) {
struct pkcs7_parse_context *ctx = context;
unsigned version;
if (vlen != 1)
goto unsupported;
version = *(const u8 *)valu... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | int pkcs7_note_content(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct pkcs7_parse_context *ctx = context;
if (ctx->last_oid != OID_data && ctx->last_oid != OID_msIndirectData) {
pr_warn("Unsupported data type %d\n", ctx->last_oid);
return -E... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | int pkcs7_sig_note_issuer(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct pkcs7_parse_context *ctx = context;
ctx->raw_issuer = value;
ctx->raw_issuer_size = vlen;
return 0;
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_parser.c | int pkcs7_note_signed_info(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct pkcs7_parse_context *ctx = context;
struct pkcs7_signed_info *sinfo = ctx->sinfo;
struct asymmetric_key_id *kid;
if (ctx->msg->data_type == OID_msIndirectData && !sinf... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_verify.c | static int pkcs7_verify_one(struct pkcs7_message *pkcs7,
struct pkcs7_signed_info *sinfo) {
int ret;
kenter(",%u", sinfo->index);
ret = pkcs7_digest(pkcs7, sinfo);
if (ret < 0)
return ret;
/* Find the key for the signature if there is one */
ret = pkcs7_find_key(pkcs7, sin... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs7_verify.c | int pkcs7_verify(struct pkcs7_message *pkcs7, enum key_being_used_for usage) {
struct pkcs7_signed_info *sinfo;
int actual_ret = -ENOPKG;
int ret;
kenter("");
switch (usage) {
case VERIFYING_MODULE_SIGNATURE:
if (pkcs7->data_type != OID_data) {
pr_warn("Invalid module sig (not pkcs7-data)\n");
... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs8_parser.c | int pkcs8_note_OID(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct pkcs8_parse_context *ctx = context;
ctx->last_oid = look_up_OID(value, vlen);
if (ctx->last_oid == OID__NR) {
char buffer[50];
sprint_oid(value, vlen, buffer, sizeof(buffer));
... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/pkcs8_parser.c | static struct public_key *pkcs8_parse(const void *data, size_t datalen) {
struct pkcs8_parse_context ctx;
struct public_key *pub;
long ret;
memset(&ctx, 0, sizeof(ctx));
ret = -ENOMEM;
ctx.pub = kzalloc(sizeof(struct public_key), GFP_KERNEL);
if (!ctx.pub)
goto error;
ctx.data = (unsigned long)da... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/public_key.c | static void public_key_destroy(void *payload0, void *payload3) {
public_key_free(payload0);
public_key_signature_free(payload3);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/public_key.c | static int software_key_query(const struct kernel_pkey_params *params,
struct kernel_pkey_query *info) {
struct crypto_akcipher *tfm;
struct public_key *pkey = params->key->payload.data[asym_crypto];
char alg_name[CRYPTO_MAX_ALG_NAME];
u8 *key, *ptr;
int ret, len;
ret = softwa... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/public_key.c | static inline int cert_sig_digest_update(const struct public_key_signature *sig,
struct crypto_akcipher *tfm_pkey) {
return -ENOTSUPP;
}
#endif | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/restrict.c | int restrict_link_by_signature(struct key *dest_keyring,
const struct key_type *type,
const union key_payload *payload,
struct key *trust_keyring) {
const struct public_key_signature *sig;
struct key *key;
int ret;
pr_... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/restrict.c |
static bool match_either_id(const struct asymmetric_key_id **pair,
const struct asymmetric_key_id *single) {
return (asymmetric_key_id_same(pair[0], single) ||
asymmetric_key_id_same(pair[1], single));
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/signature.c | int decrypt_blob(struct kernel_pkey_params *params, const void *enc,
void *data) {
params->op = kernel_pkey_decrypt;
return asymmetric_key_eds_op(params, enc, data);
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/verify_pefile.c | int verify_pefile_signature(const void *pebuf, unsigned pelen,
struct key *trusted_keys,
enum key_being_used_for usage) {
struct pefile_context ctx;
int ret;
kenter("");
memset(&ctx, 0, sizeof(ctx));
ret = pefile_parse_binary(pebuf, pelen, &ctx);
if ... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_cert_parser.c | void x509_free_certificate(struct x509_certificate *cert) {
if (cert) {
public_key_free(cert->pub);
public_key_signature_free(cert->sig);
kfree(cert->issuer);
kfree(cert->subject);
kfree(cert->id);
kfree(cert->skid);
kfree(cert);
}
} | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_cert_parser.c | int x509_extract_key_data(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct x509_parse_context *ctx = context;
enum OID oid;
ctx->key_algo = ctx->last_oid;
switch (ctx->last_oid) {
case OID_rsaEncryption:
ctx->cert->pub->pkey_algo = "rsa";... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_cert_parser.c | int x509_akid_note_kid(void *context, size_t hdrlen, unsigned char tag,
const void *value, size_t vlen) {
struct x509_parse_context *ctx = context;
struct asymmetric_key_id *kid;
pr_debug("AKID: keyid: %*phN\n", (int)vlen, value);
if (ctx->cert->sig->auth_ids[1])
return 0;
kid = ... | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_parser.h | static inline int fips_signature_selftest(void) { return 0; }
#endif | [
0,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_public_key.c | int x509_get_sig_params(struct x509_certificate *cert) {
struct public_key_signature *sig = cert->sig;
struct crypto_shash *tfm;
struct shash_desc *desc;
size_t desc_size;
int ret;
pr_devel("==>%s()\n", __func__);
sig->data = cert->tbs;
sig->data_size = cert->tbs_size;
sig->s = kmemdup(cert->raw_si... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_public_key.c | int x509_check_for_self_signed(struct x509_certificate *cert) {
int ret = 0;
pr_devel("==>%s()\n", __func__);
if (cert->raw_subject_size != cert->raw_issuer_size ||
memcmp(cert->raw_subject, cert->raw_issuer, cert->raw_issuer_size) != 0)
goto not_self_signed;
if (cert->sig->auth_ids[0] || cert->sig... | [
1,
0
] |
Linux Kernel | crypto/asymmetric_keys/x509_public_key.c |
static void __exit x509_key_exit(void) {
unregister_asymmetric_key_parser(&x509_key_parser);
} | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_pq.c |
static inline struct dma_chan *pq_val_chan(struct async_submit_ctl *submit,
struct page **blocks, int disks,
size_t len) {
#ifdef CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA
return NULL;
#endif
return async_tx_find_channel(submit, DMA_PQ_... | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_pq.c |
static void __exit async_pq_exit(void) { __free_page(pq_scribble_page); } | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_tx.c | struct dma_async_tx_descriptor *
async_trigger_callback(struct async_submit_ctl *submit) {
struct dma_chan *chan;
struct dma_device *device;
struct dma_async_tx_descriptor *tx;
struct dma_async_tx_descriptor *depend_tx = submit->depend_tx;
if (depend_tx) {
chan = depend_tx->chan;
device = chan->devic... | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_xor.c | void do_sync_xor_offs(struct page *dest, unsigned int offset,
struct page **src_list, unsigned int *src_offs,
int src_cnt, size_t len,
struct async_submit_ctl *submit) {
int i;
int xor_src_cnt = 0;
int src_off = 0;
void *dest_buf;
void **srcs;
... | [
1,
0
] |
Linux Kernel | crypto/async_tx/async_xor.c |
static inline bool dma_xor_aligned_offsets(struct dma_device *device,
unsigned int offset,
unsigned int *src_offs, int src_cnt,
int len) {
int i;
if (!is_dma_xor_aligned(device, offset,... | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_xor.c |
static int page_is_zero(struct page *p, unsigned int offset, size_t len) {
return !memchr_inv(page_address(p) + offset, 0, len);
} | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_xor.c |
static inline struct dma_chan *xor_val_chan(struct async_submit_ctl *submit,
struct page *dest,
struct page **src_list, int src_cnt,
size_t len) {
#ifdef CONFIG_ASYNC_TX_DISABLE_XOR_VAL_D... | [
0,
0
] |
Linux Kernel | crypto/async_tx/async_xor.c | struct dma_async_tx_descriptor *
async_xor_val(struct page *dest, struct page **src_list, unsigned int offset,
int src_cnt, size_t len, enum sum_check_flags *result,
struct async_submit_ctl *submit) {
return async_xor_val_offs(dest, offset, src_list, NULL, src_cnt, len, result,
... | [
0,
0
] |
Linux Kernel | crypto/async_tx/raid6test.c |
static int test_disks(int i, int j, int disks) {
int erra, errb;
memset(page_address(recovi), 0xf0, PAGE_SIZE);
memset(page_address(recovj), 0xba, PAGE_SIZE);
dataptrs[i] = recovi;
dataptrs[j] = recovj;
raid6_dual_recov(disks, PAGE_SIZE, i, j, dataptrs, dataoffs);
erra = memcmp(page_address(data[i]),... | [
1,
0
] |
Linux Kernel | crypto/authenc.c |
static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key,
unsigned int keylen) {
struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc);
struct crypto_ahash *auth = ctx->auth;
struct crypto_skcipher *enc = ctx->enc;
struct crypto_authenc_keys keys;
int e... | [
1,
0
] |
Linux Kernel | crypto/authenc.c |
static void authenc_verify_ahash_done(struct crypto_async_request *areq,
int err) {
struct aead_request *req = areq->data;
if (err)
goto out;
err = crypto_authenc_decrypt_tail(req, 0);
out:
authenc_request_complete(req, err);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.