AptioV Cryptographic Library and EFI Protocols: Data Structures

AptioV Cryptographic Library and EFI Protocols 26.1
  • Main Page
  • Data Structures
  • Files
  • Data Structures
  • Data Structure Index
Data Structures
Here are the data structures with brief descriptions:
C _AMI_CRYPT_DIGITAL_SIGNATURE_PPI
C _AMI_DIGITAL_SIGNATURE_PROTOCOL
C _EFI_CERT_X509_SHA256
C _EFI_CERT_X509_SHA384
C _EFI_CERT_X509_SHA512
C AMI_CERTIFICATE_RSA2048_SHA256
C APTIO_FW_CAPSULE_HEADER
C asn1_hdr
C asn1_oid
C CR_MEM_DESC
C CRYPT_HANDLE
C crypto_rsa_key
C FW_CERTIFICATE
C FW_KEY_HOB
C hash_state
C MD5Context
C mp_int
C os_time
C os_tm
C PEI_CRYPT_HANDLE
C pkcs7_cert_revoke_info
C pkcs7_signed_data_st
C pkcs7_signer_info_authAttr_st
C pkcs7_signer_info_st
C SHA1Context
C sha256_state
C sha512_state
C WIN_CERTIFICATE_UEFI_GUID_1
C x509_algorithm_identifier
C x509_certificate
C x509_name
Generated on Thu May 26 2016 15:56:58 for AptioV Cryptographic Library and EFI Protocols by doxygen 1.8.7


AptioV Cryptographic Library and EFI Protocols: _AMI_CRYPT_DIGITAL_SIGNATURE_PPI Struct Reference

  • Files
  • Data Structures
  • Data Structure Index
Data Fields
_AMI_CRYPT_DIGITAL_SIGNATURE_PPI Struct Reference

Data Fields

PEI_CRYPT_DS_HASH | Hash
PEI_CRYPT_DS_VERIFY_KEY | VerifyKey
PEI_CRYPT_DS_VERIFY_SIG | VerifySig
PEI_CRYPT_DS_GET_KEY | GetKey
PEI_CRYPT_DS_VERIFY_PKCS7SIG | VerifyPkcs7Sig
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/PPI/CryptoPPI.h


AptioV Cryptographic Library and EFI Protocols: _AMI_DIGITAL_SIGNATURE_PROTOCOL Struct Reference

Data Fields
_AMI_DIGITAL_SIGNATURE_PROTOCOL Struct Reference

Data Fields

AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY | Pkcs1Verify
AMI_DIGITAL_SIGNATURE_PKCS7_VERIFY | Pkcs7Verify
AMI_DIGITAL_SIGNATURE_HASH | Hash
AMI_DIGITAL_SIGNATURE_GET_KEY | GetKey
AMI_DIGITAL_SIGNATURE_VERIFY_KEY | VerifyKey
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: _EFI_CERT_X509_SHA256 Struct Reference

Data Fields
_EFI_CERT_X509_SHA256 Struct Reference

Data Fields

EFI_SHA256_HASH | ToBeSignedHash
EFI_TIME | TimeOfRevocation
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: _EFI_CERT_X509_SHA384 Struct Reference

Data Fields
_EFI_CERT_X509_SHA384 Struct Reference

Data Fields

EFI_SHA384_HASH | ToBeSignedHash
EFI_TIME | TimeOfRevocation
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: _EFI_CERT_X509_SHA512 Struct Reference

Data Fields
_EFI_CERT_X509_SHA512 Struct Reference

Data Fields

EFI_SHA512_HASH | ToBeSignedHash
EFI_TIME | TimeOfRevocation
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: AMI_CERTIFICATE_RSA2048_SHA256 Struct Reference

Data Fields
AMI_CERTIFICATE_RSA2048_SHA256 Struct Reference

#include <AmiCertificate.h>

Data Fields

WIN_CERTIFICATE_UEFI_GUID_1 | Hdr
EFI_CERT_BLOCK_RSA_2048_SHA256 | CertData

Detailed Description

Certificate which encapsulates the UEFI RSA2048_SHA256 digital signature.

The WIN_CERTIFICATE_UEFI_GUID structure is derived from WIN_CERTIFICATE and encapsulate the information needed to implement the digital signature algorithm Hdr.Hdr.wRevision = 0x0200 Hdr.Hdr.wCertificateType = 0x0EF1; WIN_CERT_TYPE_EFI_GUID Hdr.CertType = EFI_CERT_TYPE_RSA2048_SHA256_GUID;

Fields: Name Type Description

Hdr WIN_CERTIFICATE_UEFI_GUID encapsulate the information needed to implement the digital signature algorithm

CertData EFI_CERT_BLOCK_RSA_2048_SHA256 Signature and Public key

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: APTIO_FW_CAPSULE_HEADER Struct Reference

Data Fields
APTIO_FW_CAPSULE_HEADER Struct Reference

Data Fields

EFI_CAPSULE_HEADER | CapHdr
UINT16 | RomImageOffset
UINT16 | RomLayoutOffset
FW_CERTIFICATE | FWCert
ROM_AREA | RomAreaMap [1]
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: asn1_hdr Struct Reference

Data Fields
asn1_hdr Struct Reference

Data Fields

const u8 * | payload
u8 | identifier
u8 | class
u8 | constructed
unsigned int | tag
unsigned int | length
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/asn1.h


AptioV Cryptographic Library and EFI Protocols: asn1_oid Struct Reference

Data Fields
asn1_oid Struct Reference

Data Fields

unsigned long | oid [ASN1_MAX_OID_LEN]
size_t | len
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/asn1.h


AptioV Cryptographic Library and EFI Protocols: CR_MEM_DESC Struct Reference

Data Fields
CR_MEM_DESC Struct Reference

Data Fields

UINT8 * | Addr
UINT8 | Pages
UINT8 | Attrib
UINT16 | Reserved
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Memalloc.c


AptioV Cryptographic Library and EFI Protocols: CRYPT_HANDLE Struct Reference

Data Fields
CRYPT_HANDLE Struct Reference

#include <AmiDigitalSignature.h>

Data Fields

EFI_GUID | AlgGuid
UINT32 | BlobSize
UINT8 * | Blob

Detailed Description

Common Crypt construction type: ASN1 PubKey, Hash sha256, etc.

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: crypto_rsa_key Struct Reference

Data Fields
crypto_rsa_key Struct Reference

Data Fields

int | private_key
struct bignum * | n
struct bignum * | e
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/rsa.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/RSAKeyImport.c


AptioV Cryptographic Library and EFI Protocols: FW_CERTIFICATE Struct Reference

Data Fields
FW_CERTIFICATE Struct Reference

Data Fields

AMI_CERTIFICATE_RSA2048_SHA256 | SignCert
EFI_CERT_BLOCK_RSA_2048_SHA256 | RootCert
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: FW_KEY_HOB Struct Reference

Data Fields
FW_KEY_HOB Struct Reference

#include <AmiCertificate.h>

Data Fields

EFI_HOB_GUID_TYPE | Header
EFI_GUID | KeyGuid
EFI_PHYSICAL_ADDRESS | KeyAddress
UINT32 | KeySize

Detailed Description

Platform FwKey GUIDed HOB Header HobGUID = PR_KEY_GUID

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: hash_state Struct Reference

Data Fields
hash_state Struct Reference

Data Fields

u64 | length
u64 | state [8]
unsigned long | curlen
unsigned char | buf [128]
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/sha384.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/sha512.c


AptioV Cryptographic Library and EFI Protocols: MD5Context Struct Reference

Data Fields
MD5Context Struct Reference

Data Fields

UINT32 | buf [4]
UINT32 | bits [2]
UINT8 | in [64]
u32 | buf [4]
u32 | bits [2]
u8 | in [64]
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/md5.c


AptioV Cryptographic Library and EFI Protocols: mp_int Struct Reference

Data Fields
mp_int Struct Reference

Data Fields

int | used
int | alloc
int | sign
mp_digit * | dp
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/libtommath.h


AptioV Cryptographic Library and EFI Protocols: os_time Struct Reference

Data Fields
os_time Struct Reference

Data Fields

os_time_t | sec
os_time_t | usec
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/os.h


AptioV Cryptographic Library and EFI Protocols: os_tm Struct Reference

Data Fields
os_tm Struct Reference

Data Fields

int | sec
int | min
int | hour
int | day
int | month
int | year
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/os.h


AptioV Cryptographic Library and EFI Protocols: PEI_CRYPT_HANDLE Struct Reference

Data Fields
PEI_CRYPT_HANDLE Struct Reference

Data Fields

EFI_GUID | AlgGuid
UINT32 | BlobSize
UINT8 * | Blob
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/PPI/CryptoPPI.h


AptioV Cryptographic Library and EFI Protocols: pkcs7_cert_revoke_info Struct Reference

Data Fields
pkcs7_cert_revoke_info Struct Reference

#include <CryptLib.h>

Data Fields

u8 * | ToBeSignedHash
size_t | ToBeSignedHashLen
UINT8 * | ToBeSignedHash

Detailed Description

Common routine to validate Pkcs7 certificate chain and revoked time stamped certs Supported RFC6131 TimeStampToken format

Parameters
[in] | SignedData | Pre-parsed Pkcs7 Certificate with a cert chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on)
[in] | bTimeStampCert | Type of certificate to test
[in] | trusted | List of trusted x509 certificates
[in] | revokeInfo | Hash certificate
[in] | action | Buffer for returning either result of operation or intermediate data, e.g TimeOfSigning
Return values
cert if chain is valid, -1 if not found
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Pkcs7.h
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Library/CryptLib.h


AptioV Cryptographic Library and EFI Protocols: pkcs7_signed_data_st Struct Reference

Data Fields
pkcs7_signed_data_st Struct Reference

#include <Pkcs7.h>

Data Fields

const u8 * | Content_start
size_t | Content_len
struct x509_algorithm_identifier | Digest_alg
const u8 * | Digest
size_t | Digest_len
struct pkcs7_signer_info_st * | tstInfo
struct x509_certificate * | CertStore
struct pkcs7_signer_info_st * | SignerInfo
struct pkcs7_signed_data_st * | tstSignedData
const u8 * | Pkcs7cert_start
size_t | Pkcs7cert_len
const u8 * | CAcert_start
size_t | CAcert_len
const u8 * | sign_cert_start
size_t | sign_cert_len

Detailed Description

TimeStampInfo = SignerInfo define pkcs7_signer_info_Timestamp_st pkcs7_signer_info_st Pkcs7 SignedData

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Pkcs7.h


AptioV Cryptographic Library and EFI Protocols: pkcs7_signer_info_authAttr_st Struct Reference

Data Fields
pkcs7_signer_info_authAttr_st Struct Reference

#include <Pkcs7.h>

Data Fields

const u8 * | auth_attrib_start
size_t | auth_attrib_len
const u8 * | messageDigest
size_t | messageDigest_len
os_time_t | signingTime
const u8 * | certHash
size_t | certHash_len
struct x509_name | issuer
unsigned long | serial_number

Detailed Description

SignerInfo.authAttributes

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Pkcs7.h


AptioV Cryptographic Library and EFI Protocols: pkcs7_signer_info_st Struct Reference

Data Fields
pkcs7_signer_info_st Struct Reference

#include <Pkcs7.h>

Data Fields

unsigned long | version
struct x509_name | issuer
unsigned long | serial_number
struct x509_algorithm_identifier | digest_alg
struct
pkcs7_signer_info_authAttr_st 		authAttr
struct x509_algorithm_identifier | digest_enc_alg
const u8 * | enc_digest
size_t | enc_digest_len

Detailed Description

SignerInfo

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Pkcs7.h


AptioV Cryptographic Library and EFI Protocols: SHA1Context Struct Reference

Data Fields
SHA1Context Struct Reference

Data Fields

UINT32 | state [5]
UINT32 | count [2]
UINT8 | buffer [64]
u32 | state [5]
u32 | count [2]
unsigned char | buffer [64]
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/sha1.c


AptioV Cryptographic Library and EFI Protocols: sha256_state Struct Reference

Data Fields
sha256_state Struct Reference

Data Fields

UINT64 | length
UINT32 | state [8]
UINT32 | curlen
UINT8 | buf [64]
u64 | length
u32 | state [8]
u32 | curlen
u8 | buf [64]
The documentation for this struct was generated from the following files:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/sha256.c


AptioV Cryptographic Library and EFI Protocols: sha512_state Struct Reference

Data Fields
sha512_state Struct Reference

Data Fields

UINT64 | length
UINT32 | state [8]
UINT32 | curlen
UINT8 | buf [128]
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c


AptioV Cryptographic Library and EFI Protocols: WIN_CERTIFICATE_UEFI_GUID_1 Struct Reference

Data Fields
WIN_CERTIFICATE_UEFI_GUID_1 Struct Reference

#include <AmiCertificate.h>

Data Fields

WIN_CERTIFICATE | Hdr
EFI_GUID | CertType

Detailed Description

Modified version of Win Uefi Cert. CertData is not defined in here

The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: x509_algorithm_identifier Struct Reference

Data Fields
x509_algorithm_identifier Struct Reference

Data Fields

struct asn1_oid oid
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/x509v3.h


AptioV Cryptographic Library and EFI Protocols: x509_certificate Struct Reference

Public Types | Data Fields
x509_certificate Struct Reference

Public Types

enum { X509_CERT_V1 = 0, X509_CERT_V2 = 1, X509_CERT_V3 = 2 }

Data Fields

struct x509_certificate * | next
struct x509_certificate * | chain
enum x509_certificate:: { ... } | version
unsigned long | serial_number
struct x509_algorithm_identifier | signature
struct x509_name | issuer
struct x509_name | subject
os_time_t | not_before
os_time_t | not_after
struct x509_algorithm_identifier | public_key_alg
u8 * | public_key
size_t | public_key_len
struct x509_algorithm_identifier | signature_alg
u8 * | sign_value
size_t | sign_value_len
unsigned int | extensions_present
int | ca
unsigned long | path_len_constraint
unsigned long | key_usage
const u8 * | cert_start
size_t | cert_len
const u8 * | tbs_cert_start
size_t | tbs_cert_len
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/x509v3.h


AptioV Cryptographic Library and EFI Protocols: x509_name Struct Reference

Data Fields
x509_name Struct Reference

Data Fields

char * | cn
char * | c
char * | l
char * | st
char * | o
char * | ou
char * | email
The documentation for this struct was generated from the following file:
  • E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/x509v3.h


AptioV Cryptographic Library and EFI Protocols: Data Structure Index

Data Structure Index
A | C | F | H | M | O | P | S | W | X | _
A
AMI_CERTIFICATE_RSA2048_SHA256
APTIO_FW_CAPSULE_HEADER
C
CR_MEM_DESC
CRYPT_HANDLE
F
FW_CERTIFICATE
FW_KEY_HOB
M
MD5Context
P
PEI_CRYPT_HANDLE
S
SHA1Context
W
WIN_CERTIFICATE_UEFI_GUID_1
_
_AMI_CRYPT_DIGITAL_SIGNATURE_PPI
_AMI_DIGITAL_SIGNATURE_PROTOCOL
_EFI_CERT_X509_SHA256
_EFI_CERT_X509_SHA384
_EFI_CERT_X509_SHA512
a
asn1_hdr
asn1_oid
c
crypto_rsa_key
h
hash_state
m
mp_int
o
os_time
os_tm
p
pkcs7_cert_revoke_info
pkcs7_signed_data_st
pkcs7_signer_info_authAttr_st
A | C | F | H | M | O | P | S | W | X | _


AptioV Cryptographic Library and EFI Protocols: File List

  • File List
  • Globals
File List
Here is a list of all documented files with brief descriptions:
[detail level 123]
▼ CryptoLib
BaseCryptLib.c
CopyMem.c
MemoryIntrinsics.c
Pkcs7.h
▼ CryptoProtocols
CryptoDxe.c
CryptoPei.c
▼ Include
▼ Library
BaseCryptLib.h
CryptLib.h
▼ PPI
CryptoPPI.h
▼ Protocol
AmiDigitalSignature.h
AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib Directory Reference

  • CryptoLib
CryptoLib Directory Reference

Files

file | asn1.c
file | asn1.h
file | BaseCryptLib.c
file | bignum.c
file | bignum.h
file | build_config.h
file | common.h
file | CopyMem.c
file | CryptLibInit.c
file | crypto.h
file | IA32math.c
file | includes.h
file | libtommath.h
file | md5.c
file | md5.h
file | Memalloc.c
file | MemoryIntrinsics.c
file | os.h
file | Pkcs1_sigDecode.c
file | Pkcs7.c
file | Pkcs7.h
file | rsa.c
file | rsa.h
file | RSAKeyImport.c
file | Scrtlib.c
file | sha1.c
file | sha1.h
file | sha256.c
file | sha256.h
file | sha384.c
file | sha512.c
file | TimeWrapper.c
file | wpa_debug.c
file | wpa_debug.h
file | x509v3.c
file | x509v3.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/BaseCryptLib.c File Reference

  • File List
  • Globals
  • CryptoLib
Data Structures | Functions
BaseCryptLib.c File Reference
#include "includes.h"
#include <BaseCryptLib.h>
#include <CryptLib.h>
#include "common.h"
#include "bignum.h"
#include "rsa.h"

Data Structures

struct | crypto_rsa_key
struct | MD5Context
struct | SHA1Context
struct | sha256_state
struct | sha512_state

Functions

UINTN | Md5GetContextSize (VOID)
void | MD5Init (struct MD5Context *context)
void | MD5Update (struct MD5Context *context, const void *data, UINT32 len)
void | MD5Final (unsigned char digest[16], struct MD5Context *context)
void | SHA1Init (struct SHA1Context *context)
void | SHA1Update (struct SHA1Context *context, const void *data, UINT32 len)
void | SHA1Final (unsigned char digest[20], struct SHA1Context *context)
void | sha256_init (struct sha256_state *md)
int | sha256_process (struct sha256_state *md, const unsigned char *in, unsigned long inlen)
int | sha256_done (struct sha256_state *md, unsigned char *out)
void | sha384_init (struct sha512_state *md)
int | sha384_done (struct sha512_state *md, unsigned char *out)
void | sha512_init (struct sha512_state *md)
int | sha512_process (struct sha512_state *md, const unsigned char *in, unsigned long inlen)
int | sha512_done (struct sha512_state *md, unsigned char *out)
BOOLEAN EFIAPI | Md5Init (OUT VOID *Md5Context)
BOOLEAN EFIAPI | Md5Duplicate (IN CONST VOID *Md5Context, OUT VOID *NewMd5Context)
BOOLEAN EFIAPI | Md5Update (IN OUT VOID *Md5Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Md5Final (IN OUT VOID *Md5Context, OUT UINT8 *HashValue)
UINTN | Sha1GetContextSize (VOID)
BOOLEAN | Sha1Init (IN OUT VOID *Sha1Context)
BOOLEAN EFIAPI | Sha1Duplicate (IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context)
BOOLEAN | Sha1Update (IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataLength)
BOOLEAN | Sha1Final (IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
UINTN | Sha256GetContextSize (VOID)
BOOLEAN | Sha256Init (IN OUT VOID *Sha256Context)
BOOLEAN EFIAPI | Sha256Duplicate (IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
BOOLEAN | Sha256Update (IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataLength)
BOOLEAN | Sha256Final (IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
UINTN | Sha384GetContextSize (VOID)
BOOLEAN | Sha384Init (IN OUT VOID *Sha384Context)
BOOLEAN EFIAPI | Sha384Duplicate (IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
BOOLEAN | Sha384Update (IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataLength)
BOOLEAN | Sha384Final (IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
UINTN | Sha512GetContextSize (VOID)
BOOLEAN | Sha512Init (IN OUT VOID *Sha512Context)
BOOLEAN EFIAPI | Sha512Duplicate (IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
BOOLEAN | Sha512Update (IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataLength)
BOOLEAN | Sha512Final (IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
VOID * | RsaNew (VOID)
VOID | RsaFree (IN VOID *RsaContext)
BOOLEAN | RsaSetKey (IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnLength)
BOOLEAN | RsaPkcs1Verify (IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashLength, IN CONST UINT8 *Signature, IN UINTN SigLength)
BOOLEAN EFIAPI | Pkcs7Verify (IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength)
BOOLEAN EFIAPI | AuthenticodeVerify (IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize)

Detailed Description

BaseCryptLib.h

Defines base cryptographic library APIs compatible with EDK2 BaseCryptLib. The Base Cryptographic Library provides implementations of basic cryptography primitives (SHA-1, SHA-256, RSA, etc) for UEFI security functionality enabling.

Function Documentation

BOOLEAN EFIAPI AuthenticodeVerify | ( | IN CONST UINT8 * | AuthData,
 |  | IN UINTN | DataSize,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertSize,
 |  | IN CONST UINT8 * | ImageHash,
 |  | IN UINTN | HashSize
 | ) |  |

Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows Authenticode Portable Executable Signature Format".

If AuthData is NULL, then return FALSE. If ImageHash is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | AuthData | Pointer to the Authenticode Signature retrieved from signed PE/COFF image to be verified.
[in] | DataSize | Size of the Authenticode Signature in bytes.
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification.
[in] | CertSize | Size of the trusted certificate in bytes.
[in] | ImageHash | Pointer to the original image file hash value. The produce for calculating the image hash value is described in Authenticode specification.
[in] | HashSize | Size of Image hash value in bytes.
Return values
TRUE | The specified Authenticode Signature is valid.
FALSE | Invalid Authenticode Signature.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Duplicate | ( | IN CONST VOID * | Md5Context,
 |  | OUT VOID * | NewMd5Context
 | ) |  |

Makes a copy of an existing MD5 context.

If Md5Context is NULL, then return FALSE. If NewMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Md5Context | Pointer to MD5 context being copied.
[out] | NewMd5Context | Pointer to new MD5 context.
Return values
TRUE | MD5 context copy succeeded.
FALSE | MD5 context copy failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Final | ( | IN OUT VOID * | Md5Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the MD5 digest value.

This function completes MD5 hash computation and retrieves the digest value into the specified memory. After this function has been called, the MD5 context cannot be used again. MD5 context should be already correctly initialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid MD5 context is undefined.

If Md5Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Md5Context | Pointer to the MD5 context.
[out] | HashValue | Pointer to a buffer that receives the MD5 digest value (16 bytes).
Return values
TRUE | MD5 digest computation succeeded.
FALSE | MD5 digest computation failed.
FALSE | This interface is not supported.
UINTN EFIAPI Md5GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.

If this interface is not supported, then return zero.

Returns
The size, in bytes, of the context buffer required for MD5 hash operations.
Return values
0 This interface is not supported.
BOOLEAN EFIAPI Md5Init ( OUT VOID * Md5Context )

Initializes user-supplied memory pointed by Md5Context as MD5 hash context for subsequent use.

If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[out] Md5Context Pointer to MD5 context being initialized.
Return values
TRUE | MD5 context initialization succeeded.
FALSE | MD5 context initialization failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Update | ( | IN OUT VOID * | Md5Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataSize
 | ) |  |

Digests the input data and updates MD5 context.

This function performs MD5 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. MD5 context should be already correctly initialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid context is undefined.

If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Md5Context | Pointer to the MD5 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | MD5 data digest succeeded.
FALSE | MD5 data digest failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Pkcs7Verify | ( | IN CONST UINT8 * | P7Data,
 |  | IN UINTN | P7Length,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertLength,
 |  | IN CONST UINT8 * | InData,
 |  | IN UINTN | DataLength
 | ) |  |

Verifies the validity of a PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". The input signed data could be wrapped in a ContentInfo structure.

If P7Data, TrustedCert or InData is NULL, then return FALSE. If P7Length, CertLength or DataLength overflow, then return FAlSE. If this interface is not supported, then return FALSE.

Parameters
[in] | P7Data | Pointer to the PKCS#7 message to verify.
[in] | P7Length | Length of the PKCS#7 message in bytes.
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification.
[in] | CertLength | Length of the trusted certificate in bytes.
[in] InData 1. Pointer to the content to be verified.
  1. A pointer to a hash value (SHA1 or SHA256 supported) of the content to be verified.
[in] | DataLength | Length of InData in bytes.
Return values
TRUE | The specified PKCS#7 signed data is valid.
FALSE | Invalid PKCS#7 signed data.
FALSE | This interface is not supported.
VOID RsaFree ( IN VOID * RsaContext )

Release the specified RSA Context.

Parameters
[in] RsaContext Pointer to the RSA context to be released.
VOID* RsaNew ( VOID )

Allocates and Initializes one RSA Context for subsequent use.

Returns
Pointer to the RSA Context that has been initialized. If the allocations fails, RsaNew() returns NULL.
BOOLEAN RsaPkcs1Verify | ( | IN VOID * | RsaContext,
 |  | IN CONST UINT8 * | MessageHash,
 |  | IN UINTN | HashLength,
 |  | IN CONST UINT8 * | Signature,
 |  | IN UINTN | SigLength
 | ) |  |

Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1.

If RsaContext is NULL, then ASSERT(). If MessageHash is NULL, then ASSERT(). If Signature is NULL, then ASSERT(). If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then ASSERT().

Parameters
[in] | RsaContext | Pointer to RSA context for signature verification.
[in] | MessageHash | Pointer to octet message hash to be checked.
[in] | HashLength | Length of the message hash in bytes.
[in] | Signature | Pointer to RSA PKCS1-v1_5 signature to be verified.
[in] | SigLength | Length of signature in bytes.
Returns
TRUE Valid signature encoded in PKCS1-v1_5.
FALSE Invalid signature or invalid RSA context.
BOOLEAN RsaSetKey | ( | IN OUT VOID * | RsaContext,
 |  | IN RSA_KEY_TAG | KeyTag,
 |  | IN CONST UINT8 * | BigNumber,
 |  | IN UINTN | BnLength
 | ) |  |

Sets the tag-designated RSA key component into the established RSA context from the user-specified nonnegative integer (octet string format represented in RSA PKCS#1).

If RsaContext is NULL, then ASSERT().

Parameters
[in,out] | RsaContext | Pointer to RSA context being set.
[in] | KeyTag | Tag of RSA key component being set.
[in] | BigNumber | Pointer to octet integer buffer.
[in] | BnLength | Length of big number buffer in bytes.
Returns
TRUE RSA key component was set successfully.
FALSE Invalid RSA key component tag.
BOOLEAN EFIAPI Sha1Duplicate | ( | IN CONST VOID * | Sha1Context,
 |  | OUT VOID * | NewSha1Context
 | ) |  |

Makes a copy of an existing SHA-1 context.

If Sha1Context is NULL, then return FALSE. If NewSha1Context is NULL, then return FALSE.

Parameters
[in] | Sha1Context | Pointer to SHA-1 context being copied.
[out] | NewSha1Context | Pointer to new SHA-1 context.
Return values
TRUE | SHA-1 context copy succeeded.
FALSE | SHA-1 context copy failed.
BOOLEAN Sha1Final | ( | IN OUT VOID * | Sha1Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes SHA-1 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-1 context cannot be used again.

If Sha1Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context
[out] | HashValue | Pointer to a buffer that receives the SHA-1 digest value (20 bytes).
Return values
TRUE SHA-1 digest computation succeeded.
UINTN Sha1GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.

Returns
The size, in bytes, of the context buffer required for SHA-1 hash operations.
BOOLEAN Sha1Init ( IN OUT VOID * Sha1Context )

Initializes user-supplied memory pointed by Sha1Context as the SHA-1 hash context for subsequent use.

If Sha1Context is NULL, then ASSERT().

Parameters
[in,out] Sha1Context Pointer to the SHA-1 Context being initialized.
Return values
TRUE SHA-1 initialization succeeded.
BOOLEAN Sha1Update | ( | IN OUT VOID * | Sha1Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Performs SHA-1 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha1Context is NULL, then ASSERT().

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-1 data digest succeeded.
FALSE | Invalid SHA-1 context. After Sha1Final function has been called, the SHA-1 context cannot be reused.
int sha256_done | ( | struct sha256_state * | md,
 |  | unsigned char * | out
 | ) |  |

Terminate the hash to get the digest

Parameters
md | The hash state
out | [out] The destination of the hash (32 bytes)
Returns
CRYPT_OK if successful
int sha256_process | ( | struct sha256_state * | md,
 |  | const unsigned char * | in,
 |  | unsigned long | inlen
 | ) |  |

Process a block of memory though the hash

Parameters
md | The hash state
in | The data to hash
inlen | The length of the data (octets)
Returns
CRYPT_OK if successful
BOOLEAN EFIAPI Sha256Duplicate | ( | IN CONST VOID * | Sha256Context,
 |  | OUT VOID * | NewSha256Context
 | ) |  |

Makes a copy of an existing SHA-256 context.

If Sha256Context is NULL, then return FALSE. If NewSha256Context is NULL, then return FALSE.

Parameters
[in] | Sha256Context | Pointer to SHA-256 context being copied.
[out] | NewSha256Context | Pointer to new SHA-256 context.
Return values
TRUE | SHA-256 context copy succeeded.
FALSE | SHA-256 context copy failed.
BOOLEAN Sha256Final | ( | IN OUT VOID * | Sha256Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes SHA-256 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-256 context cannot be used again.

If Sha256Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha256Context | Pointer to SHA-256 context
[out] | HashValue | Pointer to a buffer that receives the SHA-256 digest value (32 bytes).
Return values
TRUE SHA-256 digest computation succeeded.
UINTN Sha256GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-256 operations.

Returns
The size, in bytes, of the context buffer required for SHA-256 operations.
BOOLEAN Sha256Init ( IN OUT VOID * Sha256Context )

Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for subsequent use.

If Sha256Context is NULL, then ASSERT().

Parameters
[in,out] Sha256Context Pointer to SHA-256 Context being initialized.
Return values
TRUE SHA-256 context initialization succeeded.
BOOLEAN Sha256Update | ( | IN OUT VOID * | Sha256Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Performs SHA-256 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha256Context is NULL, then ASSERT().

Parameters
[in,out] | Sha256Context | Pointer to the SHA-256 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-256 data digest succeeded.
FALSE | Invalid SHA-256 context. After Sha256Final function has been called, the SHA-256 context cannot be reused.
BOOLEAN EFIAPI Sha384Duplicate | ( | IN CONST VOID * | Sha384Context,
 |  | OUT VOID * | NewSha384Context
 | ) |  |

Makes a copy of an existing SHA-384 context.

If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE.

Parameters
[in] | Sha384Context | Pointer to SHA-384 context being copied.
[out] | NewSha384Context | Pointer to new SHA-384 context.
Return values
TRUE | SHA-384 context copy succeeded.
FALSE | SHA-384 context copy failed.
BOOLEAN Sha384Final | ( | IN OUT VOID * | Sha384Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes SHA-384 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-384 context cannot be used again.

If Sha384Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha384Context | Pointer to SHA-384 context
[out] | HashValue | Pointer to a buffer that receives the SHA-384 digest value (32 bytes).
Return values
TRUE SHA-384 digest computation succeeded.
UINTN Sha384GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-384 operations.

Returns
The size, in bytes, of the context buffer required for SHA-384 operations.
BOOLEAN Sha384Init ( IN OUT VOID * Sha384Context )

Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for subsequent use.

If Sha384Context is NULL, then ASSERT().

Parameters
[in,out] Sha384Context Pointer to SHA-384 Context being initialized.
Return values
TRUE SHA-384 context initialization succeeded.
BOOLEAN Sha384Update | ( | IN OUT VOID * | Sha384Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Performs SHA-384 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha384Context is NULL, then ASSERT().

Parameters
[in,out] | Sha384Context | Pointer to the SHA-384 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-384 data digest succeeded.
FALSE | Invalid SHA-384 context. After Sha384Final function has been called, the SHA-384 context cannot be reused.
BOOLEAN EFIAPI Sha512Duplicate | ( | IN CONST VOID * | Sha512Context,
 |  | OUT VOID * | NewSha512Context
 | ) |  |

Makes a copy of an existing SHA-512 context.

If Sha512Context is NULL, then return FALSE. If NewSha512Context is NULL, then return FALSE.

Parameters
[in] | Sha512Context | Pointer to SHA-512 context being copied.
[out] | NewSha512Context | Pointer to new SHA-512 context.
Return values
TRUE | SHA-512 context copy succeeded.
FALSE | SHA-512 context copy failed.
BOOLEAN Sha512Final | ( | IN OUT VOID * | Sha512Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes SHA-512 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-512 context cannot be used again.

If Sha512Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha512Context | Pointer to SHA-512 context
[out] | HashValue | Pointer to a buffer that receives the SHA-512 digest value (32 bytes).
Return values
TRUE SHA-512 digest computation succeeded.
UINTN Sha512GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-512 operations.

Returns
The size, in bytes, of the context buffer required for SHA-512 operations.
BOOLEAN Sha512Init ( IN OUT VOID * Sha512Context )

Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for subsequent use.

If Sha512Context is NULL, then ASSERT().

Parameters
[in,out] Sha512Context Pointer to SHA-512 Context being initialized.
Return values
TRUE SHA-512 context initialization succeeded.
BOOLEAN Sha512Update | ( | IN OUT VOID * | Sha512Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Performs SHA-512 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha512Context is NULL, then ASSERT().

Parameters
[in,out] | Sha512Context | Pointer to the SHA-512 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-512 data digest succeeded.
FALSE | Invalid SHA-512 context. After Sha512Final function has been called, the SHA-512 context cannot be reused.


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/CopyMem.c File Reference

  • File List
  • Globals
  • CryptoLib
Functions
CopyMem.c File Reference
#include <Base.h>
#include <Library/BaseMemoryLib.h>

Functions

void * memcpy (void *dest, const void *src, unsigned int count)

Detailed Description

Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based Cryptographic Library.

Copyright (c) 2010, Intel Corporation. All rights reserved.
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

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/MemoryIntrinsics.c File Reference

  • File List
  • Globals
  • CryptoLib
Functions | Variables
MemoryIntrinsics.c File Reference
#include <Base.h>
#include <Library/BaseMemoryLib.h>

Functions

void * memset (void *dest, char ch, unsigned int count)

Variables

int _fltused = 1

Detailed Description

Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based Cryptographic Library.

Copyright (c) 2010, Intel Corporation. All rights reserved.
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

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoLib/Pkcs7.h File Reference

  • File List
  • Globals
  • CryptoLib
Data Structures | Enumerations
Pkcs7.h File Reference
#include "asn1.h"

Data Structures

struct | pkcs7_signer_info_authAttr_st
struct | pkcs7_signer_info_st
struct | pkcs7_signed_data_st
struct | pkcs7_cert_revoke_info

Enumerations

enum HASH_ALG {
SHA1, SHA256, SHA384, SHA512,
SHA1, SHA256, SHA384, SHA512
}

Detailed Description

PKCS#7 Authenticode SignedData parsing and processing


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Library/CryptLib.h File Reference

  • File List
  • Globals
  • Include
  • Library
Data Structures | Macros | Typedefs | Enumerations | Functions
CryptLib.h File Reference

Data Structures

struct pkcs7_cert_revoke_info

Macros

#define | __size_t__
#define | MD5_DIGEST_SIZE 16
#define | SHA1_DIGEST_SIZE 20
#define | SHA256_DIGEST_SIZE 32
#define | SHA384_DIGEST_SIZE 48
#define | SHA512_DIGEST_SIZE 64
#define | DEFAULT_RSA_KEY_MODULUS_LEN 256
#define | DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN
#define | EFI_CRYPT_RSASSA_PKCS1V15 1
#define | EFI_CRYPT_RSASSA_PSS 2
#define | __os_time_t__

Typedefs

typedef UINTN | size_t
typedef long | os_time_t

Enumerations

enum HASH_ALG {
SHA1, SHA256, SHA384, SHA512,
SHA1, SHA256, SHA384, SHA512
}

Functions

EFI_STATUS | RuntimeCryptLibConstructor (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS | RuntimeCryptLibDestructor (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
VOID | wpa_set_trace_level (int level)
VOID | set_crypt_efitime (EFI_TIME *EfiTime)
void | InitCRmm (void *pHeap, UINTN HeapSize)
void | ResetCRmm ()
struct crypto_rsa_key * | crypto_import_rsa2048_public_key (const UINT8 *KeyN, size_t lenN, const UINT8 *KeyE, size_t lenE)
struct crypto_rsa_key * | crypto_import_asn1_public_key (const UINT8 *key, size_t len)
size_t | base64_decode (char *buffer, size_t length)
int | crypto_rsa_exptmod (const UINT8 *in, size_t inlen, UINT8 *out, size_t *outlen, struct crypto_rsa_key *key, int use_private)
int | pkcs_1_pss_decode (const unsigned char *msghash, unsigned long msghashlen, const unsigned char *sig, unsigned long siglen, unsigned long saltlen, unsigned long modulus_bitlen)
int | pkcs_1_v1_5_decode (const UINT8 *hash, size_t hashlen, const UINT8 *sig, unsigned long siglen)
void | md5_vector (size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac)
void | sha1_vector (size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac)
void | sha256_vector (size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac)
void | sha384_vector (size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac)
void | sha512_vector (size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac)
struct x509_certificate * | x509_certificate_parse (const UINT8 *buf, size_t len)
int | x509_certificate_chain_validate (struct x509_certificate *trusted, struct x509_certificate *chain, int *reason)
struct pkcs7_signed_data_st * | Pkcs7_parse_Authenticode_certificate (const UINT8 *buf, size_t len)
int | Pkcs7_certificate_validate_digest (struct pkcs7_signed_data_st *SignedData, struct x509_certificate *SignCert, UINT8 *fileHash, size_t hashLen)
struct x509_certificate * | Pkcs7_return_signing_cerificate (struct pkcs7_signed_data_st *SignedData)
struct x509_certificate * | Pkcs7_return_timestamp_signing_cerificate (struct pkcs7_signed_data_st *SignedData)
int | Pkcs7_x509_certificate_chain_validate (struct pkcs7_signed_data_st *SignedData, struct x509_certificate *trusted, int *reason)
int | Pkcs7_return_cerificate_ptr (struct pkcs7_signed_data_st *SignedData, UINT8 **CAcert, size_t *CAcert_len, UINT8 **SignCert, size_t *SignCert_len)
int | Pkcs7_x509_return_signing_Key (struct pkcs7_signed_data_st *SignedData, UINT8 **public_key, size_t *public_key_len)
int | Pkcs7_x509_return_Cert_pubKey (UINT8 *pCert, size_t cert_len, UINT8 **public_key, size_t *public_key_len)
int | Pkcs7_return_digestAlgorithm (struct pkcs7_signed_data_st *PKCS7cert, UINT8 *HashType)
int | Pkcs7_x509_certificate_chain_validate_with_timestamp (struct pkcs7_signed_data_st *SignedData, BOOLEAN bTimeStampCert, struct x509_certificate *trusted, struct pkcs7_cert_revoke_info *revokeInfo, int *action)
int | os_mktime (int year, int month, int day, int hour, int min, int sec, os_time_t *t)
int | Pkcs7_certificate_validate_timestamp_digest (struct pkcs7_signed_data_st *SignedData, os_time_t *TimeOfSigning)
int | Pkcs7_x509_return_SubjectNameStr (UINT8 *pCert, size_t cert_len, UINT8 *buf, size_t len)
int | Pkcs7_x509_get_certificates_List (struct pkcs7_signed_data_st *SignedData, BOOLEAN bChained, UINT8 **CertList, size_t *ListLength)

Detailed Description

CryptLib.h Defines Aptio cryptographic library APIs. This Cryptographic Library provides implementations of basic and extended cryptography primitives (SHA-1, SHA-256, SHA-512, SHA-512, RSA, x509, PKCS1, PKCS7, ASN1.1) for UEFI security functionality enabling.

Macro Definition Documentation

#define __os_time_t__

Convert broken-down time into seconds since 1970-01-01 Note: The result is in seconds from Epoch, i.e., in UTC, not in local time which is used by POSIX mktime().

Parameters
[in] | year | Four digit year
[in] | month | Month (1 .. 12)
[in] | day | Day of month (1 .. 31)
[in] | hour | Hour (0 .. 23)
[in] | min | Minute (0 .. 59)
[in] | sec | Second (0 .. 60)
[out] | t | Buffer for returning calendar time representation (seconds since 1970-01-01 00:00:00)
Return values
0 on success, -1 on failure
#define DEFAULT_RSA_KEY_MODULUS_LEN 256

Default RSA2048 Modulus length

#define DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN

Default RSA2048 PKCSv1.5 Signature length

#define MD5_DIGEST_SIZE 16

MD5 digest size in bytes

#define SHA1_DIGEST_SIZE 20

SHA-1 digest size in bytes.

#define SHA256_DIGEST_SIZE 32

SHA-256 digest size in bytes

#define SHA384_DIGEST_SIZE 48

SHA-384 digest size in bytes

#define SHA512_DIGEST_SIZE 64

SHA-512 digest size in bytes

Enumeration Type Documentation

enum HASH_ALG

Hash Algorithm types

Function Documentation

size_t base64_decode | ( | char * | buffer,
 |  | size_t | length
 | ) |  |

Do in-place decoding of base-64 data of LENGTH in BUFFER.

Parameters
[in] | buffer | Data to be decoded
[in] | length | Length of the data to be decoded
Return values
size_t New length of the buffer bytes of decoded data, or -1 n failure
struct crypto_rsa_key* crypto_import_asn1_public_key | ( | const UINT8 * | key,
 |  | size_t | len
 | ) |  |

Imports RSA2048 public key from ASN.1 DER format into internal crypto_rsa_key data structure

Parameters
[in] | key | Pointer to public key buffer
[in] | len | Size of key buffer
Return values
crypto_rsa_key Pointer to Key data structure crypto_rsa_key NULL if failed to import Key
struct crypto_rsa_key* crypto_import_rsa2048_public_key | ( | const UINT8 * | KeyN,
 |  | size_t | lenN,
 |  | const UINT8 * | KeyE,
 |  | size_t | lenE
 | ) |  |

Imports RSA2048 public key binary from RAW format into internal crypto_rsa_key data structure

Parameters
[in] | KeyN | Pointer to N public modulus buffer
[in] | KeyE | Pointer to E public exponent buffer
[in] | LenN | Size of KeyN buffer (must be 256)
[in] | LenE | Size of KeyE buffer
Return values
crypto_rsa_key Pointer to Key data structure crypto_rsa_key NULL if failed to import Key
int crypto_rsa_exptmod | ( | const UINT8 * | in,
 |  | size_t | inlen,
 |  | UINT8 * | out,
 |  | size_t * | outlen,
 |  | struct crypto_rsa_key * | key,
 |  | int | use_private
 | ) |  |

RSA modular exponentiation

Parameters
[in] | in | Input data
[in] | inlen | Length of the data
[in] | use_private | 1 = Use RSA private key, 0 = Use RSA public key
Return values
out | Buffer for output data
outlen | Maximum size of the output buffer and used size on success
key | RSA key
0 | success -1 failed
void InitCRmm | ( | void * | pHeap,
 |  | UINTN | HeapSize
 | ) |  |

Initializes Crypo Memory Manager

Parameters
[in] | pHeap
[in] | HeapSize
Return values
none
void md5_vector | ( | size_t | num_elem,
 |  | const UINT8 * | addr[],
 |  | const size_t * | len,
 |  | UINT8 * | mac
 | ) |  |

MD5 hash for data vector

Parameters
[in] | num_elem | Number of elements in the data vecto
[in] | addr[] | Pointers to the data areas
[in] | len[] | Lengths of the data blocks
[out] | mac[] | Buffer for the hash
Return values
none
int os_mktime | ( | int | year,
 |  | int | month,
 |  | int | day,
 |  | int | hour,
 |  | int | min,
 |  | int | sec,
 |  | os_time_t * | t
 | ) |  |

os_mktime - Convert broken-down time into seconds since 1970-01-01 : Four digit year : Month (1 .. 12) : Day of month (1 .. 31) : Hour (0 .. 23) : Minute (0 .. 59) : Second (0 .. 60) : Buffer for returning calendar time representation (seconds since 1970-01-01 00:00:00) Returns: 0 on success, -1 on failure

Note: The result is in seconds from Epoch, i.e., in UTC, not in local time which is used by POSIX mktime().

int Pkcs7_certificate_validate_digest | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | struct x509_certificate * | SignCert,
 |  | UINT8 * | fileHash,
 |  | size_t | hashLen
 | ) |  |

Verify PKCS7 certificate signature.

Parameters
[in] | SignedData | Pointer to the Pkcs7 certificate structure
[in] | SignCert | Signing certificate containing the public key
Return values
0 if cert has a valid signature that was signed by the issuer, -1 if not
int Pkcs7_certificate_validate_timestamp_digest | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | os_time_t * | TimeOfSigning
 | ) |  |

Validate RFC6131 TimeStampToken digest

Parameters
[in] | pCert | PKCS7 Certificate
[out] | TimeOfSigning | os_time data structure with time of signing
Return values
0 if chain is valid, -1 if not

Pkcs7_certificate_validate_timestamp_digest - Verify TimeStamp signature of certificate encryptedDigest signature SignedData: Complete PKCS certificate SignCert: Signing certificate containing the public key Returns: 0 if cert has a valid signature that was signed by the issuer, -1 if not

struct pkcs7_signed_data_st* Pkcs7_parse_Authenticode_certificate | ( | const UINT8 * | buf,
 |  | size_t | len
 | ) |  |

Parse a Pkcs7 Authenticode certificate in DER format. Caller is responsible for freeing the returned certificate by calling Pkcs7_certificate_free().

Parameters
[in] | buf | Pointer to the Pkcs7 Authenticode SignedData in DER format
[in] | len | Buffer length
Return values
pkcs7_signed_data_st Pointer to the parsed certificate or NULL on failure
int Pkcs7_return_cerificate_ptr | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | UINT8 ** | CAcert,
 |  | size_t * | CAcert_len,
 |  | UINT8 ** | SignCert,
 |  | size_t * | SignCert_len
 | ) |  |

Returns a pointer within DER buffer to:

  1. Signing certificate
  2. Root CA certificate that is used to sign Signing certificate
Parameters
[in] | SignedData | List of trusted certificates
[out] | CAcert | Root CA certificate that is used to sign Signing certificate
[out] | CAcert_len | Certificate length
[out] | SignCert | Signing certificate
[out] | SignCert_len | Certificate length
Return values
0 if chain is valid, -1 if not
int Pkcs7_return_digestAlgorithm | ( | struct pkcs7_signed_data_st * | PKCS7cert,
 |  | UINT8 * | HashType
 | ) |  |

Return digestAlgorithm type. Enumerated type: 0-SHA1, 1-SHA256, 2-SHA384, 3-SHA512

Parameters
[in] | PKCS7cert | Pre-parsed Pkcs7 Certificate structure
[out] | HashType | Storage for Hash type value
Return values
cert if chain is valid, -1 if not found
struct x509_certificate* Pkcs7_return_signing_cerificate ( struct pkcs7_signed_data_st * SignedData )

Return certificate with signer's public key

Parameters
[in] SignedData Pointer to the Pkcs7 certificate structure
Return values
ptr to x509 certificate if chain is valid, NULL if not found

PKCS7_return_signing_cerificate_common - Return certificate with signing public key SignedData: List of trusted certificates SignerInfo: Lookup name and serial number. Maybe SignerInfo or a TimeStamp Returns: cert if chain is valid, NULL if not found

struct x509_certificate* Pkcs7_return_timestamp_signing_cerificate ( struct pkcs7_signed_data_st * SignedData )

Return Time stamping root signing certificate

Parameters
[in] SignedData Pointer to the Pkcs7 certificate structure
Return values
ptr to x509 certificate if chain is valid, NULL if not found
int Pkcs7_x509_certificate_chain_validate | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | struct x509_certificate * | trusted,
 |  | int * | reason
 | ) |  |

Validate Pkcs7 certificate chain

Parameters
[in] | trusted | List of trusted certificates
[in] | chain | Certificate chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on)
[in] | reason | Buffer for returning failure reason (X509_VALIDATE_*)
Return values
0 if chain is valid, -1 if not

Pkcs7_x509_certificate_chain_validate - Validate X.509 certificate chain : Certificate chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on) : List of trusted certificates if trust certificate not defined = NULL, just update Sign and CA certificate Ptrs : Buffer for returning failure reason (X509_VALIDATE_*) Returns: 0 if chain is valid, -1 if not

int Pkcs7_x509_certificate_chain_validate_with_timestamp | ( | struct pkcs7_signed_data_st * | Pkcs7SignedData,
 |  | BOOLEAN | bTimeStampToken,
 |  | struct x509_certificate * | trusted,
 |  | struct pkcs7_cert_revoke_info * | revokeInfo,
 |  | int * | reason
 | ) |  |

Pkcs7_x509_certificate_chain_validate_with_timestamp - Validate X.509 certificate chain Certificate chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on) bTimeStampToken: Control switch TRUE : Process Pkcs7->TimeStamp signing branch only FALSE: Process full Pkcs7 x509 Cert chain : List of trusted certificates if trust certificate not defined = NULL, just update Sign and CA certificate Ptrs : special TimeStamp revocation certificate including Cert Hash and TimeofRevocation : Buffer for returning failure reason (X509_VALIDATE_*) Returns: 0 if chain is valid, -1 if not

int Pkcs7_x509_get_certificates_List | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | BOOLEAN | bChained,
 |  | UINT8 ** | CertList,
 |  | size_t * | ListLength
 | ) |  |

Retrieves all embedded certificates from PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard", and outputs two certificate lists chained or unchained to the signer's certificates.

int Pkcs7_x509_return_Cert_pubKey | ( | UINT8 * | pCert,
 |  | size_t | cert_len,
 |  | UINT8 ** | public_key,
 |  | size_t * | public_key_len
 | ) |  |

Extract n-Modulus of a Public Key from x509 certificate

Parameters
[in] | pCert | x509 DER Certificate buffer
[out] | public_key | Pointer to a n-Modulus within certificate
[out] | public_key_len | Key length
Return values
0 key present, -1 if not found
int Pkcs7_x509_return_signing_Key | ( | struct pkcs7_signed_data_st * | SignedData,
 |  | UINT8 ** | public_key,
 |  | size_t * | public_key_len
 | ) |  |

Extract n-Modulus of a Public Key from a Signer x509 certificate within Pkcs7 certificate

Parameters
[in] | SignedData | Pre-parsed Pkcs7 Certificate structure
[out] | public_key | Pointer to a n-Modulus within certificate
[out] | public_key_len | Key length
Return values
0 key present, -1 if not found
int Pkcs7_x509_return_SubjectNameStr | ( | UINT8 * | pCert,
 |  | size_t | cert_len,
 |  | UINT8 * | buf,
 |  | size_t | len
 | ) |  |

Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated ASCII format string from a Subject name structure of a CommonName. Returns: 0 if operation is success, -1 if not

int pkcs_1_pss_decode | ( | const unsigned char * | msghash,
 |  | unsigned long | msghashlen,
 |  | const unsigned char * | sig,
 |  | unsigned long | siglen,
 |  | unsigned long | saltlen,
 |  | unsigned long | modulus_bitlen
 | ) |  |

PKCS #1 v2.00 PSS sig decode

Parameters
[in] | msghash | The hash to verify
[in] | msghashlen | The length of the hash (octets)
[in] | sig | The signature data (encoded data)
[in] | siglen | The length of the signature data (octets)
[in] | saltlen | The length of the salt used (octets)
[in] | modulus_bitlen | The bit length of the RSA modulus
Return values
CRYPT_OK if successful (even if the comparison failed)

PKCS #1 v2.00 PSS decode

Parameters
msghash | The hash to verify
msghashlen | The length of the hash (octets)
sig | The signature data (encoded data)
siglen | The length of the signature data (octets)
saltlen | The length of the salt used (octets)
modulus_bitlen | The bit length of the RSA modulus
Returns
CRYPT_OK if successful (even if the comparison failed)
int pkcs_1_v1_5_decode | ( | const UINT8 * | hash,
 |  | size_t | hashlen,
 |  | const UINT8 * | sig,
 |  | unsigned long | siglen
 | ) |  |

Strip PKCS #1 header

Parameters
[in] | sig | The signature data (encoded data)
[in] | siglen | The length of the signature data (octets)
Return values
CRYPT_OK if successful (even if the comparison failed)
void ResetCRmm ( )

Resets Crypto Memory Manager. Clears mem heap and descriptors

Parameters
[in] none
Return values
none
EFI_STATUS RuntimeCryptLibConstructor | ( | EFI_HANDLE | ImageHandle,
 |  | EFI_SYSTEM_TABLE * | SystemTable
 | ) |  |

Initialize Amy Crypto library internal state.

Parameters
[in] | ImageHandle
[in] | SystemTable
Return values
EFI_STATUS
VOID set_crypt_efitime ( EFI_TIME * EfiTime )

Updates the local value of crypto EfiTime

Parameters
[in] EfiTime
Return values
none set_crypt_efitime - updates the local value of crypto EfiTime *EFI_TIME
void sha1_vector | ( | size_t | num_elem,
 |  | const UINT8 * | addr[],
 |  | const size_t * | len,
 |  | UINT8 * | mac
 | ) |  |

SHA-1 hash for data vector

Parameters
[in] | num_elem | Number of elements in the data vector
[in] | addr[] | Pointers to the data areas
[in] | len[] | Lengths of the data blocks
[out] | mac[] | Buffer for the hash
Return values
none
void sha256_vector | ( | size_t | num_elem,
 |  | const UINT8 * | addr[],
 |  | const size_t * | len,
 |  | UINT8 * | mac
 | ) |  |

SHA-256 hash for data vector

Parameters
[in] | num_elem | Number of elements in the data vector
[in] | addr[] | Pointers to the data areas
[in] | len[] | Lengths of the data blocks
[out] | mac[] | Buffer for the hash
Return values
none
void sha384_vector | ( | size_t | num_elem,
 |  | const UINT8 * | addr[],
 |  | const size_t * | len,
 |  | UINT8 * | mac
 | ) |  |

SHA-384 hash for data vector

Parameters
[in] | num_elem | Number of elements in the data vector
[in] | addr[] | Pointers to the data areas
[in] | len[] | Lengths of the data blocks
[out] | mac[] | Buffer for the hash
Return values
none
void sha512_vector | ( | size_t | num_elem,
 |  | const UINT8 * | addr[],
 |  | const size_t * | len,
 |  | UINT8 * | mac
 | ) |  |

SHA-512 hash for data vector

Parameters
[in] | num_elem | Number of elements in the data vector
[in] | addr[] | Pointers to the data areas
[in] | len[] | Lengths of the data blocks
[out] | mac[] | Buffer for the hash
Return values
none
VOID wpa_set_trace_level ( int level )

sets the debug message print mode

Parameters
[in] level print level: 0 - no messages, 1 - minimal, 2 - full
Return values
none
int x509_certificate_chain_validate | ( | struct x509_certificate * | trusted,
 |  | struct x509_certificate * | chain,
 |  | int * | reason
 | ) |  |

Validate X.509 certificate chain.

Parameters
[in] | trusted | List of trusted certificates
[in] | chain | Certificate chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on)
[in] | reason | Buffer for returning failure reason (X509_VALIDATE_*)
Return values
0 if chain is valid, -1 if not

x509_certificate_chain_validate - Validate X.509 certificate chain : List of trusted certificates : Certificate chain to be validated (first chain must be issued by signed by the second certificate in the chain and so on) : Buffer for returning failure reason (X509_VALIDATE_*) Returns: 0 if chain is valid, -1 if not

struct x509_certificate* x509_certificate_parse | ( | const UINT8 * | buf,
 |  | size_t | len
 | ) |  |

Parse a X.509 certificate in DER format. Caller is responsible for freeing the returned certificate by calling x509_certificate_free().

Parameters
[in] | buf | Pointer to the X.509 certificate in DER format
[in] | len | Buffer length
Return values
x509_certificate Pointer to the parsed certificate or NULL on failure


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoProtocols Directory Reference

  • CryptoProtocols
CryptoProtocols Directory Reference

Files

file | CryptoDxe.c
file | CryptoPei.c


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoProtocols/CryptoDxe.c File Reference

  • File List
  • Globals
  • CryptoProtocols
Functions | Variables
CryptoDxe.c File Reference
#include <Token.h>
#include <AmiDxeLib.h>
#include "Setup.h"
#include "AmiCertificate.h"
#include <Protocol/AmiDigitalSignature.h>
#include <Protocol/SmmBase.h>
#include <Library/MemoryAllocationLib.h>

Functions

EFI_STATUS EFIAPI | DxePkcs1Verify (IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CRYPT_HANDLE *PublicKey, IN CRYPT_HANDLE *Hash, IN VOID *Signature, IN UINTN SignatureSize, IN UINT32 Flags)
EFI_STATUS EFIAPI | DxePkcs7Verify (IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CONST UINT8 *P7Data, IN UINTN P7Size, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN OUT UINT8 **Data, IN OUT UINTN *DataSize, IN UINT8 Operation, IN UINT32 Flags)
EFI_STATUS EFIAPI | DxeHash (IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, IN UINTN Num_elem, IN CONST UINT8 *Addr[], IN CONST UINTN *Len, OUT UINT8 *Hash)
EFI_STATUS EFIAPI | DxeGetKey (IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, OUT CRYPT_HANDLE *Key, IN EFI_GUID *AlgId, IN UINTN KeyLen, IN UINT32 Flags)
EFI_STATUS EFIAPI | DxeVerifyKey (IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN EFI_GUID *AlgId, IN CRYPT_HANDLE *Key)
EFI_STATUS | CryptoGetFwKey (IN EFI_SYSTEM_TABLE *SystemTable, IN CRYPT_HANDLE *Key)
EFI_STATUS EFIAPI | InSmmFunction (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI | NotInSmmFunction (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)

Variables

EFI_BOOT_SERVICES * | pBS
EFI_RUNTIME_SERVICES * | pRS
const UINT8 | KeyE [] = {E_CONST}
const UINTN | LenE = sizeof(KeyE)
const INT32 | saltlen = PSS_SIG_SALTLEN
AMI_DIGITAL_SIGNATURE_PROTOCOL | mAmiSig

Detailed Description

CryptoDxe.c

Function Documentation

EFI_STATUS CryptoGetFwKey | ( | IN EFI_SYSTEM_TABLE * | SystemTable,
 |  | IN CRYPT_HANDLE * | Key
 | ) |  |

Passes FwKey info from a Hob to an external Key handler structure

Parameters
[in] | SystemTable | Efi System Table
[out] | Key | ptr to the buffer to hold the target key parameters
Return values
Status EFI_NOT_FOUND - Can't find the Key Hob EFI_INVALID_PARAMETER - Wrong KeyID
EFI_STATUS EFIAPI DxeGetKey | ( | IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL * | This,
 |  | OUT CRYPT_HANDLE * | Key,
 |  | IN EFI_GUID * | AlgId,
 |  | IN UINTN | KeyLen,
 |  | IN UINT32 | Flags
 | ) |  |

Return Firmware Signing Key from a local storage

Parameters
[in] | This | Pointer to the AMI_DIGITAL_SIGNATURE_PROTOCOL instance.
[out] | Key | ptr to the buffer to hold the target key
[in] | AlgId | Key GUID
[in] | KeyLen | Length of the target Key buffer
[in] | Flags | Specifies additional flags to further customize the GetKey behavior.
Return values
Status EFI_SUCCESS EFI_ACCESS_DENIED The key could not be located EFI_INVALID_PARAMETER Wrong KeyID BUFFER_TOO_SMALL The Key->BlobSize will contain the size of the buffer to be prepared
EFI_STATUS EFIAPI DxeHash | ( | IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL * | This,
 |  | IN CONST EFI_GUID * | HashAlgorithm,
 |  | IN UINTN | num_elem,
 |  | IN CONST UINT8 * | addr[],
 |  | IN CONST UINTN * | len,
 |  | OUT UINT8 * | Hash
 | ) |  |

Allows creating a hash of an arbitrary message digest using one or more hash algorithms

Parameters
[in] | This | Pointer to the AMI_DIGITAL_SIGNATURE_PROTOCOL instance.
[in] | HashAlgorithm | Points to the EFI_GUID which identifies the algorithm to use.
[in] | num_elem | Number of blocks to be passed via next argument:addr[]
[in] | addr[] | Pointer to array of UINT8* addresses of data blocks to be hashed
[in] | len | Pointer to array of integers containing length of each block listed by addr[]
[in] | Hash | Holds the resulting hash computed from the message.
Return values
Status EFI_SUCCESS Hash returned successfully. EFI_INVALID_PARAMETER Message or Hash is NULL EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this driver.
EFI_STATUS EFIAPI DxePkcs1Verify | ( | IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL * | This,
 |  | IN CRYPT_HANDLE * | PublicKey,
 |  | IN CRYPT_HANDLE * | Hash,
 |  | IN VOID * | Signature,
 |  | IN UINTN | SignatureSize,
 |  | IN UINT32 | Flags
 | ) |  |

Function verifies that the specified signature matches the specified hash. Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1. This function decrypts the signature with the provided key and then compares the decrypted value to the specified hash value

Parameters
[in] | This | Pointer to the AMI_DIGITAL_SIGNATURE_PROTOCOL instance.
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
[in] | Hash | Handle of the hash object to verify.
[in] | Signature | Pointer to the signature data to be verified.
[in] | SignatureSize | The size, in bytes, of the signature data.
[in] | Flags | Specifies additional flags to further customize the signing/verifying behavior.
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS EFIAPI DxePkcs7Verify | ( | IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL * | This,
 |  | IN CONST UINT8 * | P7Data,
 |  | IN UINTN | P7Size,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertSize,
 |  | IN OUT UINT8 ** | Data,
 |  | IN OUT UINTN * | DataSize,
 |  | IN UINT8 | Operation,
 |  | IN UINT32 | Flags
 | ) |  |

Verifies the validity of a PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". Function performs several operations on input Pkcs7 certificate based on the input Operation argument

  1. Verifies validity of the signature contained inside the Certificate This function decrypts the signature with the Public key from the Signer certificate and then compares the decrypted value to the input Data
  2. Extracts the Signer certificate in format of x509
  3. Extracts Root CA certificate that used to sign the Signer certificate.
Parameters
[in] | This | Pointer to the AMI_DIGITAL_SIGNATURE_PROTOCOL instance.
[in] | P7Data | Pointer to the PKCS#7 DER encoded message to verify.
[in] | P7Size | Size of the PKCS#7 message in bytes.
[in] | TrustedCert | Pointer to a trusted/root X509 certificate encoded in DER, which is used for certificate chain verification.
[in] | CertSize | Size of the trusted certificate in bytes.
[in] | Data | Pointer to the content to be verified/returned at
[in] | DataSize | Size of Data in bytes
[in] | Operation | Specifies different tasks to perform: 0-Function presence check. Must return EFI_SUCCESS 1-Validate Certificate 2-Return Signer Certificate in *Data. Performs cert chaining and time based validity tests 3-Return Root CA certificate referenced by Signer. Used to compare with Trusted Cert in FW 4-Validate Root Certificate 5-Validate Signer Certificate Chain 6-Return Signature Digest Algorithm 7-Validate Certificate, return Root CA Certificate 8-Validate Certificate, return Signer Certificate 9-Validate Certificate, return Signer Key Hash (SHA256) 10-Validate Certificate and return Success if match is found between Trust and any leaf certificates in the Signer chain 11-Validate Certificate, return ptr in *Data to n-modulus of a Signer Key 12-Return Success if match is found between Trust and any leaf certificates in the Signer chain 13-Validate Certificate, return ptr in *Data to n-modulus of a Root CA Key 14-Return ptr in *Data to n-modulus of a Root CA Key 15-Return ptr in *Data to n-modulus of a Signer Key 16-Validate TimeStamp certificate chain in Pkcs7 Certificate 17-Retrieves all embedded certificates from PKCS#7 signed data, and outputs certificate lists chained to the signer's certificates. 18-Retrieves all embedded certificates from PKCS#7 signed data, and outputs certificate lists un-chained to the signer's certificates. 19-Return null-terminated ASCII string of Subject's CommonName. Caller is responsible for allocating a buffer 20-255 reserved values
[in] | Flags | Specifies additional flags to further customize the signing/verifying behavior.
Return values
Status EFI_SUCCESS The specified PKCS#7 signed data is valid EFI_SECURITY_VIOLATION Invalid PKCS#7 signed data. EFI_ACCESS_DENIED The Trusted certificate does not have a match in SignedData.certificate store. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.

Retrieves all embedded certificates from PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard", and outputs two certificate lists chained or un-chained to the signer's certificates.

Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated ASCII format string from a Subject name structure of a CommonName.

EFI_STATUS EFIAPI DxeVerifyKey | ( | IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL * | This,
 |  | IN EFI_GUID * | AlgId,
 |  | IN CRYPT_HANDLE * | Key
 | ) |  |

Function compares the input PublicKey against Platform Signing Key (PK) image in the flash.

Parameters
[in] | This | Pointer to the AMI_DIGITAL_SIGNATURE_PROTOCOL instance.
[in] | KeyAlgorithm | Points to the EFI_GUID which identifies the PKpub algorithm to use.
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
Return values
Status EFI_SUCCESS The Key is successfully verified. EFI_SECURITY_VIOLATION The Key does not match current FW key. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS EFIAPI InSmmFunction | ( | EFI_HANDLE | ImageHandle,
 |  | EFI_SYSTEM_TABLE * | SystemTable
 | ) |  |

InSMM Driver Entry point. This function is called from outside of SMM during SMM registration.

Parameters
[in] | ImageHandle | Image Handle
[in] | SystemTable | Efi System Table
Return values
Status
EFI_STATUS EFIAPI NotInSmmFunction | ( | EFI_HANDLE | ImageHandle,
 |  | EFI_SYSTEM_TABLE * | SystemTable
 | ) |  |

DXE handle for CryptoDXE Driver. Invoked from DXE Driver entry point.

Parameters
[in] | ImageHandle | Image Handle
[in] | SystemTable | Efi System Table
Return values
Status

Variable Documentation

AMI_DIGITAL_SIGNATURE_PROTOCOL mAmiSig
Initial value:
= {
DxePkcs1Verify,
DxePkcs7Verify,
DxeHash,
DxeGetKey,
DxeVerifyKey
}
DxeHash
EFI_STATUS EFIAPI DxeHash(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, IN UINTN Num_elem, IN CONST UINT8 *Addr[], IN CONST UINTN *Len, OUT UINT8 *Hash)
Definition: CryptoDxe.c:141
DxeVerifyKey
EFI_STATUS EFIAPI DxeVerifyKey(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN EFI_GUID *AlgId, IN CRYPT_HANDLE *Key)
Definition: CryptoDxe.c:731
DxePkcs7Verify
EFI_STATUS EFIAPI DxePkcs7Verify(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CONST UINT8 *P7Data, IN UINTN P7Size, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN OUT UINT8 **Data, IN OUT UINTN *DataSize, IN UINT8 Operation, IN UINT32 Flags)
Definition: CryptoDxe.c:246
DxeGetKey
EFI_STATUS EFIAPI DxeGetKey(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, OUT CRYPT_HANDLE *Key, IN EFI_GUID *AlgId, IN UINTN KeyLen, IN UINT32 Flags)
Definition: CryptoDxe.c:677
DxePkcs1Verify
EFI_STATUS EFIAPI DxePkcs1Verify(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, IN CRYPT_HANDLE *PublicKey, IN CRYPT_HANDLE *Hash, IN VOID *Signature, IN UINTN SignatureSize, IN UINT32 Flags)
Definition: CryptoDxe.c:549


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/CryptoProtocols/CryptoPei.c File Reference

  • File List
  • Globals
  • CryptoProtocols
Functions | Variables
CryptoPei.c File Reference
#include <Token.h>
#include <AmiPeiLib.h>
#include "Ppi/LoadFile.h"
#include <Protocol/Hash.h>
#include <PPI/CryptoPPI.h>
#include "AmiCertificate.h"
#include <Protocol/AmiDigitalSignature.h>

Functions

EFI_STATUS EFIAPI | PeiHash (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *HashAlgorithm, IN UINTN num_elem, IN CONST UINT8 *addr[], IN CONST UINTN *len, OUT UINT8 *Hash)
EFI_STATUS EFIAPI | PeiPkcs7Verify (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST UINT8 *P7Data, IN UINTN P7Size, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN OUT UINT8 **Data, IN OUT UINTN *DataSize)
EFI_STATUS EFIAPI | PeiVerifySig (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN PEI_CRYPT_HANDLE *PublicKey, IN PEI_CRYPT_HANDLE *Hash, IN VOID *Signature, IN UINTN SignatureSize, IN UINT32 Flags)
EFI_STATUS EFIAPI | PeiGetKey (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *KeyAlgorithm, IN PEI_CRYPT_HANDLE *PublicKey)
EFI_STATUS EFIAPI | PeiVerifyKey (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *KeyAlgorithm, IN PEI_CRYPT_HANDLE *PublicKey)
EFI_STATUS | CryptoGetRawImage (IN EFI_GUID *FileGuid, IN OUT VOID **Buffer, IN OUT UINTN *Size)
EFI_STATUS EFIAPI | PeiGetKey (IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *KeyAlgorithm, IN OUT PEI_CRYPT_HANDLE *PublicKey)
EFI_STATUS EFIAPI | CryptoPei_Init (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)

Variables

CONST EFI_PEI_SERVICES ** | ppPS
FW_KEY_HOB * | pFwKeyHob = NULL
const UINT8 | KeyE [] = {E_CONST}
const UINTN | LenE = sizeof(KeyE)
const INT32 | saltlen = PSS_SIG_SALTLEN
AMI_CRYPT_DIGITAL_SIGNATURE_PPI | mSigPeiInitPpi
EFI_PEI_PPI_DESCRIPTOR | mPpiSigListVariable

Detailed Description

CryptoPei.c

Function Documentation

EFI_STATUS CryptoGetRawImage | ( | IN EFI_GUID * | FileGuid,
 |  | IN OUT VOID ** | Buffer,
 |  | IN OUT UINTN * | Size
 | ) |  |

Loads binary from RAW section of X firmware volume

Parameters
[out] | Buffer | - returns a pointer to allocated memory. Caller must free it when done
[out] | Size | - returns the size of the binary loaded into the buffer.
Return values
Status
EFI_STATUS EFIAPI CryptoPei_Init | ( | IN EFI_PEI_FILE_HANDLE | FileHandle,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices
 | ) |  |

This function is the entry point for this PEI.

Parameters
[in] | FileHandle | Pointer to the file handle
[in] | PeiServices | Pointer to the PEI services table
Return values
Status
EFI_STATUS EFIAPI PeiGetKey | ( | IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI * | This,
 |  | IN CONST EFI_GUID * | KeyAlgorithm,
 |  | IN OUT PEI_CRYPT_HANDLE * | PublicKey
 | ) |  |

Function returns Ptr to a Platform Signing Key (PK) Ffs inside Recovery FV (FV_BB or similar)

Parameters
[in] | This | Pointer to the AMI_CRYPT_DIGITAL_SIGNATURE_PPI instance.
[in] | KeyAlgorithm | Points to the EFI_GUID which identifies the PKpub algorithm to use.
[out] | PublicKey | Handle to a key used to return a ptr to a Key. This handle must be identifying a public key.
Return values
Status EFI_SUCCESS The Key is successfully returned. EFI_NOT_FOUND The Key not found EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS EFIAPI PeiHash | ( | IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI * | This,
 |  | IN CONST EFI_GUID * | HashAlgorithm,
 |  | IN UINTN | num_elem,
 |  | IN CONST UINT8 * | addr[],
 |  | IN CONST UINTN * | len,
 |  | OUT UINT8 * | Hash
 | ) |  |

Allows creating a hash of an arbitrary message digest using one or more hash algorithms

Parameters
[in] | This | Pointer to the AMI_CRYPT_DIGITAL_SIGNATURE_PPI instance.
[in] | HashAlgorithm | Points to the EFI_GUID which identifies the algorithm to use.
[in] | num_elem | Number of blocks to be passed via next argument:addr[]
[in] | addr[] | Pointer to array of UINT8* addresses of data blocks to be hashed
[in] | len | Pointer to array of integers containing length of each block listed by addr[]
[in] | Hash | Holds the resulting hash computed from the message.
Return values
Status EFI_SUCCESS Hash returned successfully. EFI_INVALID_PARAMETER Message or Hash is NULL EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this driver.
EFI_STATUS EFIAPI PeiPkcs7Verify | ( | IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI * | This,
 |  | IN CONST UINT8 * | P7Data,
 |  | IN UINTN | P7Size,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertSize,
 |  | IN OUT UINT8 ** | Data,
 |  | IN OUT UINTN * | DataSize
 | ) |  |

Verifies the validity of a PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". Function verifies validity of the signature contained inside the Certificate This function decrypts the signature with the Public key from the Signer certificate and then compares the decrypted value to the input Data

Parameters
[in] | This | Pointer to the AMI_CRYPT_DIGITAL_SIGNATURE_PPI instance.
[in] | P7Data | Pointer to the PKCS#7 DER encoded message to verify.
[in] | P7Size | Size of the PKCS#7 message in bytes.
[in] | TrustedCert | Pointer to a trusted/root X509 certificate encoded in DER, which is used for certificate chain verification.
[in] | CertSize | Size of the trusted certificate in bytes.
[in] | Data | Pointer to the content to be verified/returned at
[in] | DataSize | Size of Data in bytes
Return values
Status EFI_SUCCESS The specified PKCS#7 signed data is valid EFI_SECURITY_VIOLATION Invalid PKCS#7 signed data. EFI_ACCESS_DENIED The Trusted certificate does not have a match in SignedData.certificate store. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS EFIAPI PeiVerifyKey | ( | IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI * | This,
 |  | IN CONST EFI_GUID * | KeyAlgorithm,
 |  | IN PEI_CRYPT_HANDLE * | PublicKey
 | ) |  |

Function compares the input PublicKey against Platform Signing Key (PK) image in the flash.

Parameters
[in] | This | Pointer to the AMI_CRYPT_DIGITAL_SIGNATURE_PPI instance.
[in] | KeyAlgorithm | Points to the EFI_GUID which identifies the PKpub algorithm to use.
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
Return values
Status EFI_SUCCESS The Key is successfully verified. EFI_SECURITY_VIOLATION The Key does not match current FW key. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS EFIAPI PeiVerifySig | ( | IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI * | This,
 |  | IN PEI_CRYPT_HANDLE * | PublicKey,
 |  | IN PEI_CRYPT_HANDLE * | Hash,
 |  | IN VOID * | Signature,
 |  | IN UINTN | SignatureSize,
 |  | IN UINT32 | Flags
 | ) |  |

Function verifies that the specified signature matches the specified hash. Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1. This function decrypts the signature with the provided key and then compares the decrypted value to the specified hash value

Parameters
[in] | This | Pointer to the AMI_CRYPT_DIGITAL_SIGNATURE_PPI instance.
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
[in] | Hash | Handle of the hash object to verify.
[in] | Signature | Pointer to the signature data to be verified.
[in] | SignatureSize | The size, in bytes, of the signature data.
[in] | Flags | Specifies additional flags to further customize the signing/verifying behavior.
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.

Variable Documentation

EFI_PEI_PPI_DESCRIPTOR mPpiSigListVariable
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gAmiDigitalSignaturePPIGuid,
&mSigPeiInitPpi
}
AMI_CRYPT_DIGITAL_SIGNATURE_PPI mSigPeiInitPpi
Initial value:
= {
PeiHash,
PeiVerifyKey,
PeiVerifySig,
PeiGetKey,
PeiPkcs7Verify
}
PeiPkcs7Verify
EFI_STATUS EFIAPI PeiPkcs7Verify(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST UINT8 *P7Data, IN UINTN P7Size, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN OUT UINT8 **Data, IN OUT UINTN *DataSize)
Definition: CryptoPei.c:393
PeiHash
EFI_STATUS EFIAPI PeiHash(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *HashAlgorithm, IN UINTN num_elem, IN CONST UINT8 *addr[], IN CONST UINTN *len, OUT UINT8 *Hash)
Definition: CryptoPei.c:225
PeiVerifyKey
EFI_STATUS EFIAPI PeiVerifyKey(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *KeyAlgorithm, IN PEI_CRYPT_HANDLE *PublicKey)
Definition: CryptoPei.c:512
PeiGetKey
EFI_STATUS EFIAPI PeiGetKey(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *KeyAlgorithm, IN OUT PEI_CRYPT_HANDLE *PublicKey)
Definition: CryptoPei.c:472
PeiVerifySig
EFI_STATUS EFIAPI PeiVerifySig(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN PEI_CRYPT_HANDLE *PublicKey, IN PEI_CRYPT_HANDLE *Hash, IN VOID *Signature, IN UINTN SignatureSize, IN UINT32 Flags)
Definition: CryptoPei.c:298


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include Directory Reference

  • Include
Include Directory Reference

Directories

directory | Library
directory | PPI
directory | Protocol

Files

file AmiCertificate.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Library Directory Reference

  • Include
  • Library
Library Directory Reference

Files

file | BaseCryptLib.h
file | CryptLib.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Library/BaseCryptLib.h File Reference

  • File List
  • Globals
  • Include
  • Library
Macros | Typedefs | Enumerations | Functions
BaseCryptLib.h File Reference
#include <Efi.h>

Macros

#define | MD5_DIGEST_SIZE 16
#define | SHA1_DIGEST_SIZE 20
#define | SHA256_DIGEST_SIZE 32
#define | SHA384_DIGEST_SIZE 48
#define | SHA512_DIGEST_SIZE 64

Typedefs

typedef enum _RSA_KEY_TAG RSA_KEY_TAG

Enumerations

enum _RSA_KEY_TAG {
RsaKeyN, RsaKeyE, RsaKeyD, RsaKeyP,
RsaKeyQ, RsaKeyDp, RsaKeyDq, RsaKeyQInv
}

Functions

UINTN EFIAPI | Md5GetContextSize (VOID)
BOOLEAN EFIAPI | Md5Init (OUT VOID *Md5Context)
BOOLEAN EFIAPI | Md5Duplicate (IN CONST VOID *Md5Context, OUT VOID *NewMd5Context)
BOOLEAN EFIAPI | Md5Update (IN OUT VOID *Md5Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Md5Final (IN OUT VOID *Md5Context, OUT UINT8 *HashValue)
UINTN EFIAPI | Sha1GetContextSize (VOID)
BOOLEAN EFIAPI | Sha1Init (OUT VOID *Sha1Context)
BOOLEAN EFIAPI | Sha1Duplicate (IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context)
BOOLEAN EFIAPI | Sha1Update (IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Sha1Final (IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
UINTN EFIAPI | Sha256GetContextSize (VOID)
BOOLEAN EFIAPI | Sha256Init (OUT VOID *Sha256Context)
BOOLEAN EFIAPI | Sha256Duplicate (IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
BOOLEAN EFIAPI | Sha256Update (IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Sha256Final (IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
UINTN EFIAPI | Sha384GetContextSize (VOID)
BOOLEAN EFIAPI | Sha384Init (OUT VOID *Sha384Context)
BOOLEAN EFIAPI | Sha384Duplicate (IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
BOOLEAN EFIAPI | Sha384Update (IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Sha384Final (IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
UINTN EFIAPI | Sha512GetContextSize (VOID)
BOOLEAN EFIAPI | Sha512Init (OUT VOID *Sha512Context)
BOOLEAN EFIAPI | Sha512Duplicate (IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
BOOLEAN EFIAPI | Sha512Update (IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI | Sha512Final (IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
VOID *EFIAPI | RsaNew (VOID)
VOID EFIAPI | RsaFree (IN VOID *RsaContext)
BOOLEAN EFIAPI | RsaSetKey (IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize)
BOOLEAN EFIAPI | RsaPkcs1Verify (IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
BOOLEAN EFIAPI | Pkcs7Verify (IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength)
BOOLEAN EFIAPI | AuthenticodeVerify (IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize)

Detailed Description

BaseCryptLib.h

Defines base cryptographic library APIs. The Base Cryptographic Library provides implementations of basic cryptography primitives (SHA-1, SHA-256, RSA, etc) for UEFI security functionality enabling.

Macro Definition Documentation

#define MD5_DIGEST_SIZE 16

MD5 digest size in bytes

#define SHA1_DIGEST_SIZE 20

SHA-1 digest size in bytes.

#define SHA256_DIGEST_SIZE 32

SHA-256 digest size in bytes

#define SHA384_DIGEST_SIZE 48

SHA-384 digest size in bytes

#define SHA512_DIGEST_SIZE 64

SHA-512 digest size in bytes

Typedef Documentation

typedef enum _RSA_KEY_TAG RSA_KEY_TAG

No MAC supports for minimum scope required by UEFI No symmetric cryptographic supports for minimum scope required by UEFI RSA Key Tags Definition used in RsaSetKey() function for key component identification.

Enumeration Type Documentation

enum _RSA_KEY_TAG

No MAC supports for minimum scope required by UEFI No symmetric cryptographic supports for minimum scope required by UEFI RSA Key Tags Definition used in RsaSetKey() function for key component identification.

Enumerator
RsaKeyN | RSA public Modulus (N)
RsaKeyE | RSA Public exponent (e)
RsaKeyD | RSA Private exponent (d)
RsaKeyP | RSA secret prime factor of Modulus (p)
RsaKeyQ | RSA secret prime factor of Modules (q)
RsaKeyDp | p's CRT exponent (== d mod (p - 1))
RsaKeyDq | q's CRT exponent (== d mod (q - 1))
RsaKeyQInv | The CRT coefficient (== 1/q mod p)

Function Documentation

BOOLEAN EFIAPI AuthenticodeVerify | ( | IN CONST UINT8 * | AuthData,
 |  | IN UINTN | DataSize,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertSize,
 |  | IN CONST UINT8 * | ImageHash,
 |  | IN UINTN | HashSize
 | ) |  |

Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows Authenticode Portable Executable Signature Format".

If AuthData is NULL, then return FALSE. If ImageHash is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | AuthData | Pointer to the Authenticode Signature retrieved from signed PE/COFF image to be verified.
[in] | DataSize | Size of the Authenticode Signature in bytes.
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification.
[in] | CertSize | Size of the trusted certificate in bytes.
[in] | ImageHash | Pointer to the original image file hash value. The produce for calculating the image hash value is described in Authenticode specification.
[in] | HashSize | Size of Image hash value in bytes.
Return values
TRUE | The specified Authenticode Signature is valid.
FALSE | Invalid Authenticode Signature.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Duplicate | ( | IN CONST VOID * | Md5Context,
 |  | OUT VOID * | NewMd5Context
 | ) |  |

Makes a copy of an existing MD5 context.

If Md5Context is NULL, then return FALSE. If NewMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Md5Context | Pointer to MD5 context being copied.
[out] | NewMd5Context | Pointer to new MD5 context.
Return values
TRUE | MD5 context copy succeeded.
FALSE | MD5 context copy failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Final | ( | IN OUT VOID * | Md5Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the MD5 digest value.

This function completes MD5 hash computation and retrieves the digest value into the specified memory. After this function has been called, the MD5 context cannot be used again. MD5 context should be already correctly initialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid MD5 context is undefined.

If Md5Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Md5Context | Pointer to the MD5 context.
[out] | HashValue | Pointer to a buffer that receives the MD5 digest value (16 bytes).
Return values
TRUE | MD5 digest computation succeeded.
FALSE | MD5 digest computation failed.
FALSE | This interface is not supported.
UINTN EFIAPI Md5GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.

If this interface is not supported, then return zero.

Returns
The size, in bytes, of the context buffer required for MD5 hash operations.
Return values
0 This interface is not supported.
BOOLEAN EFIAPI Md5Init ( OUT VOID * Md5Context )

Initializes user-supplied memory pointed by Md5Context as MD5 hash context for subsequent use.

If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[out] Md5Context Pointer to MD5 context being initialized.
Return values
TRUE | MD5 context initialization succeeded.
FALSE | MD5 context initialization failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Md5Update | ( | IN OUT VOID * | Md5Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataSize
 | ) |  |

Digests the input data and updates MD5 context.

This function performs MD5 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. MD5 context should be already correctly initialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid context is undefined.

If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Md5Context | Pointer to the MD5 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | MD5 data digest succeeded.
FALSE | MD5 data digest failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Pkcs7Verify | ( | IN CONST UINT8 * | P7Data,
 |  | IN UINTN | P7Length,
 |  | IN CONST UINT8 * | TrustedCert,
 |  | IN UINTN | CertLength,
 |  | IN CONST UINT8 * | InData,
 |  | IN UINTN | DataLength
 | ) |  |

Verifies the validity of a PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". The input signed data could be wrapped in a ContentInfo structure.

If P7Data, TrustedCert or InData is NULL, then return FALSE. If P7Length, CertLength or DataLength overflow, then return FAlSE. If this interface is not supported, then return FALSE.

Parameters
[in] | P7Data | Pointer to the PKCS#7 message to verify.
[in] | P7Length | Length of the PKCS#7 message in bytes.
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification.
[in] | CertLength | Length of the trusted certificate in bytes.
[in] InData 1. Pointer to the content to be verified.
  1. A pointer to a hash value (SHA1 or SHA256 supported) of the content to be verified.
[in] | DataLength | Length of InData in bytes.
Return values
TRUE | The specified PKCS#7 signed data is valid.
FALSE | Invalid PKCS#7 signed data.
FALSE | This interface is not supported.
VOID EFIAPI RsaFree ( IN VOID * RsaContext )

Release the specified RSA context.

If RsaContext is NULL, then return FALSE.

Parameters
[in] RsaContext Pointer to the RSA context to be released.

Release the specified RSA Context.

Parameters
[in] RsaContext Pointer to the RSA context to be released.
VOID* EFIAPI RsaNew ( VOID )

Allocates and initializes one RSA context for subsequent use.

Returns
Pointer to the RSA context that has been initialized. If the allocations fails, RsaNew() returns NULL.

Allocates and Initializes one RSA Context for subsequent use.

Returns
Pointer to the RSA Context that has been initialized. If the allocations fails, RsaNew() returns NULL.
BOOLEAN EFIAPI RsaPkcs1Verify | ( | IN VOID * | RsaContext,
 |  | IN CONST UINT8 * | MessageHash,
 |  | IN UINTN | HashLength,
 |  | IN CONST UINT8 * | Signature,
 |  | IN UINTN | SigLength
 | ) |  |

Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1.

If RsaContext is NULL, then return FALSE. If MessageHash is NULL, then return FALSE. If Signature is NULL, then return FALSE. If HashSize is not equal to the size of MD5, SHA-1, SHA-256 digest, then return FALSE.

Parameters
[in] | RsaContext | Pointer to RSA context for signature verification.
[in] | MessageHash | Pointer to octet message hash to be checked.
[in] | HashSize | Size of the message hash in bytes.
[in] | Signature | Pointer to RSA PKCS1-v1_5 signature to be verified.
[in] | SigSize | Size of signature in bytes.
Return values
TRUE | Valid signature encoded in PKCS1-v1_5.
FALSE | Invalid signature or invalid RSA context.

Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1.

If RsaContext is NULL, then ASSERT(). If MessageHash is NULL, then ASSERT(). If Signature is NULL, then ASSERT(). If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then ASSERT().

Parameters
[in] | RsaContext | Pointer to RSA context for signature verification.
[in] | MessageHash | Pointer to octet message hash to be checked.
[in] | HashLength | Length of the message hash in bytes.
[in] | Signature | Pointer to RSA PKCS1-v1_5 signature to be verified.
[in] | SigLength | Length of signature in bytes.
Returns
TRUE Valid signature encoded in PKCS1-v1_5.
FALSE Invalid signature or invalid RSA context.
BOOLEAN EFIAPI RsaSetKey | ( | IN OUT VOID * | RsaContext,
 |  | IN RSA_KEY_TAG | KeyTag,
 |  | IN CONST UINT8 * | BigNumber,
 |  | IN UINTN | BnLength
 | ) |  |

Sets the tag-designated key component into the established RSA context.

This function sets the tag-designated RSA key component into the established RSA context from the user-specified non-negative integer (octet string format represented in RSA PKCS#1). If BigNumber is NULL, then the specified key component in RSA context is cleared.

If RsaContext is NULL, then return FALSE.

Parameters
[in,out] | RsaContext | Pointer to RSA context being set.
[in] | KeyTag | Tag of RSA key component being set.
[in] | BigNumber | Pointer to octet integer buffer. If NULL, then the specified key component in RSA context is cleared.
[in] | BnSize | Size of big number buffer in bytes. If BigNumber is NULL, then it is ignored.
Return values
TRUE | RSA key component was set successfully.
FALSE | Invalid RSA key component tag.

Sets the tag-designated RSA key component into the established RSA context from the user-specified nonnegative integer (octet string format represented in RSA PKCS#1).

If RsaContext is NULL, then ASSERT().

Parameters
[in,out] | RsaContext | Pointer to RSA context being set.
[in] | KeyTag | Tag of RSA key component being set.
[in] | BigNumber | Pointer to octet integer buffer.
[in] | BnLength | Length of big number buffer in bytes.
Returns
TRUE RSA key component was set successfully.
FALSE Invalid RSA key component tag.
BOOLEAN EFIAPI Sha1Duplicate | ( | IN CONST VOID * | Sha1Context,
 |  | OUT VOID * | NewSha1Context
 | ) |  |

Makes a copy of an existing SHA-1 context.

If Sha1Context is NULL, then return FALSE. If NewSha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Sha1Context | Pointer to SHA-1 context being copied.
[out] | NewSha1Context | Pointer to new SHA-1 context.
Return values
TRUE | SHA-1 context copy succeeded.
FALSE | SHA-1 context copy failed.
FALSE | This interface is not supported.

Makes a copy of an existing SHA-1 context.

If Sha1Context is NULL, then return FALSE. If NewSha1Context is NULL, then return FALSE.

Parameters
[in] | Sha1Context | Pointer to SHA-1 context being copied.
[out] | NewSha1Context | Pointer to new SHA-1 context.
Return values
TRUE | SHA-1 context copy succeeded.
FALSE | SHA-1 context copy failed.
BOOLEAN EFIAPI Sha1Final | ( | IN OUT VOID * | Sha1Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the SHA-1 digest value.

This function completes SHA-1 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-1 context cannot be used again. SHA-1 context should be already correctly initialized by Sha1Init(), and should not be finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.

If Sha1Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context.
[out] | HashValue | Pointer to a buffer that receives the SHA-1 digest value (20 bytes).
Return values
TRUE | SHA-1 digest computation succeeded.
FALSE | SHA-1 digest computation failed.
FALSE | This interface is not supported.

Completes SHA-1 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-1 context cannot be used again.

If Sha1Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context
[out] | HashValue | Pointer to a buffer that receives the SHA-1 digest value (20 bytes).
Return values
TRUE SHA-1 digest computation succeeded.
UINTN EFIAPI Sha1GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.

If this interface is not supported, then return zero.

Returns
The size, in bytes, of the context buffer required for SHA-1 hash operations.
Return values
0 This interface is not supported.

Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.

Returns
The size, in bytes, of the context buffer required for SHA-1 hash operations.
BOOLEAN EFIAPI Sha1Init ( OUT VOID * Sha1Context )

Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for subsequent use.

If Sha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[out] Sha1Context Pointer to SHA-1 context being initialized.
Return values
TRUE | SHA-1 context initialization succeeded.
FALSE | SHA-1 context initialization failed.
FALSE | This interface is not supported.
BOOLEAN EFIAPI Sha1Update | ( | IN OUT VOID * | Sha1Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Digests the input data and updates SHA-1 context.

This function performs SHA-1 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-1 context should be already correctly initialized by Sha1Init(), and should not be finalized by Sha1Final(). Behavior with invalid context is undefined.

If Sha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | SHA-1 data digest succeeded.
FALSE | SHA-1 data digest failed.
FALSE | This interface is not supported.

Performs SHA-1 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha1Context is NULL, then ASSERT().

Parameters
[in,out] | Sha1Context | Pointer to the SHA-1 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-1 data digest succeeded.
FALSE | Invalid SHA-1 context. After Sha1Final function has been called, the SHA-1 context cannot be reused.
BOOLEAN EFIAPI Sha256Duplicate | ( | IN CONST VOID * | Sha256Context,
 |  | OUT VOID * | NewSha256Context
 | ) |  |

Makes a copy of an existing SHA-256 context.

If Sha256Context is NULL, then return FALSE. If NewSha256Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Sha256Context | Pointer to SHA-256 context being copied.
[out] | NewSha256Context | Pointer to new SHA-256 context.
Return values
TRUE | SHA-256 context copy succeeded.
FALSE | SHA-256 context copy failed.
FALSE | This interface is not supported.

Makes a copy of an existing SHA-256 context.

If Sha256Context is NULL, then return FALSE. If NewSha256Context is NULL, then return FALSE.

Parameters
[in] | Sha256Context | Pointer to SHA-256 context being copied.
[out] | NewSha256Context | Pointer to new SHA-256 context.
Return values
TRUE | SHA-256 context copy succeeded.
FALSE | SHA-256 context copy failed.
BOOLEAN EFIAPI Sha256Final | ( | IN OUT VOID * | Sha256Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the SHA-256 digest value.

This function completes SHA-256 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-256 context cannot be used again. SHA-256 context should be already correctly initialized by Sha256Init(), and should not be finalized by Sha256Final(). Behavior with invalid SHA-256 context is undefined.

If Sha256Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.

Parameters
[in,out] | Sha256Context | Pointer to the SHA-256 context.
[out] | HashValue | Pointer to a buffer that receives the SHA-256 digest value (32 bytes).
Return values
TRUE | SHA-256 digest computation succeeded.
FALSE | SHA-256 digest computation failed.

Completes SHA-256 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-256 context cannot be used again.

If Sha256Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha256Context | Pointer to SHA-256 context
[out] | HashValue | Pointer to a buffer that receives the SHA-256 digest value (32 bytes).
Return values
TRUE SHA-256 digest computation succeeded.
UINTN EFIAPI Sha256GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-256 hash operations.

Returns
The size, in bytes, of the context buffer required for SHA-256 hash operations.

Retrieves the size, in bytes, of the context buffer required for SHA-256 operations.

Returns
The size, in bytes, of the context buffer required for SHA-256 operations.
BOOLEAN EFIAPI Sha256Init ( OUT VOID * Sha256Context )

Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for subsequent use.

If Sha256Context is NULL, then return FALSE.

Parameters
[out] Sha256Context Pointer to SHA-256 context being initialized.
Return values
TRUE | SHA-256 context initialization succeeded.
FALSE | SHA-256 context initialization failed.
BOOLEAN EFIAPI Sha256Update | ( | IN OUT VOID * | Sha256Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Digests the input data and updates SHA-256 context.

This function performs SHA-256 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-256 context should be already correctly initialized by Sha256Init(), and should not be finalized by Sha256Final(). Behavior with invalid context is undefined.

If Sha256Context is NULL, then return FALSE.

Parameters
[in,out] | Sha256Context | Pointer to the SHA-256 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | SHA-256 data digest succeeded.
FALSE | SHA-256 data digest failed.

Performs SHA-256 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha256Context is NULL, then ASSERT().

Parameters
[in,out] | Sha256Context | Pointer to the SHA-256 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-256 data digest succeeded.
FALSE | Invalid SHA-256 context. After Sha256Final function has been called, the SHA-256 context cannot be reused.
BOOLEAN EFIAPI Sha384Duplicate | ( | IN CONST VOID * | Sha384Context,
 |  | OUT VOID * | NewSha384Context
 | ) |  |

Makes a copy of an existing SHA-384 context.

If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Sha384Context | Pointer to SHA-384 context being copied.
[out] | NewSha384Context | Pointer to new SHA-384 context.
Return values
TRUE | SHA-384 context copy succeeded.
FALSE | SHA-384 context copy failed.
FALSE | This interface is not supported.

Makes a copy of an existing SHA-384 context.

If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE.

Parameters
[in] | Sha384Context | Pointer to SHA-384 context being copied.
[out] | NewSha384Context | Pointer to new SHA-384 context.
Return values
TRUE | SHA-384 context copy succeeded.
FALSE | SHA-384 context copy failed.
BOOLEAN EFIAPI Sha384Final | ( | IN OUT VOID * | Sha384Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the SHA-384 digest value.

This function completes SHA-384 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-384 context cannot be used again. SHA-384 context should be already correctly initialized by Sha384Init(), and should not be finalized by Sha384Final(). Behavior with invalid SHA-384 context is undefined.

If Sha384Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.

Parameters
[in,out] | Sha384Context | Pointer to the SHA-384 context.
[out] | HashValue | Pointer to a buffer that receives the SHA-384 digest value (32 bytes).
Return values
TRUE | SHA-384 digest computation succeeded.
FALSE | SHA-384 digest computation failed.

Completes SHA-384 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-384 context cannot be used again.

If Sha384Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha384Context | Pointer to SHA-384 context
[out] | HashValue | Pointer to a buffer that receives the SHA-384 digest value (32 bytes).
Return values
TRUE SHA-384 digest computation succeeded.
UINTN EFIAPI Sha384GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations.

Returns
The size, in bytes, of the context buffer required for SHA-384 hash operations.

Retrieves the size, in bytes, of the context buffer required for SHA-384 operations.

Returns
The size, in bytes, of the context buffer required for SHA-384 operations.
BOOLEAN EFIAPI Sha384Init ( OUT VOID * Sha384Context )

Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for subsequent use.

If Sha384Context is NULL, then return FALSE.

Parameters
[out] Sha384Context Pointer to SHA-384 context being initialized.
Return values
TRUE | SHA-384 context initialization succeeded.
FALSE | SHA-384 context initialization failed.
BOOLEAN EFIAPI Sha384Update | ( | IN OUT VOID * | Sha384Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Digests the input data and updates SHA-384 context.

This function performs SHA-384 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-384 context should be already correctly initialized by Sha384Init(), and should not be finalized by Sha384Final(). Behavior with invalid context is undefined.

If Sha384Context is NULL, then return FALSE.

Parameters
[in,out] | Sha384Context | Pointer to the SHA-384 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | SHA-384 data digest succeeded.
FALSE | SHA-384 data digest failed.

Performs SHA-384 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha384Context is NULL, then ASSERT().

Parameters
[in,out] | Sha384Context | Pointer to the SHA-384 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-384 data digest succeeded.
FALSE | Invalid SHA-384 context. After Sha384Final function has been called, the SHA-384 context cannot be reused.
BOOLEAN EFIAPI Sha512Duplicate | ( | IN CONST VOID * | Sha512Context,
 |  | OUT VOID * | NewSha512Context
 | ) |  |

Makes a copy of an existing SHA-512 context.

If Sha512Context is NULL, then return FALSE. If NewSha512Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.

Parameters
[in] | Sha512Context | Pointer to SHA-512 context being copied.
[out] | NewSha512Context | Pointer to new SHA-512 context.
Return values
TRUE | SHA-512 context copy succeeded.
FALSE | SHA-512 context copy failed.
FALSE | This interface is not supported.

Makes a copy of an existing SHA-512 context.

If Sha512Context is NULL, then return FALSE. If NewSha512Context is NULL, then return FALSE.

Parameters
[in] | Sha512Context | Pointer to SHA-512 context being copied.
[out] | NewSha512Context | Pointer to new SHA-512 context.
Return values
TRUE | SHA-512 context copy succeeded.
FALSE | SHA-512 context copy failed.
BOOLEAN EFIAPI Sha512Final | ( | IN OUT VOID * | Sha512Context,
 |  | OUT UINT8 * | HashValue
 | ) |  |

Completes computation of the SHA-512 digest value.

This function completes SHA-512 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-512 context cannot be used again. SHA-512 context should be already correctly initialized by Sha512Init(), and should not be finalized by Sha512Final(). Behavior with invalid SHA-512 context is undefined.

If Sha512Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.

Parameters
[in,out] | Sha512Context | Pointer to the SHA-512 context.
[out] | HashValue | Pointer to a buffer that receives the SHA-512 digest value (32 bytes).
Return values
TRUE | SHA-512 digest computation succeeded.
FALSE | SHA-512 digest computation failed.

Completes SHA-512 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-512 context cannot be used again.

If Sha512Context is NULL, then ASSERT(). If HashValue is NULL, then ASSERT().

Parameters
[in,out] | Sha512Context | Pointer to SHA-512 context
[out] | HashValue | Pointer to a buffer that receives the SHA-512 digest value (32 bytes).
Return values
TRUE SHA-512 digest computation succeeded.
UINTN EFIAPI Sha512GetContextSize ( VOID )

Retrieves the size, in bytes, of the context buffer required for SHA-512 hash operations.

Returns
The size, in bytes, of the context buffer required for SHA-512 hash operations.

Retrieves the size, in bytes, of the context buffer required for SHA-512 operations.

Returns
The size, in bytes, of the context buffer required for SHA-512 operations.
BOOLEAN EFIAPI Sha512Init ( OUT VOID * Sha512Context )

Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for subsequent use.

If Sha512Context is NULL, then return FALSE.

Parameters
[out] Sha512Context Pointer to SHA-512 context being initialized.
Return values
TRUE | SHA-512 context initialization succeeded.
FALSE | SHA-512 context initialization failed.
BOOLEAN EFIAPI Sha512Update | ( | IN OUT VOID * | Sha512Context,
 |  | IN CONST VOID * | Data,
 |  | IN UINTN | DataLength
 | ) |  |

Digests the input data and updates SHA-512 context.

This function performs SHA-512 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-512 context should be already correctly initialized by Sha512Init(), and should not be finalized by Sha512Final(). Behavior with invalid context is undefined.

If Sha512Context is NULL, then return FALSE.

Parameters
[in,out] | Sha512Context | Pointer to the SHA-512 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataSize | Size of Data buffer in bytes.
Return values
TRUE | SHA-512 data digest succeeded.
FALSE | SHA-512 data digest failed.

Performs SHA-512 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha512Context is NULL, then ASSERT().

Parameters
[in,out] | Sha512Context | Pointer to the SHA-512 context.
[in] | Data | Pointer to the buffer containing the data to be hashed.
[in] | DataLength | Length of Data buffer in bytes.
Return values
TRUE | SHA-512 data digest succeeded.
FALSE | Invalid SHA-512 context. After Sha512Final function has been called, the SHA-512 context cannot be reused.


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/PPI Directory Reference

  • Include
  • PPI
PPI Directory Reference

Files

file CryptoPPI.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/PPI/CryptoPPI.h File Reference

  • File List
  • Globals
  • Include
  • PPI
Data Structures | Macros | Typedefs | Functions | Variables
CryptoPPI.h File Reference
#include <Library/CryptLib.h>

Data Structures

struct | PEI_CRYPT_HANDLE
struct | _AMI_CRYPT_DIGITAL_SIGNATURE_PPI

Macros

#define AMI_DIGITAL_SIGNATURE_PPI_GUID { 0x86c29aa5, 0xdb0, 0x4343, 0xbd, 0x52, 0x7a, 0x72, 0x9f, 0x37, 0xc9, 0x6d }

Typedefs

typedef struct
_AMI_CRYPT_DIGITAL_SIGNATURE_PPI 		AMI_CRYPT_DIGITAL_SIGNATURE_PPI
typedef IN PEI_CRYPT_HANDLE * | PublicKey
typedef IN PEI_CRYPT_HANDLE IN
PEI_CRYPT_HANDLE * 		Hash
typedef IN PEI_CRYPT_HANDLE IN
PEI_CRYPT_HANDLE IN VOID * 		Signature
typedef IN PEI_CRYPT_HANDLE IN
PEI_CRYPT_HANDLE IN VOID IN
UINTN 		SignatureSize
typedef IN PEI_CRYPT_HANDLE IN
PEI_CRYPT_HANDLE IN VOID IN
UINTN IN UINT32 		Flags
typedef IN CONST UINT8 * | P7Data
typedef IN CONST UINT8 IN UINTN | P7Size
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 * 		TrustedCert
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN 		CertSize
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN
IN OUT UINT8 ** 		Data
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN
IN OUT UINT8 IN OUT UINTN * 		DataSize
typedef IN CONST EFI_GUID * | KeyAlgorithm
typedef EFI_STATUS(EFIAPI * | PEI_CRYPT_DS_HASH )(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This, IN CONST EFI_GUID *HashAlgorithm, IN UINTN num_elem, IN CONST UINT8 *addr[], IN CONST UINTN *len, OUT UINT8 *Hash)

Functions

typedef EFI_STATUS (EFIAPI *PEI_CRYPT_DS_VERIFY_SIG)(IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This

Variables

EFI_GUID gAmiDigitalSignaturePPIGuid

Detailed Description

CryptoPPI.h AMI Digital Signature PPI Protocol Definition


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol Directory Reference

  • Include
  • Protocol
Protocol Directory Reference

Files

file AmiDigitalSignature.h


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/Protocol/AmiDigitalSignature.h File Reference

  • File List
  • Globals
  • Include
  • Protocol
Data Structures | Macros | Typedefs | Enumerations | Functions
AmiDigitalSignature.h File Reference
#include <Library/CryptLib.h>
#include <Protocol/Hash.h>
#include <Guid/ImageAuthentication.h>

Data Structures

struct | CRYPT_HANDLE
struct | _AMI_DIGITAL_SIGNATURE_PROTOCOL
struct | _EFI_CERT_X509_SHA256
struct | _EFI_CERT_X509_SHA384
struct | _EFI_CERT_X509_SHA512

Macros

#define | AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID { 0x5f87ba17, 0x957d, 0x433d, 0x9e, 0x15, 0xc0, 0xe7, 0xc8, 0x79, 0x88, 0x99 }
#define | AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID { 0x91ABC830, 0x16FC, 0x4D9E, 0xA1, 0x89, 0x5F, 0xC8, 0xBB, 0x41, 0x14, 0x02 }
#define | EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID
#define | EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID
#define | EFI_CERT_X509_SHA256_GUID { 0x3bd2a492, 0x96c0, 0x4079, 0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed }
#define | EFI_CERT_X509_SHA384_GUID { 0x7076876e, 0x80c2, 0x4ee6, 0xaa, 0xd2, 0x28, 0xb3, 0x49, 0xa6, 0x86, 0x5b }
#define | EFI_CERT_X509_SHA512_GUID { 0x446dbf63, 0x2502, 0x4cda, 0xbc, 0xfa, 0x24, 0x65, 0xd2, 0xb0, 0xfe, 0x9d }

Typedefs

typedef struct
_AMI_DIGITAL_SIGNATURE_PROTOCOL 		AMI_DIGITAL_SIGNATURE_PROTOCOL
typedef IN CRYPT_HANDLE * | PublicKey
typedef IN CRYPT_HANDLE IN
CRYPT_HANDLE * 		Hash
typedef IN CRYPT_HANDLE IN
CRYPT_HANDLE IN VOID * 		Signature
typedef IN CRYPT_HANDLE IN
CRYPT_HANDLE IN VOID IN UINTN 		SignatureSize
typedef IN CRYPT_HANDLE IN
CRYPT_HANDLE IN VOID IN UINTN
IN UINT32 		Flags
typedef IN CONST UINT8 * | P7Data
typedef IN CONST UINT8 IN UINTN | P7Size
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 * 		TrustedCert
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN 		CertSize
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN
IN OUT UINT8 ** 		Data
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN
IN OUT UINT8 IN OUT UINTN * 		DataSize
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN
IN OUT UINT8 IN OUT UINTN IN
UINT8 		Operation
typedef IN CONST EFI_GUID * | HashAlgorithm
typedef IN CONST EFI_GUID IN UINTN | Num_elem
typedef IN CONST EFI_GUID IN
UINTN IN CONST UINT8 * 		Addr []
typedef IN CONST EFI_GUID IN
UINTN IN CONST UINT8 IN CONST
UINTN * 		Len
typedef OUT CRYPT_HANDLE * | Key
typedef OUT CRYPT_HANDLE IN
EFI_GUID * 		AlgId
typedef OUT CRYPT_HANDLE IN
EFI_GUID IN UINTN 		KeyLen
typedef struct
_EFI_CERT_X509_SHA256 		EFI_CERT_X509_SHA256
typedef struct
_EFI_CERT_X509_SHA384 		EFI_CERT_X509_SHA384
typedef struct
_EFI_CERT_X509_SHA512 		EFI_CERT_X509_SHA512

Enumerations

enum PKCS7_OP {
Pkcs7Arg0, Pkcs7CertValidate, Pkcs7GetSignerCert, Pkcs7GetCACert,
Pkcs7ValidateRootCert, x509ValidateCertChain, Pkcs7GetDigestAlgorithm, Pkcs7CertValidateGetCACert,
Pkcs7CertValidateGetSignerCert, Pkcs7CertValidateGetSignerKeyHash, Pkcs7CertValidateGetMatchInCertChain, Pkcs7CertValidateGetSignerKey,
Pkcs7CertGetMatchInCertChain, Pkcs7CertValidateGetCAKey, Pkcs7GetCAKey, Pkcs7GetSignerKey,
Pkcs7TimeStampCertValidateGet, Pkcs7GetChainedCertificates, Pkcs7GetUnChainedCertificates, x509GetSubjectsCommonNameStr
}
enum RESET_MMGR { RESET, LOCK, RELEASE, KEEP }

Functions

GUID_VARIABLE_DECLARATION (gAmiDigitalSignatureProtocolGuid, AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID)
GUID_VARIABLE_DECLARATION (gAmiSmmDigitalSignatureProtocolGuid, AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID)
typedef EFI_STATUS (EFIAPI *AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY)(IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This
GUID_VARIABLE_DECLARATION (gEfiHashAlgorithmSha1NoPadGuid, EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID)
GUID_VARIABLE_DECLARATION (gEfiHashAlgorithmSha256NoPadGuid, EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID)
GUID_VARIABLE_DECLARATION (gEfiCertX509Sha256Guid, EFI_CERT_X509_SHA256_GUID)
GUID_VARIABLE_DECLARATION (gEfiCertX509Sha384Guid, EFI_CERT_X509_SHA384_GUID)
GUID_VARIABLE_DECLARATION (gEfiCertX509Sha512Guid, EFI_CERT_X509_SHA512_GUID)

Detailed Description

AmiDigitalSignature.h AMI Digital Signature Protocol Definition

Macro Definition Documentation

#define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID
Value:
{ \
0x24c5dc2f, 0x53e2,0x40ca,{0x9e, 0xd6, 0xa5, 0xd9,0xa4, 0x9f, 0x46, 0x3b} \
}
#define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID
Value:
{ \
0x8628752a, 0x6cb7, 0x4814, {0x96, 0xfc, 0x24, 0xa8,0x15, 0xac, 0x22, 0x26} \
}

Typedef Documentation

typedef struct _AMI_DIGITAL_SIGNATURE_PROTOCOL AMI_DIGITAL_SIGNATURE_PROTOCOL

Hash Algorithm types


AptioV Cryptographic Library and EFI Protocols: E:/AptioV/IeiSugarBay_122115/AmiCryptoPkg/Include/AmiCertificate.h File Reference

  • File List
  • Globals
  • Include
Data Structures | Macros
AmiCertificate.h File Reference
#include <Efi.h>
#include <Guid/WinCertificate.h>
#include <Guid/ImageAuthentication.h>
#include <RomLayout.h>

Data Structures

struct | FW_KEY_HOB
struct | WIN_CERTIFICATE_UEFI_GUID_1
struct | AMI_CERTIFICATE_RSA2048_SHA256
struct | FW_CERTIFICATE
struct | APTIO_FW_CAPSULE_HEADER

Macros

#define | offsetof(st, m) ((UINTN) ( (char *)&((st *)0)->m - (char *)0 ))
#define | APTIO_FW_CAPSULE_GUID { 0x4A3CA68B, 0x7723, 0x48FB, 0x80, 0x3d, 0x57, 0x8c, 0xc1, 0xfe, 0xc4, 0x4d }
#define | PR_KEY_FFS_FILE_RAW_GUID { 0x3FEEC852, 0xF14C, 0x4E7F, 0x97, 0xFD, 0x4C, 0x3A, 0x8C, 0x5B, 0xBE, 0xCC }
#define | PR_KEY_FFS_FILE_SHA256_GUID { 0x05B85965C, 0x455D, 0x4CC6, 0x9C, 0x4C, 0x7F, 0x08, 0x69, 0x67, 0xD2, 0xB0 }
#define | PR_KEY_FFS_FILE_X509_GUID { 0x3A666558, 0x43E3, 0x4D25, 0x91, 0x69, 0xdb, 0x81, 0xf5, 0xdb, 0x42, 0xe1 }
#define | PR_KEY_GUID { 0x4E0F9BD4, 0xE338, 0x4B26, 0x84, 0x3E, 0xBD, 0x3A, 0xD9, 0xB2, 0x83, 0x7B }
#define | AMI_APTIO_SIG_OWNER_GUID { 0x26DC4851, 0x195F, 0x4AE1, 0x9A, 0x19, 0xFB, 0xF8, 0x83, 0xBB, 0xB3, 0x5E }
#define | CAPSULE_FLAGS_RSA_PSS_PADDING_SCHEME 0x00000001
#define | CAPSULE_FLAGS_CAPHDR_IN_SIGNCERT 0x00000002
#define | CAPSULE_FLAGS_SIGNKEY_IN_ROOTCERT 0x00000004
#define | CAPSULE_FLAGS_FWCERTBLOCK_VALID 0x00000008

Detailed Description

AmiCertificate.h AMI FW Certificate defines and data structures

Macro Definition Documentation

#define AMI_APTIO_SIG_OWNER_GUID { 0x26DC4851, 0x195F, 0x4AE1, 0x9A, 0x19, 0xFB, 0xF8, 0x83, 0xBB, 0xB3, 0x5E }

AMI APTIO 4 Signature Owner id. An identifier which identifies the agent which added the signature to the list.

#define APTIO_FW_CAPSULE_GUID { 0x4A3CA68B, 0x7723, 0x48FB, 0x80, 0x3d, 0x57, 0x8c, 0xc1, 0xfe, 0xc4, 0x4d }

Aptio FW Capsule with extended header fields. 4A3CA68B-7723-48FB-803D-578CC1FEC44D

#define PR_KEY_FFS_FILE_RAW_GUID { 0x3FEEC852, 0xF14C, 0x4E7F, 0x97, 0xFD, 0x4C, 0x3A, 0x8C, 0x5B, 0xBE, 0xCC }

3FEEC852-F14C-4E7F-97FD-4C3A8C5BBECC Key format: Raw 256 byte N-Modulus of RSA2048 Key

#define PR_KEY_FFS_FILE_SHA256_GUID { 0x05B85965C, 0x455D, 0x4CC6, 0x9C, 0x4C, 0x7F, 0x08, 0x69, 0x67, 0xD2, 0xB0 }

5B85965C-455D-4CC6-9C4C-7F086967D2B0 Key format: SHA256 hash of 256 byte N-Modulus of RSA2048 Key

#define PR_KEY_FFS_FILE_X509_GUID { 0x3A666558, 0x43E3, 0x4D25, 0x91, 0x69, 0xdb, 0x81, 0xf5, 0xdb, 0x42, 0xe1 }

3A666558-43E3-4D25-9169-DB81F5DB42E1 Key format: x509 ASN.1 DER containing RSA2048 Public Key

#define PR_KEY_GUID { 0x4E0F9BD4, 0xE338, 0x4B26, 0x84, 0x3E, 0xBD, 0x3A, 0xD9, 0xB2, 0x83, 0x7B }

APTIO Platform Fw Root Signing key identifier {4E0F9BD4-E338-4B26-843E-BD3AD9B2837B}


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • _
  • a
  • b
  • c
  • d
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • w
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- _ -

  • __os_time_t__ : CryptLib.h
  • _RSA_KEY_TAG : BaseCryptLib.h

- a -

  • AMI_APTIO_SIG_OWNER_GUID : AmiCertificate.h
  • AMI_DIGITAL_SIGNATURE_PROTOCOL : AmiDigitalSignature.h
  • APTIO_FW_CAPSULE_GUID : AmiCertificate.h
  • AuthenticodeVerify() : BaseCryptLib.c , BaseCryptLib.h

- b -

  • base64_decode() : CryptLib.h

- c -

  • crypto_import_asn1_public_key() : CryptLib.h
  • crypto_import_rsa2048_public_key() : CryptLib.h
  • crypto_rsa_exptmod() : CryptLib.h
  • CryptoGetFwKey() : CryptoDxe.c
  • CryptoGetRawImage() : CryptoPei.c
  • CryptoPei_Init() : CryptoPei.c

- d -

  • DEFAULT_RSA_KEY_MODULUS_LEN : CryptLib.h
  • DEFAULT_RSA_SIG_LEN : CryptLib.h
  • DxeGetKey() : CryptoDxe.c
  • DxeHash() : CryptoDxe.c
  • DxePkcs1Verify() : CryptoDxe.c
  • DxePkcs7Verify() : CryptoDxe.c
  • DxeVerifyKey() : CryptoDxe.c

- h -

  • HASH_ALG : CryptLib.h

- i -

  • InitCRmm() : CryptLib.h
  • InSmmFunction() : CryptoDxe.c

- m -

  • MD5_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • md5_vector() : CryptLib.h
  • Md5Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Md5Final() : BaseCryptLib.c , BaseCryptLib.h
  • Md5GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Md5Init() : BaseCryptLib.h , BaseCryptLib.c
  • Md5Update() : BaseCryptLib.h , BaseCryptLib.c

- n -

  • NotInSmmFunction() : CryptoDxe.c

- o -

  • os_mktime() : CryptLib.h

- p -

  • PeiGetKey() : CryptoPei.c
  • PeiHash() : CryptoPei.c
  • PeiPkcs7Verify() : CryptoPei.c
  • PeiVerifyKey() : CryptoPei.c
  • PeiVerifySig() : CryptoPei.c
  • Pkcs7_certificate_validate_digest() : CryptLib.h
  • Pkcs7_certificate_validate_timestamp_digest() : CryptLib.h
  • Pkcs7_parse_Authenticode_certificate() : CryptLib.h
  • Pkcs7_return_cerificate_ptr() : CryptLib.h
  • Pkcs7_return_digestAlgorithm() : CryptLib.h
  • Pkcs7_return_signing_cerificate() : CryptLib.h
  • Pkcs7_return_timestamp_signing_cerificate() : CryptLib.h
  • Pkcs7_x509_certificate_chain_validate() : CryptLib.h
  • Pkcs7_x509_certificate_chain_validate_with_timestamp() : CryptLib.h
  • Pkcs7_x509_get_certificates_List() : CryptLib.h
  • Pkcs7_x509_return_Cert_pubKey() : CryptLib.h
  • Pkcs7_x509_return_signing_Key() : CryptLib.h
  • Pkcs7_x509_return_SubjectNameStr() : CryptLib.h
  • Pkcs7Verify() : BaseCryptLib.c , BaseCryptLib.h
  • pkcs_1_pss_decode() : CryptLib.h
  • pkcs_1_v1_5_decode() : CryptLib.h
  • PR_KEY_FFS_FILE_RAW_GUID : AmiCertificate.h
  • PR_KEY_FFS_FILE_SHA256_GUID : AmiCertificate.h
  • PR_KEY_FFS_FILE_X509_GUID : AmiCertificate.h
  • PR_KEY_GUID : AmiCertificate.h

- r -

  • ResetCRmm() : CryptLib.h
  • RSA_KEY_TAG : BaseCryptLib.h
  • RsaFree() : BaseCryptLib.h , BaseCryptLib.c
  • RsaKeyD : BaseCryptLib.h
  • RsaKeyDp : BaseCryptLib.h
  • RsaKeyDq : BaseCryptLib.h
  • RsaKeyE : BaseCryptLib.h
  • RsaKeyN : BaseCryptLib.h
  • RsaKeyP : BaseCryptLib.h
  • RsaKeyQ : BaseCryptLib.h
  • RsaKeyQInv : BaseCryptLib.h
  • RsaNew() : BaseCryptLib.c , BaseCryptLib.h
  • RsaPkcs1Verify() : BaseCryptLib.c , BaseCryptLib.h
  • RsaSetKey() : BaseCryptLib.c , BaseCryptLib.h
  • RuntimeCryptLibConstructor() : CryptLib.h

- s -

  • set_crypt_efitime() : CryptLib.h
  • SHA1_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • sha1_vector() : CryptLib.h
  • Sha1Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Sha1Final() : BaseCryptLib.h , BaseCryptLib.c
  • Sha1GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha1Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha1Update() : BaseCryptLib.c , BaseCryptLib.h
  • SHA256_DIGEST_SIZE : CryptLib.h , BaseCryptLib.h
  • sha256_done() : BaseCryptLib.c
  • sha256_process() : BaseCryptLib.c
  • sha256_vector() : CryptLib.h
  • Sha256Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Final() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Update() : BaseCryptLib.c , BaseCryptLib.h
  • SHA384_DIGEST_SIZE : CryptLib.h , BaseCryptLib.h
  • sha384_vector() : CryptLib.h
  • Sha384Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Final() : BaseCryptLib.h , BaseCryptLib.c
  • Sha384GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Update() : BaseCryptLib.h , BaseCryptLib.c
  • SHA512_DIGEST_SIZE : CryptLib.h , BaseCryptLib.h
  • sha512_vector() : CryptLib.h
  • Sha512Duplicate() : BaseCryptLib.h , BaseCryptLib.c
  • Sha512Final() : BaseCryptLib.c , BaseCryptLib.h
  • Sha512GetContextSize() : BaseCryptLib.h , BaseCryptLib.c
  • Sha512Init() : BaseCryptLib.h , BaseCryptLib.c
  • Sha512Update() : BaseCryptLib.h , BaseCryptLib.c

- w -

  • wpa_set_trace_level() : CryptLib.h

- x -

  • x509_certificate_chain_validate() : CryptLib.h
  • x509_certificate_parse() : CryptLib.h


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • w
  • x

- a -

  • AuthenticodeVerify() : BaseCryptLib.c , BaseCryptLib.h

- b -

  • base64_decode() : CryptLib.h

- c -

  • crypto_import_asn1_public_key() : CryptLib.h
  • crypto_import_rsa2048_public_key() : CryptLib.h
  • crypto_rsa_exptmod() : CryptLib.h
  • CryptoGetFwKey() : CryptoDxe.c
  • CryptoGetRawImage() : CryptoPei.c
  • CryptoPei_Init() : CryptoPei.c

- d -

  • DxeGetKey() : CryptoDxe.c
  • DxeHash() : CryptoDxe.c
  • DxePkcs1Verify() : CryptoDxe.c
  • DxePkcs7Verify() : CryptoDxe.c
  • DxeVerifyKey() : CryptoDxe.c

- i -

  • InitCRmm() : CryptLib.h
  • InSmmFunction() : CryptoDxe.c

- m -

  • md5_vector() : CryptLib.h
  • Md5Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Md5Final() : BaseCryptLib.c , BaseCryptLib.h
  • Md5GetContextSize() : BaseCryptLib.h , BaseCryptLib.c
  • Md5Init() : BaseCryptLib.h , BaseCryptLib.c
  • Md5Update() : BaseCryptLib.c , BaseCryptLib.h

- n -

  • NotInSmmFunction() : CryptoDxe.c

- o -

  • os_mktime() : CryptLib.h

- p -

  • PeiGetKey() : CryptoPei.c
  • PeiHash() : CryptoPei.c
  • PeiPkcs7Verify() : CryptoPei.c
  • PeiVerifyKey() : CryptoPei.c
  • PeiVerifySig() : CryptoPei.c
  • Pkcs7_certificate_validate_digest() : CryptLib.h
  • Pkcs7_certificate_validate_timestamp_digest() : CryptLib.h
  • Pkcs7_parse_Authenticode_certificate() : CryptLib.h
  • Pkcs7_return_cerificate_ptr() : CryptLib.h
  • Pkcs7_return_digestAlgorithm() : CryptLib.h
  • Pkcs7_return_signing_cerificate() : CryptLib.h
  • Pkcs7_return_timestamp_signing_cerificate() : CryptLib.h
  • Pkcs7_x509_certificate_chain_validate() : CryptLib.h
  • Pkcs7_x509_certificate_chain_validate_with_timestamp() : CryptLib.h
  • Pkcs7_x509_get_certificates_List() : CryptLib.h
  • Pkcs7_x509_return_Cert_pubKey() : CryptLib.h
  • Pkcs7_x509_return_signing_Key() : CryptLib.h
  • Pkcs7_x509_return_SubjectNameStr() : CryptLib.h
  • Pkcs7Verify() : BaseCryptLib.c , BaseCryptLib.h
  • pkcs_1_pss_decode() : CryptLib.h
  • pkcs_1_v1_5_decode() : CryptLib.h

- r -

  • ResetCRmm() : CryptLib.h
  • RsaFree() : BaseCryptLib.c , BaseCryptLib.h
  • RsaNew() : BaseCryptLib.c , BaseCryptLib.h
  • RsaPkcs1Verify() : BaseCryptLib.h , BaseCryptLib.c
  • RsaSetKey() : BaseCryptLib.c , BaseCryptLib.h
  • RuntimeCryptLibConstructor() : CryptLib.h

- s -

  • set_crypt_efitime() : CryptLib.h
  • sha1_vector() : CryptLib.h
  • Sha1Duplicate() : BaseCryptLib.h , BaseCryptLib.c
  • Sha1Final() : BaseCryptLib.c , BaseCryptLib.h
  • Sha1GetContextSize() : BaseCryptLib.h , BaseCryptLib.c
  • Sha1Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha1Update() : BaseCryptLib.c , BaseCryptLib.h
  • sha256_done() : BaseCryptLib.c
  • sha256_process() : BaseCryptLib.c
  • sha256_vector() : CryptLib.h
  • Sha256Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Final() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha256Update() : BaseCryptLib.c , BaseCryptLib.h
  • sha384_vector() : CryptLib.h
  • Sha384Duplicate() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Final() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha384Update() : BaseCryptLib.h , BaseCryptLib.c
  • sha512_vector() : CryptLib.h
  • Sha512Duplicate() : BaseCryptLib.h , BaseCryptLib.c
  • Sha512Final() : BaseCryptLib.h , BaseCryptLib.c
  • Sha512GetContextSize() : BaseCryptLib.c , BaseCryptLib.h
  • Sha512Init() : BaseCryptLib.c , BaseCryptLib.h
  • Sha512Update() : BaseCryptLib.h , BaseCryptLib.c

- w -

  • wpa_set_trace_level() : CryptLib.h

- x -

  • x509_certificate_chain_validate() : CryptLib.h
  • x509_certificate_parse() : CryptLib.h


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • AMI_DIGITAL_SIGNATURE_PROTOCOL : AmiDigitalSignature.h
  • RSA_KEY_TAG : BaseCryptLib.h


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • _RSA_KEY_TAG : BaseCryptLib.h
  • HASH_ALG : CryptLib.h


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • RsaKeyD : BaseCryptLib.h
  • RsaKeyDp : BaseCryptLib.h
  • RsaKeyDq : BaseCryptLib.h
  • RsaKeyE : BaseCryptLib.h
  • RsaKeyN : BaseCryptLib.h
  • RsaKeyP : BaseCryptLib.h
  • RsaKeyQ : BaseCryptLib.h
  • RsaKeyQInv : BaseCryptLib.h


AptioV Cryptographic Library and EFI Protocols: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • __os_time_t__ : CryptLib.h
  • AMI_APTIO_SIG_OWNER_GUID : AmiCertificate.h
  • APTIO_FW_CAPSULE_GUID : AmiCertificate.h
  • DEFAULT_RSA_KEY_MODULUS_LEN : CryptLib.h
  • DEFAULT_RSA_SIG_LEN : CryptLib.h
  • MD5_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • PR_KEY_FFS_FILE_RAW_GUID : AmiCertificate.h
  • PR_KEY_FFS_FILE_SHA256_GUID : AmiCertificate.h
  • PR_KEY_FFS_FILE_X509_GUID : AmiCertificate.h
  • PR_KEY_GUID : AmiCertificate.h
  • SHA1_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • SHA256_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • SHA384_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h
  • SHA512_DIGEST_SIZE : BaseCryptLib.h , CryptLib.h


Copyright

WPA Supplicant Crypto Library

Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi> and contributors

All Rights Reserved.

License

-------

This software may be distributed, used, and modified under the terms of BSD license:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the redistribution.

3. Neither the name(s) of the above-listed copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT

OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT

LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY

THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


General Information

APTIO V. AMI Cryptographic Package Porting guide

Porting Information : Aptio_5.x_Crypto_Package_Porting_Guide_NDA.docx

AMI Crypto utilities : Ami_Aptio_CryptoCon_utility_guide_NDA.docx; Ami_Aptio_KeyGen_utility_guide.docx


AptioV Cryptographic Library and EFI Protocols: Main Page

AptioV Cryptographic Library and EFI Protocols Documentation

Release Notes
Additional Documents

Copyright AMI
Copyright WPA Supplicant crypto library


Release Notes - NDA Required

Information:

THIS MODULE INCLUDES 3rd PARTY OPEN SOURCE LIBRARY.

Component Name: Aptio Cryptographic library

Component Type: PEI, DXE BS, DXE RT driver

AMI BIOS Core: Aptio V.x

Project EIP#14844

Location on SourceSafe: SVN: AptioV;$/AptioV/Sources/Interfaces/AmyCryptoPkg

Label: AmiCryptoPkg_026.1

Date: 05-27-2016

Component Description:

1. AptioV Crypto library provides basic Crypto operations: RSA2048, MD5, Sha-1, Sha256, -384, -512, x.509, PKCS#7, PKCS#1, DER(PEM) ASN.1

2. AptioV PPI and UEFI Crypto Protocol for basic crypto operations: RSA, Hash, Pkcs#1, x.509, Pkcs#7

This Crypto library uses 3-rd party Open Source library code. Please refer to the “3rd Party Code…” section below.

AMI Build Tools:

Tools Label: BuildTools_28

Visual eBios: RSS.7.17.0302

New features added in this label:

AmiCryptoPkg.sdl :

Set AMI_CRYPTOPACKAGE_MODULE_REVISION = 26

CryptoDxe.c; CryptoDXE.inf, Crypto.SMM.inf

EIP#261980:

Use MemoryAllocationLib functions to allocate buffers inside Dxe and Smm driver instances

Add new functions to Pkcs7Verify: Return chained and un-chained certificate lists and ascii string of a signer's subject name

Pkcs7.c; Pkcs7.h; x509v3.c;x509v3.h; Protocol\AmiDigitalSignature.h; Library\CryptLib.h

Implement library functions to report chained certificate lists and return Ascii name of a Signer's certificate

AmiCryptLib.inf; PeiCryptLib.inf; RuntimeAmiCryptLib.inf;

Update [BuildOptions] sections. Replaced restricted "MYTOOLS" tool chain with broader target for a “MSFT:*” and “GCC:*” tools family chain.

CryptoProtocols.sdl, CryptoPEI.c

EIP#263325: Enhance search for FwKey file in BootBlock FV by scanning through FVs with a specific Guid(FV_BB)

Define new SDL Token: FWKEY_FV_HEADER_GUID to provide the GUID of the FV where the FwKey ffs is defined. The default location of FwKey file is in the Boot Block FV.

The value must match the 'GUID' field in FD_AREA:FV_BB SDL object. Users may change the Guid based on the need to store FwKey in a different secure FV.

CryptoCon v5.04.07.2016

Update getopt input parameter parsing. Reported parser issues under Windows 8 & 10

Update Windows and Linux versions to display Hash ranges within FwCap Hdr (ranges begin with 0xF00...)

Fixed bug in processing attached header command line (no -y)

Removed explicit “—PE hash” command. Tool automatically calculates the hash over PE/COFF images

EIP#263325: Fix CryptoCon utility to account for a bug in AptioV Linux GCC build tools that add 0xd0 bytes to all cbin binary built files.

General Bug Fixes:

CryptoDXE.c, CryptoPei.c

EIP#253664: Absent "EFIAPI" qualifier for UEFI specification-defined functions.

AmiCryptLib.inf; PeiCryptLib.inf; RuntimeAmiCryptLib.inf

EIP#257518: Add build targets for IA32 mode compilation under Linux GCC

CryptoDxe.c, CryptoPei.c:

EIP#268605: VerifyKey()->Type convert UINT32 Key->BlobSize var to a size_t KeyLen when passing the value as an argument to sha256_vector().The fix is critical for AARCH64 projects that build PEI in 64bit mode.

(label 26:CRYPT_HANDLE->UINTN BlobSize. Change type from UINT32 to UINTN.)

EIP addressed in this label:

EIP#261980: UEFI 2.5. Customized Deployment of Secure Boot

EIP#257518: Assure AmiCryptoPkg compatibility with Linux GCC on x86 and AARCH64 architectures Add build targets for IA32 mode compilation under Linux GCC

EIP#263325: Add SecureFlash module to ThunderX. [Issue] Recovery fails on GCC generated BIOS (ARM)

EIP#253664: Test Skylake project for Linux(GCC) build.

EIP#268605: Cavium(AARCH64). Flash recovery hanging in release mode.

Validation Testing:

Known issues and limitations in this label:

-AmiCryptoPkg labeled 26 and above may cause build errors with SecSmiFlash.c( line xxx): warning C4244: '=' : conversion from 'UINTN' to 'UINT32', possible loss of data.

In order to resolve the build error have Secure Flash eModule upgraded to label 14 or make a small fix inside SecSmiFlash .c->GetFlUpdPolicy (): define local “KeySize” variable as UINTN.

-Common notes for PeiCryptLib, AmiCryptLib and BaseCryptLib libraries:

Should a library consumer need to use the library key management and encryption functions (RSA, PKCS#7, X.509) the library constructor AmiCryptLibConstructor() will automatically allocate the memory heap for internal memory manager and install virtual address change callback event. In runtime instance of AmiCryptLib, the RuntimeAmiCryptLibConstructor() will install a callback on virtual address change event to re-allocate the pointer to a memory heap.

For Pei instance of the library, the caller must allocate the heap of the size not less than 48kb and invoke the library function InitCRmm((void*)HeapAddress, Size);

-BaseIntrinsicLib library no longer published by AmiCryptoPkg.

-Linux version of CryptoCon. Set “executable” permission for the file. Use chmod command "chmod +x CryptoCon" to set permission before launching the tool.

3rd Party Code Present in Component:

Aptio Crypto Library based on Open Source crypto library (wpa_supplicant).

This Crypto library module is based on Open standard Crypto library – wpa_supplicant and is built to function under UEFI environment.

This program is licensed under the BSD license.

Current supported wpa_supplicant source version for UEFI Crypto Library is wpa_supplicant-0.6.10

http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz

WPA stands for Wi-Fi Protected Access, a wireless encryption standard.

Wpa_supplicant is a well-known open source implementation of WPA and WPA2 (IEEE 802.11i / RSN).

It is suitable for both desktop/laptop computers and embedded systems.

The core library provides basic TLS/crypto implementation for:

-X.509 certificate processing

-PKCS #1

-ASN.1

-RSA

-bignum

(See http://hostap.epitest.fi/wpa_supplicant/ for more information for wpa_supplicant).

================================================================================

Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors

All Rights Reserved.

=============

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name(s) of the above-listed copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Release History:

5_004.CryptoPkg_025 … 5_004.CryptoPkg_009

© American Megatrends Inc.


Release Notes - NDA Required

Information:

THIS MODULE INCLUDES 3rd PARTY OPEN SOURCE LIBRARY.

Component Name: Aptio Cryptographic library

Component Type: PEI, DXE BS, DXE RT driver

AMI BIOS Core: Aptio V.x

Location on SourceSafe: SVN: AptioV;$/AptioV/Sources/Interfaces/AmyCryptoPkg/CryptoLib

Label: 5_004.CryptoPkg_020

Date: 2014-08-05

Component Description:

1. AptioV Crypto library provides basic Crypto operations: RSA, MD5, Sha256, Sha1, x.509, PKCS#7, PKCS#1, DER(PEM) ASN.1

2. AptioV PPI and UEFI Crypto Protocol for basic crypto operations: RSA, Hash, Pkcs#1, x.509, Pkcs#7

This Crypto library uses 3-rd party Open Source library code. Please refer to the “3rd Party Code…” section below.

AMI Build Tools:

Tools Label: 5.004_BuildTools_08

Visual eBios: RSS.7.15.0180

New features added in this label:

Update function descriptions and type definitions to be compatible with Doxygen Help Builder

AmiCryptoPkg.sdl

Set AMI_CRYPTOPACKAGE_MODULE_REVISION = 20

License.txt , bignum.c ,bignum.h, asn1.c, asn1.h, rsa.c, rsa.h, md5.h,md5.c, sha1.h, sha1.c, sha256.c, sha256.h, x509v3.c, x509v3.h,wpa_debug.h, os.h, libtommath.h, build_config.h, common.h

Update all OpenSource files with license headers to match latest release library (wpa_supplicant ver 2.0).New source conforms only to BSD license, dropping optional Open GL

BaseCryptLib

Create DXE instance of AmiCryptoPkg.BaseCryptLib library as a copy of AmiCryptoLib

Create PEI instance of AmiCryptoPkg.BaseCryptLib library as a copy of PeiCryptoLib

Add new AmiCryptoPkg.IntrinsicLib library instance (EDKII style) to be linked with Ami’s BaseCryptLib.

AmiCryptoPkg.BaseCryptLib library is a light version of EDKII BaseCryptLib provided by “CryptoPkg”. Curent version provides:

  -Hashing algorithms SHA1, SHA256, MD5,

  - RSA encryption

  - Pkcs1Verify and Pkcs7Verify

CryptoLib.sdl

Add new switch SHA256_FAST: Generates a faster Sha256 hash. Adds ~4k to CryptoLib binary

CrypyLib.h, BaseCryptLib.h

Move the files under "AmiCryptoPkg/Include/Library" and update path to library headers inside AmiCryptoPkg.dec

CryptoPei.c

VerifyKey() add more key combinations FWkey vs. pubkey

PeiPkcs7Verify() support FWkey as x509 tbs hash

Sha256.c

Made optimizations in Sha256 hash code to improve speed at a cost of increased lib code by ~4kb; Set SHA256_FAST to enable this feature

Cryptocon.exe

v4.7.31.2014

Bug fix: Set the valid ‘address’ field while creating new entry in RomMap section inside of FwCapHdr ffs

Bug fix: Include the RomMap section from FwCapHdr ffs to be reported as Signed - prevents tampering with rom holes flash regions which are not checked during runtime re-flash

v4.7.25.2014

Bug fix related to handling of CAPSULE_FLAGS_FWCERTBLOCK_INVALID flag. Flag is cleared only if Capsule signing is in progress.

v4.6.30.2014

- New function: generate a digest of a file based on a rom map.

  Supported by a combination -h(1,2) -r rom_map -f

  Add -t option for filtering of rom blocks used for TCG measurement only. Use a combination

   -t -r rom_map -h -f file to create a file digest based on rom_map, use

   -t -b -h2 to generate BER encoded hash, otherwise - bin hash output

v4.5.01.2014

-add more error checking for CapHdr size overlap,

-always put a RomMap at the end of the FwCapHdr buffer.

-clear remained of RomMap when applying signature for a previously mapped (signed) file

-Fix FwCap image alignment logic - only FwCap hdr is aligned to -l value.  Old one worked only if input files were aligned to -l value

-Add more bounds check while copying .p7 cert into FwCap Hdr

v4.2.24.2014:

-New command -m(map) to set internal FwCapHdr flags according to the input command line parameters and set new RomLayout map. Command won’t create signed capsule.

-For Pkcs#1 signed capsules RomMap location is set to be compatible with older labels of SecFlash module (_010.._014).

-Build Pkcs#7 signed FwCapsule. Fix command line to match newer versions of Msft signtool.exe while creating a .p7 sig file. Requires new versions of signtool supporting new

  “/p7” and “/p7ce detachedsigneddata” options.

-Support new command option “-h2 –x[x509]” to produce a SHA256 hash of a “to-be-signed” section of the x509 certificate’s contents.

  Hash may be used to replace a full x509 Key certificate in a Root Key certificate file (FwKey ffs) or to produce time stamped revocation certificates for “dbx”.

General Bug Fixes:

PeiCryptLib.inf, BaseCryptLib.inf,IA32math.c, common.h,build_config.h,wpa_debug.c,AmiCryptLib.inf, CryptoLib.sdl,CryptoPPI.inf,CryptoPei.c,CryptoDxe.c,CryptoProtocols.sdl,CryptoSMM.inf,build_config.h

  EIP#164812: Multiple changes in .inf adding new target AARCH64 and source files. GCC compiler warning removal: fixed argument typecasting to match header definitions. Defined “size_t” type as “UINTN” for any CPU architectures

CryptoDxe.c

 Pkcs7Verify() – do not use generic “DataSize” to return a status from Pkcs7_x509_certificate_chain_validate_with_timestamp()

Pkcs7.c

  Pkcs7_x509_certificate_chain_validate_with_timestamp(): Add CONFIG_IGNORE_X509_CERTIFICATE_EXPIRATION. Flag controlled by an SDL token; revoke branch executed for chained certs only, before - any certs in the cert store.

  x509 cert compare is done for “to-be-signed” section only

EIP addressed in this label:

EIP#164812: [ARM] Aarch64 secure boot function test. Multiple changes in .inf adding new target AARCH64 and source files.

Files changed for EIP fixes:

Known issues and limitations in this label:

Common rules for linking PeiCryptLib, AmiCryptLib and BaseCryptLib libraries:

The source that links Ami Crypto libraries must also link the pointers to global boot and runtime Efi services.

For a PEI module: EFI_PEI_SERVICES  **ppPS

For a DXE module or runtime/shell application: EFI_BOOT_SERVICES *pBS and EFI_RUNTIME_SERVICES *pRS

Also, if library consumer intends to use library key management and encryption functions (RSA, PKCS#7, X.509) it needs to invoke RuntimeCryptLibConstructor() function before calling those functions. The constructor call will allocate the memory heap for internal memory manager. For Pei instance of the library, the caller must allocate the heap of the size not less than 48kb and invoke the library function InitCRmm((void*)HeapAddress, Size);

3rd Party Code Present in Component:

Aptio Crypto Library is based on Open Source crypto library (wpa_supplicant).

This Crypto library module is based on Open standard Crypto library – wpa_supplicant and is built to function under UEFI environment.

This program is licensed under the BSD license.

Current supported wpa_supplicant source version for UEFI Crypto Library is wpa_supplicant-0.6.10

http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz

WPA stands for Wi-Fi Protected Access, a wireless encryption standard.

Wpa_supplicant is a well-known open source implementation of WPA and WPA2 (IEEE 802.11i / RSN).

It is suitable for both desktop/laptop computers and embedded systems.

The core library provides basic TLS/crypto implementation for:

-X.509 certificate processing

-PKCS #1

-ASN.1

-RSA

-bignum

(See http://hostap.epitest.fi/wpa_supplicant/ for more information for wpa_supplicant).

================================================================================

Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors

All Rights Reserved.

=============

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name(s) of the above-listed copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Release History:

5_004.CryptoPkg_019

EIP#135248: AptioV modules GCC linux build process and ARM compatibility issues. Build fails if ‘-nostdinc’ option is set in of CC_COMMON_FLAGS

Pkcs7.c ; X509v3.c ; Pkcs1_sigDecode.c: Fix for Bleichenbacher's Pkcs#1v1.5 RSA signature vulnerability: Hash field must be aligned to right of the decoded sig. An obscure condition possible for key Exponent = 3

Pkcs7.c : Pkcs7_x509_certificate_chain_validate_with_timestamp() Fixed a bug with falsely identify match for leaf certificates if only Issuer names were a match.

Common.h: EIP#135248: In linux build following file includes are missing: endian.h and byteswap.h. Fix: removed unused include statements

Cryptocon.exe v4.12.19.2013: A dd new command –m(map) to set internal CapHdr flags according to the input command line parameters and insert RomLayout map from a file “–r map”. Command won’t create signed capsule

5_004.CryptoPkg_018

EIP#143179: Linux GCC build issue. CryptoUtils.sdl :Replaced forward slash with a macro $(PATH_SLASH);

Add porting guides on “general Information” page

5_004.CryptoPkg_017

EIP#135248: AptioV modules linux build process and ARM compatibility issues. Change backward slash on forward slash in include file path; add ARM build rules to .inf;

Pkcs7_x509_certificate_chain_validate(): only for leaf certificate match: do full certificate match and not just its public key portion. UEFI SCT may fail since one of the tests uses a corrupted certificate.

5_004.CryptoPkg_016

EIP#139208: build FwCapsule with Pkcs7 sig fails. Fix Cryptocon.exe to provide proper input line for generation of detached signatures

CryptoCon.exe: V4.10.15. Build Pkcs#7 signed FwCapsule. Fix command line to match newer versions of Msft signtool.exe while creating a .p7 sig file. New versions of signtool require a key “/p7ce detachedsigneddata”

Use new format -x 'key.pfx','pswd' to provide a .pfx key package password to unlock the key

5_004.CryptoPkg_015

EIP#135972: BIOS flash fails while updating from Sec Flash label _06 to _07

CryptoCon.exe (v4.10.03) Old VerifyFwCapsule() logic assumed extended Capsule flags to be set. New label _07 had the –q flag missing in a command line.

Update CryptoCon.exe with ‘-q’ switch only setting the flag for the inclusion of Capsule Hdr fields into a Signature computation. Root cert flags are not set

EIP#135248: AptioV modules linux build process and ARM compatibility issues

EIP#138512; 136764; 137431; 135555 and 134210: Pkcs7.c:

             1. SCT issue reported due to improper parameter check public_key==NIULL ptr vs *public_key==NULL inside Pkcs7_x509_return_cert_pubKey()

             2. Can't launch some OEM signed Efi utilities: Checking a value of uninitialized field SignedData->tstInfo->authAttr.auth_attrib_start inside Pkcs7_certificate_validate_digest()

5_004.CryptoPkg_014

EIP#118850: Implement support for UEFI2.4 ECR 1009: Certificate Revocation Storage reduction and Timestamp Support.

CryptoPei.c: Improve FwKey handling. CryptoPEI pass FwKey location to Dxe via Hob; Add dependency on CONFIG_PEI_PKCS7. Decreases code size by ~8kb if Pkcs7 PEI support if off

CryptoDxe.c :Pkcs7Verify() – add TimeStamp signature processing(UEFI ECR1009)New PKCS7_MUTEX_LOCK: Turn on mutex functionality for Pkcs7Verify back to back operations. Preserves internal context until mutex released/reset

InSmmFunction() Make sure AmiSig protocol is installed on unique handles in pBS( legacy) and pSmst

Improve FwKey handling. Add more parameter checking including check for FwKey location to be mapped to Flash FV_BB(suppressed in this revision). CryptoSMM to use a pointer to a physical Key location in Flash instead off keeping a copy in SMRAM

5_004.CryptoPkg_013

EIP123383: Static code analysis errors in AmiCryptoPkg. Removed redundant check if ppFile is not NULL

EIP123092: Install gAmiSmmDigitalSignatureProtocol on pSMST handle. Also install the Protocol on pBS for backward compatibility

CryptoLib.sdl: Add Token: CONFIG_PEI_PKCS7 to Support x509 & Pkcs7 in PEI CryptoLib. Add to CryptoPEI binary size ~8kb

CryptoPei.c; Pkcs7.c; x509.c: Add dependency on CONFIG_PEI_PKCS7. Decrease code size if Pkcs7 support if off

CryptoDxe.c;CryptoDxe.inf; CryptoSMM.inf: Add Guid references: gEfiHashAlgorithmSha1NoPadGuid and gEfiHashAlgorithmSha256NoPadGuid

AmiCryptoPkg.dec: Back up Guid defines: gEfiHashAlgorithmSha1NoPadGuid and gEfiHashAlgorithmSha256NoPadGuid. Defined in MdePkg.dec in Aptio Core _07

CryptoCon.exe (v4.05.19)

-add -c2 -r to embed RomMap from a map file to FwCapsule Ffs inside input file

-add -r2 to search for embedded RomMap inside FwCapsule Ffs

-add -n -k [Key] to write public key of [Key] to KeyFfs inside generated cap file

5_004.CryptoPkg_012

EIP#116824 ECR 1009: Certificate Revocation Storage reduction and Timestamp Support. Added parsing of SignerInfos.Timestamp data fields

EIP#117154: S3 resume hangs in CryptoPei.c. Uncompressed module runs from ROM on S3 and ppPS global variable doesn’t get updated. Call to Pei services by ppPS pointer cause the hang. Fix: Need to update to AptioV core build6 or use fixed CryptoPEI.c

Pkcs7.c: ECR 1009: Certificate Revocation Storage reduction and Timestamp Support. Added parsing of SignerInfos.Timestamp data fields

CryptoLib: Exposed MD5 hashing algorithm Make call to md5_vector(size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac);

5_004.CryptoPkg_011

CryptoCon.exe: v4.02.20.2013: add -2 for silent operation

CryptoDxe.c GetKey(): fix MemCpy() 2nd argument. Was copying an address of key buffer and not the buffer itself

Pkcs7.c: Pkcs7_x509_certificate_chain_validate(): Only verify public key match for leaf certificate tests. Other parameters like timestamp, CA basic constrain fields are ignored anyway

X509.c: x509_certificate_parse() : Extract true cert size from its ASN1 header; Don't allocate new buffer for the signature block- update cert->sign_value pointer with the address within x509 Cert blob

5_001.CryptoPkg _010

AmiCryptLib.inf, PeiCryptLib.inf: Optimized Crypto library BuildOptions

CryptoPei.c Minor code fixes to meet code style & performance suggestions after running “cppcheck" utility.

CryptoGetRawImage: Look for FwKey ffs only in FV_BB. It must be 1st FV in the list.

EIP#110823: The system cannot boot to UEFI(WIN8) OS if the Secure Flash Pkg module is not supported

CryptoDxe.c Update GetKey(); InSmmFunction() and NotInSmmFunction() routines to handle cases if Fw Key file not present, e.g. no SecureFlash eModule. Old logic would not install Crypto API if no FW Key file was found.

5_001.CryptoPkg _009

.inf: Optimized Crypto library Build Options

CryptoProtocols.sdl: Add FFS_FILE SDL Object with command override to build CryptoPPI as compressed PEIM. Only available from Aptio Core label 007

© American Megatrends Inc.


Release Notes - NDA Required

Information:

THIS MODULE INCLUDES 3rd PARTY OPEN SOURCE LIBRARY.

Component Name: Aptio Cryptographic library

Component Type: PEI, DXE BS, DXE RT driver

AMI BIOS Core: Aptio V.x

Location on SourceSafe: SVN: AptioV;$/AptioV/Sources/Interfaces/AmyCryptoPkg/CryptoLib

Label: AmiCryptoPkg_023

Date: 2015-04-20

Component Description:

1. AptioV Crypto library provides basic Crypto operations: RSA, MD5, Sha256, Sha1, x.509, PKCS#7, PKCS#1, DER(PEM) ASN.1

2. AptioV PPI and UEFI Crypto Protocol for basic crypto operations: RSA, Hash, Pkcs#1, x.509, Pkcs#7

This Crypto library uses 3-rd party Open Source library code. Please refer to the “3rd Party Code…” section below.

AMI Build Tools:

Tools Label: 5.004_BuildTools_08

Visual eBios: RSS.7.15.0180

New features added in this label:

AmiCryptoPkg.sdl : Set AMI_CRYPTOPACKAGE_MODULE_REVISION = 23

General Bug Fixes:

BaseCryptLib.h;.c : Replaced the call to undefined "sha384_process()" with "sha512_process()"; Expose SHA384 and SHA512 functions in PEI copy of BaseCryptLib

EIP addressed in this label:

Validation Testing:

EIP Project ID OJPSU: Module submission for BQA validation. Validation completed for label AmiCryptoPkg_22. Test results are available at a project link.

Known issues and limitations in this label:

Common rules for linking PeiCryptLib, AmiCryptLib and BaseCryptLib libraries:

The source that links Ami Crypto libraries must also link the pointers to global boot and runtime Efi services.

For a PEI module: EFI_PEI_SERVICES  **ppPS

For a DXE module or runtime/shell application: EFI_BOOT_SERVICES *pBS and EFI_RUNTIME_SERVICES *pRS

Also, if library consumer intends to use library key management and encryption functions (RSA, PKCS#7, X.509) it needs to invoke RuntimeCryptLibConstructor() function before calling those functions. The constructor call will allocate the memory heap for internal memory manager. For Pei instance of the library, the caller must allocate the heap of the size not less than 48kb and invoke the library function InitCRmm((void*)HeapAddress, Size);

3rd Party Code Present in Component:

Aptio Crypto Library is based on Open Source crypto library (wpa_supplicant).

This Crypto library module is based on Open standard Crypto library – wpa_supplicant and is built to function under UEFI environment.

This program is licensed under the BSD license.

Current supported wpa_supplicant source version for UEFI Crypto Library is wpa_supplicant-0.6.10

http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz

WPA stands for Wi-Fi Protected Access, a wireless encryption standard.

Wpa_supplicant is a well-known open source implementation of WPA and WPA2 (IEEE 802.11i / RSN).

It is suitable for both desktop/laptop computers and embedded systems.

The core library provides basic TLS/crypto implementation for:

-X.509 certificate processing

-PKCS #1

-ASN.1

-RSA

-bignum

(See http://hostap.epitest.fi/wpa_supplicant/ for more information for wpa_supplicant).

================================================================================

Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors

All Rights Reserved.

=============

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name(s) of the above-listed copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Release History:

5_004.CryptoPkg_022 … 5_004.CryptoPkg_009

© American Megatrends Inc.


Release Notes - NDA Required

Information:

THIS MODULE INCLUDES 3rd PARTY OPEN SOURCE LIBRARY.

Component Name: Aptio Cryptographic library

Component Type: PEI, DXE BS, DXE RT driver

AMI BIOS Core: Aptio V.x

Project EIP#14844

Location on SourceSafe: SVN: AptioV;$/AptioV/Sources/Interfaces/AmyCryptoPkg/CryptoLib

Label: AmiCryptoPkg_025

Date: 02-04-2016

Component Description:

1. AptioV Crypto library provides basic Crypto operations: RSA2048, MD5, Sha-1, Sha256, -384, -512, x.509, PKCS#7, PKCS#1, DER(PEM) ASN.1

2. AptioV PPI and UEFI Crypto Protocol for basic crypto operations: RSA, Hash, Pkcs#1, x.509, Pkcs#7

This Crypto library uses 3-rd party Open Source library code. Please refer to the “3rd Party Code…” section below.

AMI Build Tools:

Tools Label: BuildTools_28

Visual eBios: RSS.7.17.0302

New features added in this label:

AmiCryptoPkg.sdl :

Set AMI_CRYPTOPACKAGE_MODULE_REVISION = 25

CryptoCon v5.02.03.2016

Create Linux version of CryptoCon tool. Initial file version release. Note, the file has no extension and if someone is going to launch it, first check if the executable permission is set.

Use chmod command "chmod +x CryptoCon" to set the permission before launching the tool.

Display memory ranges that are being hashed.

For Capsule2 settings (-x2) the FwExt flag (-q) always cleared.

(new) --PE command to calculate hash over a PE/COFF image.

AmiCryptLib.inf;

AmyCrypt Library changes: BaseIntrinsicLib library is no longer published by AmiCryptoPkg. All external modules should remove dependency on this library instance.

Pkcs7.c, *.h;EIP#247330

Extended Pkcs7_certificate_validate_digest() logic to handle non-Authenticode formatted SignedData with either ContentInfo.digest or signedattributed.digest are present.

General Bug Fixes:

CryptoDXE.c : ARM debug issue. GetKey() TRACE message can’t access un-initialized pointers

CryptLibInit.c : RuntimeCryptLibAddressChangeEvent() - can't call any runtime services until CPU is switched to Virtual Mem mode, e.g do a Debug print

RSAKeyImport.c : CPP check v1.72 fix for Memory leak: KeyNmod. Add parameter check.

CryptoDXE.c : EIP#252490: Use of potentially uninitialized pointer. Solution -rewrite the code to account for a failed condition

CryptoPPI.h, CryptoPEI.c:

EIP#252111: Static guid definition for gAmiDigitalSignaturePPIGuid removed from a C file for compatibility with Tools 28, and defined as an extern inside a header file to stay backward compatible with older versions of the Tools.

EIP addressed in this label:

EIP#252111: Build issue with Tools28 on ARM64 projects

EIP#252490: Static code analysis issues found in AptioV AmiCryptoPkg module

EIP#247330: OA Key Fail in Auth2Variable.c->ValidateSelfSigned Function. Confirmed to be a Linux sign tool issue on the customer's side

Validation Testing:

BQA validation passed for label AmiCryptoPkg_25. Test plan with the results is available here.

Known issues and limitations in this label:

BaseIntrinsicLib library is no longer published by AmiCryptoPkg.

Common notes for PeiCryptLib, AmiCryptLib and BaseCryptLib libraries:

Should a library consumer need to use the library key management and encryption functions (RSA, PKCS#7, X.509) the library constructor AmiCryptLibConstructor() will automatically allocate the memory heap for internal memory manager and install virtual address change callback event. In runtime instance of AmiCryptLib, the RuntimeAmiCryptLibConstructor() will install a callback on virtual address change event to re-allocate the pointer to a memory heap.

For Pei instance of the library, the caller must allocate the heap of the size not less than 48kb and invoke the library function InitCRmm((void*)HeapAddress, Size);

3rd Party Code Present in Component:

Aptio Crypto Library based on Open Source crypto library (wpa_supplicant).

This Crypto library module is based on Open standard Crypto library – wpa_supplicant and is built to function under UEFI environment.

This program is licensed under the BSD license.

Current supported wpa_supplicant source version for UEFI Crypto Library is wpa_supplicant-0.6.10

http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz

WPA stands for Wi-Fi Protected Access, a wireless encryption standard.

Wpa_supplicant is a well-known open source implementation of WPA and WPA2 (IEEE 802.11i / RSN).

It is suitable for both desktop/laptop computers and embedded systems.

The core library provides basic TLS/crypto implementation for:

-X.509 certificate processing

-PKCS #1

-ASN.1

-RSA

-bignum

(See http://hostap.epitest.fi/wpa_supplicant/ for more information for wpa_supplicant).

================================================================================

Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors

All Rights Reserved.

=============

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name(s) of the above-listed copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Release History:

5_004.CryptoPkg_024 … 5_004.CryptoPkg_009

© American Megatrends Inc.