Lines Matching defs:modsig
18 struct modsig {
23 /* This digest will go in the 'd-modsig' field of the IMA template. */
36 * ima_read_modsig - Read modsig from buf.
41 struct modsig **modsig)
45 struct modsig *hdr;
85 *modsig = hdr;
92 * @modsig: parsed module signature
96 * Since the modsig is part of the file contents, the hash used in its signature
100 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size)
108 size -= modsig->raw_pkcs7_len + strlen(MODULE_SIG_STRING) +
110 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size);
115 rc = pkcs7_get_digest(modsig->pkcs7_msg, &modsig->digest,
116 &modsig->digest_size, &modsig->hash_algo);
119 int ima_modsig_verify(struct key *keyring, const struct modsig *modsig)
121 return verify_pkcs7_message_sig(NULL, 0, modsig->pkcs7_msg, keyring,
125 int ima_get_modsig_digest(const struct modsig *modsig, enum hash_algo *algo,
128 *algo = modsig->hash_algo;
129 *digest = modsig->digest;
130 *digest_size = modsig->digest_size;
135 int ima_get_raw_modsig(const struct modsig *modsig, const void **data,
138 *data = &modsig->raw_pkcs7;
139 *data_len = modsig->raw_pkcs7_len;
144 void ima_free_modsig(struct modsig *modsig)
146 if (!modsig)
149 pkcs7_free_message(modsig->pkcs7_msg);
150 kfree(modsig);