/* By default, "fsverity sign" signs a file with fsverity_formatted_digest * of the file. fsverity_formatted_digest on the kernel side is only used * with CONFIG_FS_VERITY_BUILTIN_SIGNATURES. However, BPF LSM doesn't not * require CONFIG_FS_VERITY_BUILTIN_SIGNATURES, so vmlinux.h may not have * fsverity_formatted_digest. In this test, we intentionally avoid using * fsverity_formatted_digest. * * Luckily, fsverity_formatted_digest is simply 8-byte magic followed by * fsverity_digest. We use a char array of size fsverity_formatted_digest * plus SHA256_DIGEST_SIZE. The magic part of it is filled by user space, * and the rest of it is filled by bpf_get_fsverity_digest. * * Note that, generating signatures based on fsverity_formatted_digest is * the design choice of this selftest (and "fsverity sign"). With BPF * LSM, we have the flexibility to generate signature based on other data * sets, for example, fsverity_digest or only the digest[] part of it.
*/ #define MAGIC_SIZE 8 #define SIZEOF_STRUCT_FSVERITY_DIGEST 4 /* sizeof(struct fsverity_digest) */ char digest[MAGIC_SIZE + SIZEOF_STRUCT_FSVERITY_DIGEST + SHA256_DIGEST_SIZE];
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.