trusted-type.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2010 IBM Corporation
  4. * Author: David Safford <safford@us.ibm.com>
  5. */
  6. #ifndef _KEYS_TRUSTED_TYPE_H
  7. #define _KEYS_TRUSTED_TYPE_H
  8. #include <linux/key.h>
  9. #include <linux/rcupdate.h>
  10. #include <linux/tpm.h>
  11. #define MIN_KEY_SIZE 32
  12. #define MAX_KEY_SIZE 128
  13. #define MAX_BLOB_SIZE 512
  14. #define MAX_PCRINFO_SIZE 64
  15. #define MAX_DIGEST_SIZE 64
  16. struct trusted_key_payload {
  17. struct rcu_head rcu;
  18. unsigned int key_len;
  19. unsigned int blob_len;
  20. unsigned char migratable;
  21. unsigned char key[MAX_KEY_SIZE + 1];
  22. unsigned char blob[MAX_BLOB_SIZE];
  23. };
  24. struct trusted_key_options {
  25. uint16_t keytype;
  26. uint32_t keyhandle;
  27. unsigned char keyauth[TPM_DIGEST_SIZE];
  28. uint32_t blobauth_len;
  29. unsigned char blobauth[TPM_DIGEST_SIZE];
  30. uint32_t pcrinfo_len;
  31. unsigned char pcrinfo[MAX_PCRINFO_SIZE];
  32. int pcrlock;
  33. uint32_t hash;
  34. uint32_t policydigest_len;
  35. unsigned char policydigest[MAX_DIGEST_SIZE];
  36. uint32_t policyhandle;
  37. };
  38. extern struct key_type key_type_trusted;
  39. #endif /* _KEYS_TRUSTED_TYPE_H */