struct evm_ima_xattr_data { /* New members must be added within the __struct_group() macro below. */
__struct_group(evm_ima_xattr_data_hdr, hdr, __packed,
u8 type;
);
u8 data[];
} __packed;
static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr), "struct member likely outside of __struct_group()");
/* Only used in the EVM HMAC code. */ struct evm_xattr { struct evm_ima_xattr_data_hdr data;
u8 digest[SHA1_DIGEST_SIZE];
} __packed;
#define IMA_MAX_DIGEST_SIZE HASH_MAX_DIGESTSIZE
struct ima_digest_data { /* New members must be added within the __struct_group() macro below. */
__struct_group(ima_digest_data_hdr, hdr, __packed,
u8 algo;
u8 length; union { struct {
u8 unused;
u8 type;
} sha1; struct {
u8 type;
u8 algo;
} ng;
u8 data[2];
} xattr;
);
u8 digest[];
} __packed;
static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr), "struct member likely outside of __struct_group()");
/* * Instead of wrapping the ima_digest_data struct inside a local structure * with the maximum hash size, define ima_max_digest_data struct.
*/ struct ima_max_digest_data { struct ima_digest_data_hdr hdr;
u8 digest[HASH_MAX_DIGESTSIZE];
} __packed;
/* * signature header format v2 - for using with asymmetric keys * * The signature_v2_hdr struct includes a signature format version * to simplify defining new signature formats. * * signature format: * version 2: regular file data hash based signature * version 3: struct ima_file_id data based signature
*/ struct signature_v2_hdr {
uint8_t type; /* xattr type */
uint8_t version; /* signature format version */
uint8_t hash_algo; /* Digest algorithm [enum hash_algo] */
__be32 keyid; /* IMA key identifier - not X509/PGP specific */
__be16 sig_size; /* signature size */
uint8_t sig[]; /* signature payload */
} __packed;
/* * IMA signature version 3 disambiguates the data that is signed, by * indirectly signing the hash of the ima_file_id structure data, * containing either the fsverity_descriptor struct digest or, in the * future, the regular IMA file hash. * * (The hash of the ima_file_id structure is only of the portion used.)
*/ struct ima_file_id {
__u8 hash_type; /* xattr type [enum evm_ima_xattr_type] */
__u8 hash_algorithm; /* Digest algorithm [enum hash_algo] */
__u8 hash[HASH_MAX_DIGESTSIZE];
} __packed;
int integrity_kernel_read(struct file *file, loff_t offset, void *addr, unsignedlong count);
int integrity_digsig_verify(constunsignedint id, constchar *sig, int siglen, constchar *digest, int digestlen); int integrity_modsig_verify(unsignedint id, conststruct modsig *modsig);
int __init integrity_init_keyring(constunsignedint id); int __init integrity_load_x509(constunsignedint id, constchar *path); int __init integrity_load_cert(constunsignedint id, constchar *source, constvoid *data, size_t len, key_perm_t perm); #else
staticinlineint integrity_digsig_verify(constunsignedint id, constchar *sig, int siglen, constchar *digest, int digestlen)
{ return -EOPNOTSUPP;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.