2009-09-02 11:23:28 +02:00
|
|
|
/** @file
|
2014-10-22 05:03:18 +02:00
|
|
|
GUID for UEFI WIN_CERTIFICATE structure.
|
2009-09-02 11:23:28 +02:00
|
|
|
|
2012-10-30 09:27:44 +01:00
|
|
|
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
2014-10-22 05:03:18 +02:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
2009-09-02 11:23:28 +02:00
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2009-09-02 11:23:28 +02:00
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
GUID defined in UEFI 2.0 spec.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_WIN_CERTIFICATE_H__
|
|
|
|
#define __EFI_WIN_CERTIFICATE_H__
|
|
|
|
|
|
|
|
//
|
|
|
|
// _WIN_CERTIFICATE.wCertificateType
|
2014-10-22 05:03:18 +02:00
|
|
|
//
|
2009-09-02 11:23:28 +02:00
|
|
|
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
|
|
|
|
#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
|
|
|
|
#define WIN_CERT_TYPE_EFI_GUID 0x0EF1
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The length of the entire certificate,
|
|
|
|
/// including the length of the header, in bytes.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
UINT32 dwLength;
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The revision level of the WIN_CERTIFICATE
|
|
|
|
/// structure. The current revision level is 0x0200.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
UINT16 wRevision;
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
|
|
|
|
/// certificate types. The UEFI specification reserves the range of
|
|
|
|
/// certificate type values from 0x0EF0 to 0x0EFF.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
UINT16 wCertificateType;
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The following is the actual certificate. The format of
|
2009-09-02 11:23:28 +02:00
|
|
|
/// the certificate depends on wCertificateType.
|
|
|
|
///
|
|
|
|
/// UINT8 bCertificate[ANYSIZE_ARRAY];
|
|
|
|
///
|
|
|
|
} WIN_CERTIFICATE;
|
|
|
|
|
|
|
|
///
|
|
|
|
/// WIN_CERTIFICATE_UEFI_GUID.CertType
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
|
|
|
|
{0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
|
|
|
|
|
|
|
|
///
|
|
|
|
/// WIN_CERTIFICATE_UEFI_GUID.CertData
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
typedef struct {
|
2009-12-07 04:04:34 +01:00
|
|
|
EFI_GUID HashType;
|
|
|
|
UINT8 PublicKey[256];
|
|
|
|
UINT8 Signature[256];
|
2009-09-02 11:23:28 +02:00
|
|
|
} EFI_CERT_BLOCK_RSA_2048_SHA256;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Certificate which encapsulates a GUID-specific digital signature
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
|
|
|
/// This is the standard WIN_CERTIFICATE header, where
|
2014-10-22 05:03:18 +02:00
|
|
|
/// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
|
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
WIN_CERTIFICATE Hdr;
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// This is the unique id which determines the
|
2009-09-02 11:23:28 +02:00
|
|
|
/// format of the CertData. .
|
|
|
|
///
|
|
|
|
EFI_GUID CertType;
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
/// The following is the certificate data. The format of
|
2014-10-22 05:03:18 +02:00
|
|
|
/// the data is determined by the CertType.
|
2009-09-02 11:23:28 +02:00
|
|
|
/// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
|
|
|
|
/// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
|
|
|
|
///
|
|
|
|
UINT8 CertData[1];
|
|
|
|
} WIN_CERTIFICATE_UEFI_GUID;
|
|
|
|
|
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-09-02 11:23:28 +02:00
|
|
|
/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
|
2014-10-22 05:03:18 +02:00
|
|
|
/// WIN_CERTIFICATE and encapsulate the information needed to
|
|
|
|
/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
|
|
|
|
/// specified in RFC2437.
|
|
|
|
///
|
|
|
|
typedef struct {
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// This is the standard WIN_CERTIFICATE header, where
|
|
|
|
/// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
WIN_CERTIFICATE Hdr;
|
|
|
|
///
|
|
|
|
/// This is the hashing algorithm which was performed on the
|
2014-10-22 05:03:18 +02:00
|
|
|
/// UEFI executable when creating the digital signature.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
EFI_GUID HashAlgorithm;
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The following is the actual digital signature. The
|
|
|
|
/// size of the signature is the same size as the key
|
|
|
|
/// (1024-bit key is 128 bytes) and can be determined by
|
2009-09-02 11:23:28 +02:00
|
|
|
/// subtracting the length of the other parts of this header
|
2014-10-22 05:03:18 +02:00
|
|
|
/// from the total length of the certificate as found in
|
|
|
|
/// Hdr.dwLength.
|
2009-09-02 11:23:28 +02:00
|
|
|
///
|
|
|
|
/// UINT8 Signature[];
|
|
|
|
///
|
|
|
|
} WIN_CERTIFICATE_EFI_PKCS1_15;
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid;
|
|
|
|
|
|
|
|
#endif
|