Skip to content

Instantly share code, notes, and snippets.

@sargun
Created December 23, 2020 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sargun/1a107d58c473a7e31546ec49560a9db1 to your computer and use it in GitHub Desktop.
Save sargun/1a107d58c473a7e31546ec49560a9db1 to your computer and use it in GitHub Desktop.
/* Linux Kernel v5.10
* security/keys/trusted-keys/trusted_tpm1.c#L387
*/
static int pcrlock(const int pcrnum)
{
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return tpm_pcr_extend(chip, pcrnum, digests) ? -EINVAL : 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment