American Megatrends, Inc.

Secure FW Update (NIST SP800-147)

Copyright

Release Notes

© American Megatrends, Inc.


General Information

APTIO Secure Flash integration & testing guide

Porting Information : AMI_Aptio_4.6.x_Secure_FW_Update_Integration_Guide_NDA.docx

Aptio for NIST 800-147 : AMI_Aptio_Solution_for_NISTsp800-147_NDA.doc

Ami Test Key replacement : AMI_Aptio_4.x_SecureFlashPkg_Key_Replacement_Guide_NDA.doc


Release Notes - NDA Required

Information:

Component Name: Aptio Secure Flash Update Package

Component Type: PEI, DXE BS, DXE RT driver

AMI BIOS Core: Aptio 4.6.5.x

Location on SourceSafe: $Alaska/ Source/Modules/SecureFlashPkg

Label: 4.6.5.1_SECMOD_017

Date: 2014-11-14

Component Description:

Aptio Secure Flash Update package

1. Provide implementation for authenticated flash update and recovery of the BIOS image. Flash update implementation is compliant with NIST SP pub 800-147 guidelines for Protected Flash Update.

2. Include Aptio Build scripts and utilities to generate Signed Aptio BIOS ROM. The file is compatible with Aptio Secure Flash Update interfaces.

3. BIOS images are signed in conformance with NIST SP 800-147 approved digital signature algorithms. Digital Signature use PKCS#1 v1.5 format with EMSA_PSS or EMSA-PKCS padding schemes, hash SHA256 and RSA encryption with key length of 2048 bits. Alternatively, the BIOS image can use PKCS#7 formatted certificates.

4. Component includes the following module parts:

-Secure Flash Update

-Secure SMI Flash

-Platform key integration scripts

-Crypto utilities

Module is dependent on following generic Aptio 4 eModules:

-Crypto Package;

-Capsule (only if Capsule Flash Update is supported)

-SmiFlash, OFBD and OFBD Secure Flash

Optional module to bring Ami Test keys:

-Ami Test key store

Important information about the role of the sign keys in the component:

Beginning with label 4.6.5.1_SECMOD_015 Secure Flash Module does not include default Platform FW sign keys.

- Instructions to obtain/generate test Platform keys are provided inside Secure FW Update Integration guide document.

- If upgrading Secure Flash eModule to a newer label, project owner should preserve existing Platform Key files defined by SDL Tokens FWpriv and FWpub in their original location at Project_root/Keys/FW and make sure the files remain linked to a project in a .CIF file.

Files containing the RSA signing key(s) are listed by SDL Tokens FWpriv, FWpub and optionally by FWrootKey:

-FWpriv, FWpub are the file names of a FW Capsule Signing Key: private and public portion of an RSA2048 Key;

-FWrootKey is a file name for Key Upgrade Key - used during Platform Key upgrade process.

When building the Key Upgrade BIOS package, new Platform key will be assigned by FWpriv/FWpub and an old Signing key file (used to be defined in FWpriv) is assigned by FWrootKey token.

Build time generation of a Signed BIOS image (a.k.a FW Capsule) is controlled by “CREATE_FWCAPSULE” SDL switch.

CREATE_FWCAPSULE = 0:

Create un-secured BIOS. Target BIOS image will not include Root Platform key to verify signed updates. Un-secured (legacy) BIOS ROM only supports un-signed Flash- and Recovery updates.

CREATE_FWCAPSULE = 1(default):

Aptio build process will include additional steps to create Signed FW Capsule image:

1. Embed the FwCapsule Header with extended Rom Layout map file inside FV_MAIN as FwCapsuleHdr ffs file

2. Embed public portion of a Root Platform Key FWpub to FV_BB as FWkey ffs.

A dummy ffs with FwKey placeholder is created if FWpub key was not available at build time. Note: The content of default FWkey ffs can be replaced with public portion of the

Sign Key during image signing using Cryptocon.exe scripts. Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

3. Create a “make_sign_capsule_readme.txt” file with instructions how to generate Signed FW Capsule using AMI’s Cryptocon.exe utility and a BIOS ROM image.

4. Generate Aptio FwCapsule image out of BIOS.ROM file. Capsule signing is completed if FWpriv file with RSA Signing key is available; otherwise Error message is displayed.

CREATE_FWCAPSULE =2:

Build flow follows the mode “1” with exception of the step 4 - generation of Signed FwCapsule. Image signing is deferred to external sign process, e.g. by a Remote Signing Server.

Warning: Flash update or recovery of the Secured BIOS (built with CREATE_FWCAPSULE = 1 or 2) will fail if the image is missing valid Platform public key.

Such invalid BIOS can only be re-flashed using a flash programmer.

It is very important that BIOS project owners implement proper security protocols that follow common industry standards of protecting the FW signing process and preventing un-authorized parties from tempering with the FW Signing Key. Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using Remote Signing Server

AMI Build Tools:

Tools Label: 4.5.5_TOOLS_35, Dated: 2011-03-29

Visual eBios: RSS.5.70, Dated: 2010-10-06

Important Fixes are in Red

1. Important Security upgrade: Enabled RUNTIME_SECURE_UPDATE_FLOW by default. This feature will block the writes to Flash by SmiFlash SM SMI API bypassing the Security checks.

2. Don't override a default Recovery file name. FwCapsule file name must be renamed to match a default RECOVERY_ROM name in order to be accepted as a Recovery image.

3. Secure SMI Flash module will allocate a scratch BIOS buffer using “Reserved” memory type versus “AcpiNVS” as used in prior labels. The change improves S3 resume times on MS Win8 OSs.

Modules added to this label:

none

Modules removed from last label:

New features added in this label:

SecureMod.sdl

SECURE_FLASH_MODULE_REVISION = 17

SDL Token: CREATE_FWCAPSULE. Introduce new value = 2 to skip FwCapsule signing step at the end of BIOS build process.

Updated CRYPTOCON_CMDLINE settings for Pkcs#7 sign operation. Add an option to provide PKCS#12 Pfx key password string.

Split the CRYPTOCON Command line into 2 sets:

-CRYPTOCON_CMDLINE_MAP cmd for preparing BIOS ROM image with mapping of capsule signing instructions and an extended ROM map layout

-CRYPTOCON_CMDLINE_SIG actual capsule signing command line.

Increase FWCAPSULE_IMAGE_SIZE to hold 16kb as a max size CapHdr

FWCAPSULE_FILE_NAME no longer re-defines a default Recovery file name. SDL Token RECOVERY_ROM has the default name.

SecureMod.mak

Eliminate generation of a .bat file. Instead provide capsule build instructions inside make_sign_capsule_readme file

IsSecRecovery.c (PEI, Recovery)

GetFlashUpdateVar() - set default value of CounterHi for cases when MC variable available only in pre-boot

CounterHi = check for a condition when MC variable available only in pre-boot

VerifyFwCapsule.c (PEI, Recovery)

Allow to recover with signed image if dummy Platform key is detected. The feature is activated only when REFLASH_INTERACTIVE mode is ON

VerifyFwCapsule: sanity check: FwCapHdr RomImageOffset checked against max size (FWCAPSULE_IMAGE_SIZE-FLASH_SIZE)

VerifyFwCapsule: With dummy FwKey function returns no error but with set Key flag. The Recovery page must display the warning and user prompt.

VerifyFwCapsule.c (SecSMI flash)

CapsuleValidate: Use external gpPubKeyHndl to get the Fwkey ptr

CapsuleValidate: sanity check: FwCapHdr RomImageOffset checked against max size (FWCAPSULE_IMAGE_SIZE-FLASH_SIZE)

CapsuleValidate: add parameter check pFWCapsuleHdr != NULL

SecSmiFlash.c

Make gpPubKeyHndl variable global to be accessed from externally linked code

SetFlUpdMethod(): Set SecSmiFlash.RomLayout only for Runtime and Capsule update; cleaned up from dummy code " SecSmiFlash.pFwCapsule = SecSmiFlash.pFwCapsule"

SetFlUpdMethod() - SecSmiFlash.RomLayout is updated to a map from a new image but not used. Later may compare the maps to find inconsistencies.

Replace a var name gRomFileSize to a more appropriate gFwCapMaxSize

Add a code to erase existing CapsuleUpdate and FlashUdate vars: Fixes the case when vars exist with different attributes which prevent SecSmiFlash to set new valid var.

CryptoCon.exe

v4.9.3.2014

Support -m without -r. RomMap will be located inside of the embedded Hdr or flat map will be created

Add support "-c1 (if key file not defined) -s" to generate serialized output for PKCS#1 signed capsules

-c1 -s -x cert.p7 will package Pkcs#1 cert with RSA pub key and RSA-Pkcs#1v1_5 signature extracted from .p7.

-c RootKey.priv -s -x will create FwRoot cert signing FwSign (Pkcs#7 derived) with RootKey.

Bug fix: Create relative address from top of 4GB for RomLayout entry for FwCapHdr ffs

Include RomMap from FwCapHdr ffs to be reported as measured - prevents tampering with rom holes flash regions which are not security check enforced during re-flash

Clear CAPSULE_FLAGS_FWCERTBLOCK_INVALID flag only for Capsule signing. Parameter mapping function (-m) don't change the flag.

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 option (-t) for filtering of rom blocks used for TCG measurement only. Use in 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

Add new command -m(map) only to set internal CapHdr 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.

-Limit size of Win_certificate with Pkcs#7 certificate block to the size of the Hdr+x509_len when using an external .p7 cert file

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.

General Bug Fixes:

SecureMod.sdl

EIP#185686: Build error with Recovery_SUPPORT = 0

VerifyFwCapsule.c (PEI, Recovery)

EIP#149817: don't override a default Recovery file name defined by RECOVERY_ROM. Fix build error when REFLASH_INTERACTIVE is 0

EIP#176297: Fix bug in condition expressions inside “for” loops.

EIP#185686: Build error with Recovery_SUPPORT = 0

VerifyFwCapsule.c (SMM)

EIP#176297: Fix bug in condition expression inside the ‘for’ loops.

SecSmiFlash.c

EIP#136887: With RUNTIME_SECURE_UPDATE_FLOW switch turned on, system hangs inside SecSmiFlashInit() on Capsule Flash Update flow due to wrong romlayout size calculation logic

inside SecSmiFlash.c->GetRomLayout().

EIP#159507: S3 resume time improvement: Use EfiReservedMemoryType instead of EfiACPIMemoryNVS for large buffer allocations. FwCapsule buffer to be allocated below 4GB.

EIP#168391: Harden SmiS5CapsuleCallback(),memory allocation for gpEfiCapsuleHdr changed from runtime memory to SMRAM.

EIP#176297: Harden external parameter checks in SW SMI API. Fixes are made to address:

#7. Arbitrary SMRAM overwrite in SetFlUpdMethod()

#8. Integer overflow leading to buffer overflow in LoadFwImage in SecSMIFlash SMI handler

Use internal RomLayout map to process Flash Erase/Write requests. Issue- new RomMap may be different - exposing rom holes in wrong places

BeforeSecureUpdate() - bug in calculating the flash range within the RomArea

EIP addressed in this label:

EIP#159507: SecSmiFlash.c: Use EfiReservedMemoryType instead of EfiACPIMemoryNVS for large buffer allocations. Verified to improve S3 resume times on AMD CPUs

EIP#149817: Don't override a default recovery file name

EIP#136887: The system will hang after resume from S3 when flashing BIOS with /capsule parameter.

EIP#168391: The power button does not work with failed NVRAM. Hangs at SmiS5CapsuleCallback()

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

EIP#176297: Harden external parameter checks in SW SMI API; Fix bug in condition expression inside the ‘for’ loops.

EIP#185686: Build error with Recovery_SUPPORT = 0

Known issues and limitations in this label:

4. This module version must be used with “CryptoPkg” module label 4.6.5.0_CRYPTOAPI_020 or later

5. Set SDL Token FWSIG_SIGNHDR = 0 when building an upgrade for the BIOS with Secure Flash Pkg Label 4.6.5.1_SECMOD_008 or older

6. Set SDL Token FWSIG_SIGNHDR = 1 when upgrading the BIOS with Secure Flash Pkg Label 4.6.5.1_SECMOD_009

7. Set SDL Token FWSIG_SIGNHDR = 1 when building FwCapsule file with FWCAPSULE_FILE_FORMAT = 0

Section 12: Remaining Issues:

ISSUE AN DESCRIPTION

Unit Testing:

Secure Flash test plan includes the tests with following test IDs: 34367; 33982; 34622; 34721; 31918; 34366; 35792

Authorized users can obtain test plan details by connecting to AMI’s bug tracking database by this link.

Validation Testing:

Completed BQA validation for label 4.6.5.1_SECMOD_017. Authorized users may check the test results by this link: EIP#189488

3rd Party Code Present in Component:

Release History:

4.6.5.1_SECMOD_016

IsSecRecovery.c Fix ChangeBootModeAfterEndofMrc() to change BootMode and install PPI if FwCapsule update is pending

VerifyFwCapsule.c VerifyFwCertRsa2048Sha256() - Add a check for an end of Certificate block; only process filled Key certificates; Break a loop if reached RootCert Verify if key match is found.

Change Ignore_rollback behavior. Won't skip Project Tag comparison

4.6.5.1_SECMOD_015

Removed test keys that used to come with Platform Fw Key module. User provided with instructions how to generate new Keys or use Ami Test Keys

EIP#125800: add more error checking in release mode inside InSmmFunction() in SecSmiFlash.c

EIP#125800: Privilege escalation into SMM via Secure SMI Flash SMM driver via GetFlUpdPolicy and SetFlUpdMethod

EIP#105015: Request to implement Pkcs7# Certificate signing in Aptio Fw Capsule update packages

EIP#121359: CapsuleValidate need integrate into EFI_SEC_SMI_FLASH_PROTOCOL.

4.6.5.1_SECMOD_014

EIP#106359: Secure Flash Cross function fail. Move FwCapSectionGuid define outside of #if branch

EIP#100418: Make SecureFlashPkg build independent from Core's ReFlash driver Support

EIP[104046]: Findings from Security review on Aptio4 Image verification

4.6.5.1_SECMOD_012

EIP:100448 AFUDOS failed - After issuing command: "afudos 0ACAK.CAP /p /b /n", system reboots at "Erasing Boot Block".

Bug fix: allocation of HashCtx buffer was dependent on SDL Token: CAPSULE_RECOVERY = 1 support

SecureMod.sdl By default, Signed BIOS Image file name includes .CAP extension only if signed capsule image begins with Fw Capsule Header.

For the signed file with the signature block embedded into AMI.ROM the extension remains .ROM

VerifyFwCapsule.c VerifyFwImage: sanity check for buffer overruns. Applied for FwCapsules with Hdr on top of the Payload

4.6.5.1_SECMOD_012

SecureMod.sdl Fix from Label _011: For backward compatibility, set FWCAPSULE_FILE_FORMAT to generate capsule File with Cap Hdr on top.

SecFlashUpd.mak, SecFlashUpdDxe.c EIP#100418: Make SecureFlashPkg build independant from ReFlash-Support

SecSMIFlash.sdl, VerifyFwCapsule.c Bug: Recovery update was broken for FwCapsule with embedded signature and FWSIG_SIGNHDR token 0. Fix: FindCapHdrFFS() change Ffs Hdr size

testing

CryptoCon.exe: Set correct SHA256 ASN.1 OID value in generated PKCS1 v1.5 Signature bloc

4.6.5.1_SECMOD_011

SecureMod.sdl(.mak)

Add SECURE_FLASH_MODULE_REVISION. Revision starts with current label #11

Add FWSIG_KEY_ROOT flag to select which Key is used to sign FwCapsule's FwSig Signature

0 – New Key for each FwCApsule build or

1 – FwKey is used to sign both FwCertificate Signatures (Set as default)

Set FWCAPSULE_FILE_FORMAT to 0 by default. Fw Capsule Hdr is included inside AMI.ROM image as ffs. Reversed in label _012

Update eLink target for FwCapsuleHdr.ffs based on LZMA_SUPPORT

Make FWSIG_PADDING token relevant only if FWSIG_SIGNHDR = 1.

SecFlashUpd.mak Replace custom _EFI_CAPSULE_BLOCK_DESCRIPTOR_ with generic EFI_CAPSULE_BLOCK_DESCRIPTOR

VerifyFwCapsule.c Replaced #if FWSIG_PADDING == 0 with #if FWSIG_SIGNHDR == 1. Flag in the FwCap Hdr to switch between PKCS1_5 and PSS padding is available only if #if FWSIG_SIGNHDR == 1

IsSecRecovery.c IsFlashUpdateS3Capsule(). Install Capsule Recovery Event whether by checking FlashUpd variable or if BOOT_ON_FLASH_UPDATE. It may've already been set by Capsule PEI

EfiCapsuleRecovery.c Change return NULL to return 0 for EFI_PHYSICAL_ADDRESS types

SecSMIFlash.sdl(.mak) R emoved eLinks to SmiFlash API. SecSmiFlash blocks Flash update by trapping Flash Protocol functions.Removed build rules of now obsolete SecSmiFlashHooks

SecSMIFlash.dxs Removed dependency on Flash Update protocol

SecSMIFlash.c Replaced custom Capsule module defined _EFI_CAPSULE_BLOCK_DESCRIPTOR_ with generic UEFI EFI_CAPSULE_BLOCK_DESCRIPTOR structure

Include GetRomLayout under #if RUNTIME_SECURE_UPDATE_FLOW == 1.

Allow to install SecSmi Flash handler if RomLayout map not detected during module Init

Use global pSmmBase ptr in InSmmFunction()

CryptoCon.exe v3.08 22.2012

-y input (embedded Capsule Hdr) has enhanced search rules to match 3 parameters: 1)FFS Section Guid, 1)FW Capsule GUID and 3)Capsule Size

-k input supports keys in x509 CER format too. Used to support key inputs in DER ASN.1 only.

-v & -s : clarified input parameters in help output

Release version no longer includes support for Pkcs#7 and x509 certificate validation (-x) and commands to generate Authenticated Variables (-i, -m, -t, -g, -a)

4.6.5.1_SECMOD_010

SecureMod.sdl;*mak EIP87889: Signed Aptio Flash Update binary image Supporting new output file format of the BIOS.ROM with embedded FwCapsule Hdr inside the FFS File Section with the special GUID

Add NEW SDL Token: RUNTIME_SECURE_UPDATE_FLOW, if enabled – will link the code to perform security checks in runtime flash update. The default state of the token is – OFF.

EfiCapsuleRecovery.c EIP:87678: Working image during Recovery and Capsule Secure Flash Update Defer Publishing of FV DXE to DxeIpl. Launch DXE from original FV on Flash updates while in Recovery use DXE form new image

SecSMIFlashHook.c Remove SecureUpdBeforeSmiflashWrite() Hook.

SecSMIFlash.c Major change in SecSmiFlash.c. Replace the original SMM Flash driver API calls with SecSmi protected functions. Only do it if "Runtime" update is disabled.

SecSMIFlash.sd Removed SW SMI Version token

CryptoCon.exe EIP87889: Signed Aptio Flash Update binary image new function: "-y" embeds FwCapsule Hdr inside FFS File Section with special GUID

4.6.5.1_SECMOD_009

SecureMod.sdl;*mak Add FWKEY_FORMAT to switch between RSA2048 and SHA256 hash formats of the Root Signing Key stored in ffs file

VerifyFwCapsule.c VerifyFwImage-> fixed logic to process RomMap entries. Number of signed elements in RomMap may not exceed max_num_elem constant. Overall number of

elements in the RomMap may not exceed max_num_elem x 2

Update format of Capsule signing:

-Entire Capsule Header and FW_Cert Header are included in SigCert Signature calculation. This hardens Capsule image integrity test.

-RootCertificate to contain a signature of SignCert.PublicKey buffer and not the entire Signing Certificate. No need for resigning of RootCert each time SignCert is being

created

SecSMIFlash.sdl Removed code to PRESERVE_SECURE_VARIABLES. Implementation is moved to Secure Boot module (SecureBootMod.c)

SecSMIFlash.c Removed "gAmiSig->GetKey" from driver entruy point. Will use VerifyKey instead. FW Key may be stored as a Hash in FW Key file storage

SecSMIFlashHook.c Remove code to PRESERVE_SECURE_VARIABLES. Implementation is moved to Secure Boot module (SecureBootMod.c)

CryptoCon.exe: Major upgrade in ver v3.04 01.2012.

1. Capsule Header is included into Digital Signature computation

2. RootCertificate includes a signature of only a PubKey and not of entire SignCertificate

This allows for RootCert to include static Key signature. Not require access to Root Key each time Capsule signing occurs

asfuUtil.zip Ignore error in FW Key comparison test. SMI API may not return full RSA Key but a hash of it

4.6.5.1_SECMOD_008

SecureMod.sdl; added FWCAPSULE_FILE_SUPPORT and FWCAPSULE_HDR_FILE; Updated FWCAPSULE_FILE_NAME to contain only Project TAG and not a build version since the file name is used as default recovery image name.

SecureMod.mak; Add switch to generate FW Capsule output files based on SDL tokens: FWCAPSULE_FILE_SUPPORT and FWCAPSULE_HDR_FILE; Rearrange build rules, clarify build steps; allow for FW Key to change location from

default $(FWKey_DIR). Display error if FW Key file not found; Use ROM_LAYOUT_EX macro as a name for RomLayout table. New SDL Token is defined by Core.sdl starting from Label 4.6.5.3;

SecFlashUpd.sdl; *.c Streamlined the code for Setup.AutoFlash variable update if FlashUpdate is pending

EfiCapsuleRecovery.c Replace VOID (32bit) with EFI_PHYSICAL_ADDRESS(64bit) pointer for an address of a Recovery Hob data.; Fixes the issue of not finding of RecoveryHob data on Capsule update with 4GB or greater RAM.

VerifyFwCapsule.c VerifyProjectId(). Calculate size of ProjectId string based on SDL Token PROJECT_TAG; GetFidData(). Use 1 byte aligned SearchPointer in searching for "Section Guid" structure.

SecSMIFlash.sdl Removed AFU_FLASH_PAGE_SIZE token. Hash Page size always hardwired to FLASH_BLOCK_SIZE

SecSMIFlash.c Use SHA256 Hash for Hash table; Always calculate Hash table for new bios data of Runtime flash method selected; Hash table page is made to match Flash block size determined by SDL token FLASH_BLOCK_SIZE and

not by AFU flash page size

SecSMIFlashHook.c -Bug Fix: Fix SecureUpdBeforeSmiflashWrite() code flow for SMM allocated BIOS buffer; Run hash check on next adjacent flash block if write block overlaps the page alignment;Replaced configurable value of

Hash page size "AFU_FLASH_PAGE_SIZE" value with fixed "FLASH_BLOCK_SIZE"; Included a test code (keep commented out) to replace AFU sequence of Unlock-Erase-Write-Verify-Lock commands with single call to Erase

CryptoCon.exe Bug Fix: bug in input argument pre-processor logic. Tool used to fail on some systems; Updated Tool revision to v3.03 01.2012. Fixed help text;Add switch "-y" to be used along with "-c" to generate signed Capsule

Header file only

4.6.5.1_SECMOD_006

SecFlashUpd.sdl; SecFlashUpd.mak; IsSecRecovery.c: Change method of calling IsSecRecovery init routine. Replaced IsSecRecovery PEI with function call IsFlashUpdateRecovery from PeiCoreInitialize

EfiCapsuleRecovery.c: Re-define EFI_HOB_TYPE_CV type as EFI_HOB_TYPE_UEFI_CAPSULE for forward compatibility with PI 1.2 Hob.h definitions

FlashUpd.h: Removed unused "MC" type from "VerifyTask"

SecSMIFlash.c: Bug fix: UpdateCapsule() While preparing MailBox descriptor, the pointer gpCapsuleMailboxPtr reached outside of allocated memory gpEfiCapsuleHdr

asfuUtil.zip: Added missing Windows drivers for ASFUWIN and update readme.txt

4.6.5.1_SECMOD_005:

Updated AMI_Aptio_4.6.x_Secure_FW_Update_Integration_Guide_NDA.doc. Included new sections for required chipset porting and description of new SDL Tokens

SecFlashUpd.sdl Made FWCAPSULE_RECOVERY_SUPPORT dependent on UEFI_2_0_CAPSULE=1. Currently only this type of Capsule Mailbox formatting is supported by SecSmiFlash Capsule Update.

VerifyFwCapsule.c FW Revision searched inside FID structure. Simplified the search throughout FW block by 4byte aligned $FID signature only. This helps to locate FID when Capsule includes FwBuild generated RomLayout map

SecSMIFlash.sdl Introduced 2 new SDL Tokens: INSTALL_SECURE_FLASH_SW_SMI_HNDL and CSLIB_WARM_RESET_SUPPORTED

Change the default value NEW_BIOS_MEM_ALLOC to 1 - Allocate buffer in Acpi NVS

Define eLink SEC_SMIFLASH_LIB to link SecFlash Hooks as library to SmiFlash and(or) OFBD SECURE Flash

SecSMIFlash.c

1.SmiS5CapsuleCallback-> Introduce a call to Chipset defined SBLib_ResetSystem(WarmReset) . Call is included based on the SDL switch CSLIB_WARM_RESET_SUPPORTED. It replaces sample implementation of WarmReset via S3 & RTC wake up

2. SetFlUpdMethod-> Add temp w/a for AFU rev 3.0. Wrong image size(0) is reported by AFU in pSessionBlock->FlUpdBlock.ImageSize

3. Updated conditional statements to match newly defined SDL tokens: INSTALL_SECURE_FLASH_SW_SMI_HNDL and CSLIB_WARM_RESET_SUPPORTED

4. Replaced dependencies from WARM_REBOOT flag to generic FWCAPSULE_RECOVERY_SUPPORT

5. SetFlUpdMethod() corrected behavior of some AFU implementations for Capsule Set mode. Size should have been provided

6. Memory for Capsule Mailbox allocation moved form "EfiRuntime" to more appropriate "AcpiNvs

(INT)4.6.5.1_SECMOD_005:

Update Secure Flash Porting Guide document.

SecureMod.sdl: Remove RECOVERY_ROM and RECOVERY_IMAGE_SIZE override tokens; FWCAPSULE_FILE_NAME now defines the default recovery Image file

EfiCapsuleRecovery.c: Replace local Capsule pointer with global one. ; Locate FW Capsule includes search in 2 potential Capsule Hob types: - EFI_HOB_TYPE_GUID_EXTENSION and EFI_HOB_TYPE_CV

EfiCapsuleRecovery.dxs: include dependency on AMI_DIGITAL_SIG PPI; include optional GUID dependency on Intel Misc Framework PEI_CAPSULE_PPI_GUID

SecFlashUpdDxe: Use Core 4.6.5.2 provided name AMI_EVENT_FLASH_WRITE_LOCK as GUID define for Flash Lock event

Crypto Con Utility: fix bug in argument parser list

(INT)4.6.5.1_SECMOD_004:

Updated Secure Flash Porting Guide document with references to NIST 8—147 requirements.

Attached new document: AMI_Aptio_Solution_for_NIST_SBIOS_Secure_Update_Requirements.doc

Added SecureFlashDxe driver with 2 new functions

Update AutoFlash variable on Recovery/Capsule Flash Update boot flows.

Install Notification event: FlashReadyToLock. Consumers of this event will be Chipset to enable SPI Lock and NVRAM SMI driver to redirect DXE EFI Variable services to SMM clone

SecureMod.sdl: Added FWCAPSULE_ROM_ALLIGN token to control FW Capsule size alignment

SecureMod.mak: use new CryptoCon.exe with support for -l key for output file alignment

SecFlashUpd.sdl: Added eLink for new IsSecRecovery.ffs; Replace old method to detect FlashUpd with single IsFlashUpdate() hook to be called from SbPei.c ->GetBootMode

SecFlashUpd.mak: Create build rules for IsSecRecovery.ffs PEI module

VerifyFwCapsule.c: VerifyFwRevision(): removed unused input parameter: **PeiServices

IsSecRecovery.c: Add provision to build file as .FFS with new function to install callback on gAmiPeiAfterMrcGuid event; Update BootMode to BOOT_ON_FLASH_UPDATE if Capsule update is detected

FlashUpd.h: add parent function IsFlashUpdate(); SecSMIFlash.sdl: Define Hash page as SDL Token. AFU_FLASH_PAGE_SIZE Default 1024 bytes to match current AFU page size. Later will be updated to match FLASH_BLOCK size

SecSMIFlash.c: Skip SecSMIFlashSMIHandler() if OFBD Secure Flash module is active

CryptoCon.exe: Add -l key to choose the file size alignment of the generated FW Capsule file.

4.6.5.1_SECMOD_003:

SecFlashUpdate : Removed Flash Update Policy protocol. EIP: 65892 Secure Flash Setup options are not user friendly: Removed Setup Page to update Secure Flash policy dynamically.

VerifyCapsule : Add provision to ignore rollback protection. Add Build time flag to ignore Revision check. Should only be used during development phase.

SecureSmiFlash : Hardwire Flash Upd policy (staticly provided from SDL tokens);make Capsule update code dependent on FWCAPSULE_RECOVERY_SUPPORT;

SetFlashUpdateVar - assign Attributes to SetVar via CounterHi variable. Old code "A | B | C" had wrong Attributes passed to the SetVariable()

LoadImage-> clear out FSHndl. Need to be set to a valid value only if image Verification completed inside SetFlMethod

SecSmiFlashHooks: Add Hooks to PRESERVE_SECURE_VARIABLES across runtime Flash Update; Add 3 methods to store new BIOS image: AFU (OS) provided, TSEG SMM, Acpi NVS

AsfuUtilities : Updated test Flash tools, included AfuWin.exe

SECMOD_4.6.5._09: SecureSMIFlash: 1. verified with new Secure Flash Update module in OFBD. Requires new AFU tool and OFBD module. Check EIP46069 for more details; 2. SetFlashUpd: abort if capsule size passed by AFU is greater then allocated buffer in gRomFileSize;

SECMOD_4.6.5._08: SecSmiFlash.c: GetKey() expects BufferSize to be initialized with correct Key size

SECMOD_4.6.5._07: EfiCapsuleRecovery.c : update Capsule Recovery code. Rec Hob must be created on Errors too

SECMOD_4.6.5._06: CryptoUtils: Added ASFU flashing tools

© American Megatrends Inc.


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the source files.
For a list in alphabetical order, see In Alphabetical Order.

Built on 12:53:19 11/19/14


Functions in Alphabetical Order

AMIBIOS Function Reference

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.

Built on 12:53:19 11/19/14


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2014 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.