| /security/apparmor/ |
| A D | crypto.c | 26 char *hash; in aa_calc_hash() local 28 hash = kzalloc(SHA256_DIGEST_SIZE, GFP_KERNEL); in aa_calc_hash() 29 if (!hash) in aa_calc_hash() 32 sha256(data, len, hash); in aa_calc_hash() 33 return hash; in aa_calc_hash() 45 profile->hash = kzalloc(SHA256_DIGEST_SIZE, GFP_KERNEL); in aa_calc_profile_hash() 46 if (!profile->hash) in aa_calc_profile_hash() 52 sha256_final(&sctx, profile->hash); in aa_calc_profile_hash()
|
| A D | policy_unpack.c | 107 if (aa_g_hash_policy && memcmp(l->hash, r->hash, aa_hash_size()) != 0) in aa_rawdata_eq() 128 kfree_sensitive(d->hash); in do_loaddata_free() 1506 udata->hash = aa_calc_hash(udata->data, udata->size); in aa_unpack() 1507 if (IS_ERR(udata->hash)) { in aa_unpack() 1508 error = PTR_ERR(udata->hash); in aa_unpack() 1509 udata->hash = NULL; in aa_unpack()
|
| /security/integrity/ima/ |
| A D | ima_crypto.c | 440 tfm = ima_alloc_atfm(hash->algo); in ima_calc_file_ahash() 452 struct ima_digest_data *hash, in ima_calc_file_hash_tfm() argument 507 tfm = ima_alloc_tfm(hash->algo); in ima_calc_file_shash() 544 hash->algo = ima_hash_algo; in ima_calc_file_hash() 568 rc = ima_calc_file_shash(f, hash); in ima_calc_file_hash() 704 tfm = ima_alloc_atfm(hash->algo); in calc_buffer_ahash() 716 struct ima_digest_data *hash, in calc_buffer_shash_tfm() argument 751 tfm = ima_alloc_tfm(hash->algo); in calc_buffer_shash() 762 struct ima_digest_data *hash) in ima_calc_buffer_hash() argument 847 if (crypto_id == hash->algo) { in ima_calc_boot_aggregate() [all …]
|
| A D | ima_api.c | 206 struct ima_max_digest_data *hash) in ima_get_verity_digest() argument 226 hash->hdr.algo = alg; in ima_get_verity_digest() 227 hash->hdr.length = digest_len; in ima_get_verity_digest() 248 struct ima_max_digest_data hash; in ima_collect_measurement() local 279 hash.hdr.algo = algo; in ima_collect_measurement() 283 memset(&hash.digest, 0, sizeof(hash.digest)); in ima_collect_measurement() 299 length = sizeof(hash.hdr) + hash.hdr.length; in ima_collect_measurement() 396 char *hash; in ima_audit_measurement() local 404 if (!hash) in ima_audit_measurement() 409 hash[i * 2] = '\0'; in ima_audit_measurement() [all …]
|
| A D | ima_init.c | 50 struct ima_max_digest_data hash; in ima_add_boot_aggregate() local 51 struct ima_digest_data *hash_hdr = container_of(&hash.hdr, in ima_add_boot_aggregate() 57 memset(&hash, 0, sizeof(hash)); in ima_add_boot_aggregate()
|
| A D | ima_template_lib.c | 347 struct ima_max_digest_data hash; in ima_eventdigest_init() local 348 struct ima_digest_data *hash_hdr = container_of(&hash.hdr, in ima_eventdigest_init() 355 memset(&hash, 0, sizeof(hash)); in ima_eventdigest_init() 368 hash.hdr.algo = HASH_ALGO_SHA1; in ima_eventdigest_init() 372 if (!result && hash.hdr.algo != HASH_ALGO_SHA1) in ima_eventdigest_init() 376 memset(&hash, 0, sizeof(hash)); in ima_eventdigest_init() 388 hash.hdr.algo = ima_template_hash_algo_allowed(ima_hash_algo) ? in ima_eventdigest_init() 398 cur_digestsize = hash.hdr.length; in ima_eventdigest_init()
|
| A D | ima_appraise.c | 254 struct ima_digest_data *hash) in calc_file_id_hash() argument 263 memcpy(file_id.hash, digest, hash_digest_size[algo]); in calc_file_id_hash() 265 hash->algo = algo; in calc_file_id_hash() 266 hash->length = hash_digest_size[algo]; in calc_file_id_hash() 268 return ima_calc_buffer_hash(&file_id, sizeof(file_id) - unused, hash); in calc_file_id_hash() 282 struct ima_max_digest_data hash; in xattr_verify() local 383 container_of(&hash.hdr, in xattr_verify() 393 xattr_len, hash.digest, in xattr_verify() 394 hash.hdr.length); in xattr_verify()
|
| A D | Kconfig | 19 Measurement Architecture(IMA) maintains a list of hash 70 hash, defined as 20 bytes, and a null terminated pathname, 72 template permits both larger hash digests and longer 88 prompt "Default integrity hash algorithm" 91 Select the default hash algorithm used for the measurement 93 hash algorithm can be overwritten using the kernel command 150 attribute containing the file hash measurement. To protect
|
| A D | ima.h | 265 int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash); 267 struct ima_digest_data *hash); 270 int ima_calc_boot_aggregate(struct ima_digest_data *hash);
|
| A D | ima_main.c | 1024 struct ima_max_digest_data hash; in process_buffer_measurement() local 1025 struct ima_digest_data *hash_hdr = container_of(&hash.hdr, in process_buffer_measurement() 1160 bool hash, u8 *digest, size_t digest_len) in ima_measure_critical_data() argument 1167 event_label, hash, digest, in ima_measure_critical_data()
|
| /security/selinux/ss/ |
| A D | context.c | 16 u32 hash = 0; in context_compute_hash() local 29 hash = jhash_3words(c->user, c->role, c->type, hash); in context_compute_hash() 30 hash = mls_range_hash(&c->range, hash); in context_compute_hash() 31 return hash; in context_compute_hash()
|
| A D | symtab.c | 19 unsigned int hash = 5381; in symhash() local 23 hash = ((hash << 5) + hash) ^ c; in symhash() 25 return hash; in symhash() 38 .hash = symhash,
|
| A D | mls.h | 88 static inline u32 mls_range_hash(const struct mls_range *r, u32 hash) in mls_range_hash() argument 90 hash = jhash_2words(r->level[0].sens, r->level[1].sens, hash); in mls_range_hash() 91 hash = ebitmap_hash(&r->level[0].cat, hash); in mls_range_hash() 92 hash = ebitmap_hash(&r->level[1].cat, hash); in mls_range_hash() 93 return hash; in mls_range_hash()
|
| A D | sidtab.c | 67 if (entry->hash != hash) in context_to_sid() 81 u32 hash; in sidtab_set_initial() local 98 hash = context_compute_hash(context); in sidtab_set_initial() 106 if (!context_to_sid(s, context, hash)) { in sidtab_set_initial() 108 isid->entry.hash = hash; in sidtab_set_initial() 109 hash_add(s->context_to_sid, &isid->entry.list, hash); in sidtab_set_initial() 271 u32 count, hash = context_compute_hash(context); in sidtab_context_to_sid() local 276 *sid = context_to_sid(s, context, hash); in sidtab_context_to_sid() 284 *sid = context_to_sid(s, context, hash); in sidtab_context_to_sid() 311 dst->hash = hash; in sidtab_context_to_sid() [all …]
|
| A D | avtab.c | 39 u32 hash = 0; in avtab_hash() local 47 hash ^= v; \ in avtab_hash() 48 hash = (hash << r2) | (hash >> (32 - r2)); \ in avtab_hash() 49 hash = hash * m + n; \ in avtab_hash() 58 hash ^= hash >> 16; in avtab_hash() 59 hash *= 0x85ebca6b; in avtab_hash() 60 hash ^= hash >> 13; in avtab_hash() 61 hash *= 0xc2b2ae35; in avtab_hash() 62 hash ^= hash >> 16; in avtab_hash() 64 return hash & mask; in avtab_hash()
|
| A D | hashtab.h | 22 u32 (*hash)(const void *key); /* hash func */ member 73 hvalue = key_params.hash(key) & (h->size - 1); in hashtab_insert() 106 hvalue = key_params.hash(key) & (h->size - 1); in hashtab_search()
|
| A D | ebitmap.c | 560 u32 ebitmap_hash(const struct ebitmap *e, u32 hash) in ebitmap_hash() argument 565 hash = jhash_1word(e->highbit, hash); in ebitmap_hash() 567 hash = jhash_1word(node->startbit, hash); in ebitmap_hash() 568 hash = jhash(node->maps, sizeof(node->maps), hash); in ebitmap_hash() 570 return hash; in ebitmap_hash()
|
| A D | sidtab.h | 23 u32 hash; member
|
| /security/keys/ |
| A D | dh.c | 67 static int kdf_alloc(struct crypto_shash **hash, char *hashname) in kdf_alloc() argument 83 *hash = tfm; in kdf_alloc() 88 static void kdf_dealloc(struct crypto_shash *hash) in kdf_dealloc() argument 90 if (hash) in kdf_dealloc() 91 crypto_free_shash(hash); in kdf_dealloc() 94 static int keyctl_dh_compute_kdf(struct crypto_shash *hash, in keyctl_dh_compute_kdf() argument 101 size_t outbuf_len = roundup(buflen, crypto_shash_digestsize(hash)); in keyctl_dh_compute_kdf() 138 struct crypto_shash *hash = NULL; in __keyctl_dh_compute() local 171 ret = kdf_alloc(&hash, hashname); in __keyctl_dh_compute() 277 ret = keyctl_dh_compute_kdf(hash, buffer, buflen, outbuf, in __keyctl_dh_compute() [all …]
|
| A D | keyring.c | 168 unsigned long hash, type; in hash_key_type_and_desc() local 195 hash = acc; in hash_key_type_and_desc() 197 hash ^= acc >> 32; in hash_key_type_and_desc() 203 if (index_key->type != &key_type_keyring && (hash & fan_mask) == 0) in hash_key_type_and_desc() 204 hash |= (hash >> (ASSOC_ARRAY_KEY_CHUNK_SIZE - level_shift)) | 1; in hash_key_type_and_desc() 205 else if (index_key->type == &key_type_keyring && (hash & fan_mask) != 0) in hash_key_type_and_desc() 206 hash = (hash + (hash << level_shift)) & ~fan_mask; in hash_key_type_and_desc() 207 index_key->hash = hash; in hash_key_type_and_desc() 278 return index_key->hash; in keyring_get_key_chunk() 334 seg_a = a->hash; in keyring_diff_objects() [all …]
|
| /security/tomoyo/ |
| A D | memory.c | 155 unsigned int hash; in tomoyo_get_name() local 162 hash = full_name_hash(NULL, (const unsigned char *) name, len - 1); in tomoyo_get_name() 163 head = &tomoyo_name_list[hash_long(hash, TOMOYO_HASH_BITS)]; in tomoyo_get_name() 167 if (hash != ptr->entry.hash || strcmp(name, ptr->entry.name) || in tomoyo_get_name()
|
| /security/smack/ |
| A D | smack_access.c | 412 unsigned int hash; in smk_insert_entry() local 415 hash = full_name_hash(NULL, skp->smk_known, strlen(skp->smk_known)); in smk_insert_entry() 416 head = &smack_known_hash[hash & (SMACK_HASH_SLOTS - 1)]; in smk_insert_entry() 431 unsigned int hash; in smk_find_entry() local 435 hash = full_name_hash(NULL, string, strlen(string)); in smk_find_entry() 436 head = &smack_known_hash[hash & (SMACK_HASH_SLOTS - 1)]; in smk_find_entry()
|
| /security/ipe/ |
| A D | Kconfig | 57 bool "Enable support for dm-verity based on root hash" 62 volume is evaluated, and the volume's root hash matches the value 66 bool "Enable support for dm-verity based on root hash signature" 71 volume, which has been mounted with a valid signed root hash,
|
| /security/keys/trusted-keys/ |
| A D | trusted_tpm2.c | 247 u32 hash; in tpm2_seal_trusted() local 253 if (options->hash == tpm2_hash_map[i].crypto_id) { in tpm2_seal_trusted() 254 hash = tpm2_hash_map[i].tpm_id; in tpm2_seal_trusted() 303 tpm_buf_append_u16(&sized, hash); in tpm2_seal_trusted()
|
| /security/apparmor/include/ |
| A D | policy_unpack.h | 110 unsigned char *hash; member
|