Lines Matching full:hash

89  * Calculate the hash of a template entry, add the template entry
129 * Violations are flagged in the measurement list with zero hash values.
175 * @allowed_algos: allowlist of hash algorithms for the IMA xattr
205 struct ima_max_digest_data *hash) in ima_get_verity_digest() argument
212 * hash containing 0's. in ima_get_verity_digest()
214 digest_len = fsverity_get_digest(iint->inode, hash->digest, NULL, &alg); in ima_get_verity_digest()
219 * Unlike in the case of actually calculating the file hash, in in ima_get_verity_digest()
220 * the fsverity case regardless of the hash algorithm, return in ima_get_verity_digest()
225 hash->hdr.algo = alg; in ima_get_verity_digest()
226 hash->hdr.length = digest_len; in ima_get_verity_digest()
233 * Calculate the file hash, if it doesn't already exist,
247 struct ima_max_digest_data hash; in ima_collect_measurement() local
275 hash.hdr.algo = algo; in ima_collect_measurement()
276 hash.hdr.length = hash_digest_size[algo]; in ima_collect_measurement()
278 /* Initialize hash digest to 0's in case of failure */ in ima_collect_measurement()
279 memset(&hash.digest, 0, sizeof(hash.digest)); in ima_collect_measurement()
282 if (!ima_get_verity_digest(iint, &hash)) { in ima_collect_measurement()
287 result = ima_calc_buffer_hash(buf, size, &hash.hdr); in ima_collect_measurement()
289 result = ima_calc_file_hash(file, &hash.hdr); in ima_collect_measurement()
295 length = sizeof(hash.hdr) + hash.hdr.length; in ima_collect_measurement()
303 memcpy(iint->ima_hash, &hash, length); in ima_collect_measurement()
384 char *hash; in ima_audit_measurement() local
391 hash = kzalloc((iint->ima_hash->length * 2) + 1, GFP_KERNEL); in ima_audit_measurement()
392 if (!hash) in ima_audit_measurement()
396 hex_byte_pack(hash + (i * 2), iint->ima_hash->digest[i]); in ima_audit_measurement()
397 hash[i * 2] = '\0'; in ima_audit_measurement()
406 audit_log_format(ab, " hash=\"%s:%s\"", algo_name, hash); in ima_audit_measurement()
413 kfree(hash); in ima_audit_measurement()