Home
last modified time | relevance | path

Searched refs:hash (Results 1 – 25 of 28) sorted by relevance

12

/security/integrity/ima/
Dima_crypto.c205 struct ima_digest_data *hash, in ima_calc_file_hash_atfm() argument
216 hash->length = crypto_ahash_digestsize(tfm); in ima_calc_file_hash_atfm()
307 ahash_request_set_crypt(req, NULL, hash->digest, 0); in ima_calc_file_hash_atfm()
315 static int ima_calc_file_ahash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_ahash() argument
320 tfm = ima_alloc_atfm(hash->algo); in ima_calc_file_ahash()
324 rc = ima_calc_file_hash_atfm(file, hash, tfm); in ima_calc_file_ahash()
332 struct ima_digest_data *hash, in ima_calc_file_hash_tfm() argument
342 hash->length = crypto_shash_digestsize(tfm); in ima_calc_file_hash_tfm()
376 rc = crypto_shash_final(shash, hash->digest); in ima_calc_file_hash_tfm()
380 static int ima_calc_file_shash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_shash() argument
[all …]
Dima_api.c102 } hash; in ima_store_template() local
108 hash.hdr.algo = HASH_ALGO_SHA1; in ima_store_template()
111 num_fields, &hash.hdr); in ima_store_template()
118 memcpy(entry->digest, hash.hdr.digest, hash.hdr.length); in ima_store_template()
221 } hash; in ima_collect_measurement() local
240 hash.hdr.algo = algo; in ima_collect_measurement()
243 memset(&hash.digest, 0, sizeof(hash.digest)); in ima_collect_measurement()
246 result = ima_calc_buffer_hash(buf, size, &hash.hdr); in ima_collect_measurement()
248 result = ima_calc_file_hash(file, &hash.hdr); in ima_collect_measurement()
253 length = sizeof(hash.hdr) + hash.hdr.length; in ima_collect_measurement()
[all …]
Dima_template_lib.c274 } hash; in ima_eventdigest_init() local
280 memset(&hash, 0, sizeof(hash)); in ima_eventdigest_init()
293 hash.hdr.algo = HASH_ALGO_SHA1; in ima_eventdigest_init()
294 result = ima_calc_boot_aggregate(&hash.hdr); in ima_eventdigest_init()
297 if (!result && hash.hdr.algo != HASH_ALGO_SHA1) in ima_eventdigest_init()
301 memset(&hash, 0, sizeof(hash)); in ima_eventdigest_init()
304 cur_digest = hash.hdr.digest; in ima_eventdigest_init()
313 hash.hdr.algo = ima_template_hash_algo_allowed(ima_hash_algo) ? in ima_eventdigest_init()
315 result = ima_calc_file_hash(event_data->file, &hash.hdr); in ima_eventdigest_init()
322 cur_digest = hash.hdr.digest; in ima_eventdigest_init()
[all …]
Dima_init.c55 } hash; in ima_add_boot_aggregate() local
58 memset(&hash, 0, sizeof(hash)); in ima_add_boot_aggregate()
59 iint->ima_hash = &hash.hdr; in ima_add_boot_aggregate()
76 result = ima_calc_boot_aggregate(&hash.hdr); in ima_add_boot_aggregate()
Dima.h138 int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash);
140 struct ima_digest_data *hash);
143 struct ima_digest_data *hash);
144 int ima_calc_boot_aggregate(struct ima_digest_data *hash);
DKconfig18 Measurement Architecture(IMA) maintains a list of hash
69 hash, defined as 20 bytes, and a null terminated pathname,
71 template permits both larger hash digests and longer
87 prompt "Default integrity hash algorithm"
90 Select the default hash algorithm used for the measurement
92 hash algorithm can be overwritten using the kernel command
144 attribute containing the file hash measurement. To protect
Dima_queue.c139 static int ima_pcr_extend(const u8 *hash, int pcr) in ima_pcr_extend() argument
148 memcpy(digests[i].digest, hash, TPM_DIGEST_SIZE); in ima_pcr_extend()
Dima_main.c667 } hash = {}; in process_buffer_measurement() local
677 iint.ima_hash = &hash.hdr; in process_buffer_measurement()
/security/apparmor/
Dcrypto.c31 char *hash = NULL; in aa_calc_hash() local
37 hash = kzalloc(apparmor_hash_size, GFP_KERNEL); in aa_calc_hash()
38 if (!hash) in aa_calc_hash()
49 error = crypto_shash_final(desc, hash); in aa_calc_hash()
53 return hash; in aa_calc_hash()
56 kfree(hash); in aa_calc_hash()
74 profile->hash = kzalloc(apparmor_hash_size, GFP_KERNEL); in aa_calc_profile_hash()
75 if (!profile->hash) in aa_calc_profile_hash()
89 error = crypto_shash_final(desc, profile->hash); in aa_calc_profile_hash()
96 kfree(profile->hash); in aa_calc_profile_hash()
[all …]
Dpolicy_unpack.c142 if (aa_g_hash_policy && memcmp(l->hash, r->hash, aa_hash_size()) != 0) in aa_rawdata_eq()
163 kzfree(d->hash); in do_loaddata_free()
1107 udata->hash = aa_calc_hash(udata->data, udata->size); in aa_unpack()
1108 if (IS_ERR(udata->hash)) { in aa_unpack()
1109 error = PTR_ERR(udata->hash); in aa_unpack()
1110 udata->hash = NULL; in aa_unpack()
DKconfig29 bool "Enable policy hash introspection by default"
Dapparmorfs.c1113 if (profile->hash) { in seq_profile_hash_show()
1115 seq_printf(seq, "%.2x", profile->hash[i]); in seq_profile_hash_show()
1126 SEQ_PROFILE_FOPS(hash);
1277 if (data->hash) { in seq_rawdata_hash_show()
1279 seq_printf(seq, "%.2x", data->hash[i]); in seq_rawdata_hash_show()
1288 SEQ_RAWDATA_FOPS(hash);
1641 if (profile->hash) { in __aafs_profile_mkdir()
/security/integrity/platform_certs/
Dkeyring_handler.c25 char *hash, *p; in uefi_blacklist_hash() local
27 hash = kmalloc(type_len + len * 2 + 1, GFP_KERNEL); in uefi_blacklist_hash()
28 if (!hash) in uefi_blacklist_hash()
30 p = memcpy(hash, type, type_len); in uefi_blacklist_hash()
36 mark_hash_blacklisted(hash); in uefi_blacklist_hash()
37 kfree(hash); in uefi_blacklist_hash()
/security/selinux/ss/
Dcontext.h34 u32 hash; /* a hash of the string representation */ member
140 dst->hash = src->hash; in context_cpy()
146 c->user = c->role = c->type = c->hash = 0; in context_destroy()
155 if (c1->hash && c2->hash && (c1->hash != c2->hash)) in context_cmp()
Davtab.c41 u32 hash = 0; in avtab_hash() local
48 hash ^= v; \ in avtab_hash()
49 hash = (hash << r2) | (hash >> (32 - r2)); \ in avtab_hash()
50 hash = hash * m + n; \ in avtab_hash()
59 hash ^= hash >> 16; in avtab_hash()
60 hash *= 0x85ebca6b; in avtab_hash()
61 hash ^= hash >> 13; in avtab_hash()
62 hash *= 0xc2b2ae35; in avtab_hash()
63 hash ^= hash >> 16; in avtab_hash()
65 return hash & mask; in avtab_hash()
Dsidtab.c47 context->hash) { in context_to_sid()
81 hash_add(s->context_to_sid, &entry->leaf.list, context->hash); in sidtab_set_initial()
301 &dst_convert->list, dst_convert->context.hash); in sidtab_context_to_sid()
312 hash_add_rcu(s->context_to_sid, &dst->list, dst->context.hash); in sidtab_context_to_sid()
330 entry->context.hash); in sidtab_convert_hashtable()
Dservices.c1477 context->hash = context_compute_hash(context->str); in context_add_hash()
1483 context->hash = context_compute_hash(str); in context_add_hash()
1496 if (!context->hash) { in context_struct_to_sid()
2013 newc->hash = oldc->hash; in convert_context()
2103 newc->hash = context_compute_hash(s); in convert_context()
2692 usercon.hash = 0; in security_get_user_sids()
/security/tomoyo/
Dmemory.c155 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()
Dcommon.h506 u32 hash; /* = full_name_hash(name, strlen(name)) */ member
1168 return a->hash != b->hash || strcmp(a->name, b->name); in tomoyo_pathcmp()
/security/smack/
Dsmack_access.c403 unsigned int hash; in smk_insert_entry() local
406 hash = full_name_hash(NULL, skp->smk_known, strlen(skp->smk_known)); in smk_insert_entry()
407 head = &smack_known_hash[hash & (SMACK_HASH_SLOTS - 1)]; in smk_insert_entry()
422 unsigned int hash; in smk_find_entry() local
426 hash = full_name_hash(NULL, string, strlen(string)); in smk_find_entry()
427 head = &smack_known_hash[hash & (SMACK_HASH_SLOTS - 1)]; in smk_find_entry()
/security/keys/
Dkeyring.c168 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 …]
Dtrusted.c763 opt->hash = tpm2 ? HASH_ALGO_SHA256 : HASH_ALGO_SHA1; in getoptions()
822 opt->hash = i; in getoptions()
834 digest_len = hash_digest_size[opt->hash]; in getoptions()
/security/apparmor/include/
Dpolicy_unpack.h67 unsigned char *hash; member
Dpolicy.h158 unsigned char *hash; member
/security/selinux/
DKconfig96 to 2^SECURITY_SELINUX_SIDTAB_HASH_BITS buckets. The number of hash

12