diff options
author | Eric Dong <eric.dong@intel.com> | 2016-04-22 10:54:05 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-06 16:20:18 +0800 |
commit | abc0fa99bac139e63a14edd2e017412bc84cf83a (patch) | |
tree | 9797c91535a5863342eb3fdc0d864b75a8409fde | |
parent | 87ea341a14695f14da5f1dd48490247c1dc2e6ca (diff) | |
download | edk2-platforms-abc0fa99bac139e63a14edd2e017412bc84cf83a.tar.xz |
SecurityPkg TcgStorageOpalLib: Check BlockSid capability.
Check the BlockSid feature capability through check
BlockSid header in the DiscoveryHeader.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
(cherry picked from commit b20e0d29fa99d7e6126930e133afada55ad1bc66)
-rw-r--r-- | SecurityPkg/Include/Library/TcgStorageOpalLib.h | 6 | ||||
-rw-r--r-- | SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/SecurityPkg/Include/Library/TcgStorageOpalLib.h b/SecurityPkg/Include/Library/TcgStorageOpalLib.h index a9b4f2fe6e..108affc422 100644 --- a/SecurityPkg/Include/Library/TcgStorageOpalLib.h +++ b/SecurityPkg/Include/Library/TcgStorageOpalLib.h @@ -76,6 +76,12 @@ typedef struct { // 1 - The initial C_PIN_SID PIN value is equal to the C_PIN_MSID PIN value
//
UINT32 CpinUponRevert : 1;
+
+ //
+ // Media encryption supported (0 - not supported, 1 - supported)
+ //
+ UINT32 BlockSid : 1;
+
} OPAL_DISK_SUPPORT_ATTRIBUTE;
//
diff --git a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c index f60a427012..7674ee5716 100644 --- a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c +++ b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c @@ -1515,6 +1515,12 @@ OpalGetSupportedAttributesInfo( SupportedAttributes->MediaEncryption = Feat->Locking.MediaEncryption;
}
+ Size = 0;
+ Feat = (OPAL_LEVEL0_FEATURE_DESCRIPTOR*) TcgGetFeature (DiscoveryHeader, TCG_FEATURE_BLOCK_SID, &Size);
+ if (Feat != NULL && Size >= sizeof (TCG_BLOCK_SID_FEATURE_DESCRIPTOR)) {
+ SupportedAttributes->BlockSid = TRUE;
+ }
+
DEBUG ((DEBUG_INFO, "Base COMID 0x%04X \n", *OpalBaseComId));
|