SecureBootVariableProvisionLib.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /** @file
  2. Provides a functions to enroll keys based on default values.
  3. Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
  4. (C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
  5. Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
  6. Copyright (c) 2021, Semihalf All rights reserved.<BR>
  7. SPDX-License-Identifier: BSD-2-Clause-Patent
  8. **/
  9. #ifndef SECURE_BOOT_VARIABLE_PROVISION_LIB_H_
  10. #define SECURE_BOOT_VARIABLE_PROVISION_LIB_H_
  11. /**
  12. Sets the content of the 'db' variable based on 'dbDefault' variable content.
  13. @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
  14. while VendorGuid is NULL.
  15. @retval other Errors from GetVariable2(), GetTime() and SetVariable()
  16. --*/
  17. EFI_STATUS
  18. EFIAPI
  19. EnrollDbFromDefault (
  20. VOID
  21. );
  22. /**
  23. Sets the content of the 'dbx' variable based on 'dbxDefault' variable content.
  24. @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
  25. while VendorGuid is NULL.
  26. @retval other Errors from GetVariable2(), GetTime() and SetVariable()
  27. --*/
  28. EFI_STATUS
  29. EFIAPI
  30. EnrollDbxFromDefault (
  31. VOID
  32. );
  33. /**
  34. Sets the content of the 'dbt' variable based on 'dbtDefault' variable content.
  35. @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
  36. while VendorGuid is NULL.
  37. @retval other Errors from GetVariable2(), GetTime() and SetVariable()
  38. --*/
  39. EFI_STATUS
  40. EFIAPI
  41. EnrollDbtFromDefault (
  42. VOID
  43. );
  44. /**
  45. Sets the content of the 'KEK' variable based on 'KEKDefault' variable content.
  46. @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
  47. while VendorGuid is NULL.
  48. @retval other Errors from GetVariable2(), GetTime() and SetVariable()
  49. --*/
  50. EFI_STATUS
  51. EFIAPI
  52. EnrollKEKFromDefault (
  53. VOID
  54. );
  55. /**
  56. Sets the content of the 'PK' variable based on 'PKDefault' variable content.
  57. @retval EFI_OUT_OF_RESOURCES If memory allocation for EFI_VARIABLE_AUTHENTICATION_2 fails
  58. while VendorGuid is NULL.
  59. @retval other Errors from GetVariable2(), GetTime() and SetVariable()
  60. --*/
  61. EFI_STATUS
  62. EFIAPI
  63. EnrollPKFromDefault (
  64. VOID
  65. );
  66. /**
  67. Initializes PKDefault variable with data from FFS section.
  68. @retval EFI_SUCCESS Variable was initialized successfully.
  69. @retval EFI_UNSUPPORTED Variable already exists.
  70. --*/
  71. EFI_STATUS
  72. SecureBootInitPKDefault (
  73. IN VOID
  74. );
  75. /**
  76. Initializes KEKDefault variable with data from FFS section.
  77. @retval EFI_SUCCESS Variable was initialized successfully.
  78. @retval EFI_UNSUPPORTED Variable already exists.
  79. --*/
  80. EFI_STATUS
  81. SecureBootInitKEKDefault (
  82. IN VOID
  83. );
  84. /**
  85. Initializes dbDefault variable with data from FFS section.
  86. @retval EFI_SUCCESS Variable was initialized successfully.
  87. @retval EFI_UNSUPPORTED Variable already exists.
  88. --*/
  89. EFI_STATUS
  90. SecureBootInitDbDefault (
  91. IN VOID
  92. );
  93. /**
  94. Initializes dbtDefault variable with data from FFS section.
  95. @retval EFI_SUCCESS Variable was initialized successfully.
  96. @retval EFI_UNSUPPORTED Variable already exists.
  97. --*/
  98. EFI_STATUS
  99. SecureBootInitDbtDefault (
  100. IN VOID
  101. );
  102. /**
  103. Initializes dbxDefault variable with data from FFS section.
  104. @retval EFI_SUCCESS Variable was initialized successfully.
  105. @retval EFI_UNSUPPORTED Variable already exists.
  106. --*/
  107. EFI_STATUS
  108. SecureBootInitDbxDefault (
  109. IN VOID
  110. );
  111. #endif