Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

WinCertificate.h 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /** @file
  2. GUID for UEFI WIN_CERTIFICATE structure.
  3. Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
  4. This program and the accompanying materials
  5. are licensed and made available under the terms and conditions of the BSD License
  6. which accompanies this distribution. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. @par Revision Reference:
  11. GUID defined in UEFI 2.0 spec.
  12. **/
  13. #ifndef __EFI_WIN_CERTIFICATE_H__
  14. #define __EFI_WIN_CERTIFICATE_H__
  15. FILE_LICENCE ( BSD3 );
  16. //
  17. // _WIN_CERTIFICATE.wCertificateType
  18. //
  19. #define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
  20. #define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
  21. #define WIN_CERT_TYPE_EFI_GUID 0x0EF1
  22. ///
  23. /// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
  24. ///
  25. typedef struct {
  26. ///
  27. /// The length of the entire certificate,
  28. /// including the length of the header, in bytes.
  29. ///
  30. UINT32 dwLength;
  31. ///
  32. /// The revision level of the WIN_CERTIFICATE
  33. /// structure. The current revision level is 0x0200.
  34. ///
  35. UINT16 wRevision;
  36. ///
  37. /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
  38. /// certificate types. The UEFI specification reserves the range of
  39. /// certificate type values from 0x0EF0 to 0x0EFF.
  40. ///
  41. UINT16 wCertificateType;
  42. ///
  43. /// The following is the actual certificate. The format of
  44. /// the certificate depends on wCertificateType.
  45. ///
  46. /// UINT8 bCertificate[ANYSIZE_ARRAY];
  47. ///
  48. } WIN_CERTIFICATE;
  49. ///
  50. /// WIN_CERTIFICATE_UEFI_GUID.CertType
  51. ///
  52. #define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
  53. {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
  54. ///
  55. /// WIN_CERTIFICATE_UEFI_GUID.CertData
  56. ///
  57. typedef struct {
  58. EFI_GUID HashType;
  59. UINT8 PublicKey[256];
  60. UINT8 Signature[256];
  61. } EFI_CERT_BLOCK_RSA_2048_SHA256;
  62. ///
  63. /// Certificate which encapsulates a GUID-specific digital signature
  64. ///
  65. typedef struct {
  66. ///
  67. /// This is the standard WIN_CERTIFICATE header, where
  68. /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
  69. ///
  70. WIN_CERTIFICATE Hdr;
  71. ///
  72. /// This is the unique id which determines the
  73. /// format of the CertData. .
  74. ///
  75. EFI_GUID CertType;
  76. ///
  77. /// The following is the certificate data. The format of
  78. /// the data is determined by the CertType.
  79. /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
  80. /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
  81. ///
  82. UINT8 CertData[1];
  83. } WIN_CERTIFICATE_UEFI_GUID;
  84. ///
  85. /// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
  86. ///
  87. /// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
  88. /// WIN_CERTIFICATE and encapsulate the information needed to
  89. /// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
  90. /// specified in RFC2437.
  91. ///
  92. typedef struct {
  93. ///
  94. /// This is the standard WIN_CERTIFICATE header, where
  95. /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
  96. ///
  97. WIN_CERTIFICATE Hdr;
  98. ///
  99. /// This is the hashing algorithm which was performed on the
  100. /// UEFI executable when creating the digital signature.
  101. ///
  102. EFI_GUID HashAlgorithm;
  103. ///
  104. /// The following is the actual digital signature. The
  105. /// size of the signature is the same size as the key
  106. /// (1024-bit key is 128 bytes) and can be determined by
  107. /// subtracting the length of the other parts of this header
  108. /// from the total length of the certificate as found in
  109. /// Hdr.dwLength.
  110. ///
  111. /// UINT8 Signature[];
  112. ///
  113. } WIN_CERTIFICATE_EFI_PKCS1_15;
  114. extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid;
  115. #endif