]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg TcgStorageOpalLib: Check BlockSid capability.
authorEric Dong <eric.dong@intel.com>
Fri, 22 Apr 2016 02:54:05 +0000 (10:54 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 5 May 2016 04:52:46 +0000 (12:52 +0800)
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>
SecurityPkg/Include/Library/TcgStorageOpalLib.h
SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c

index a9b4f2fe6e601cb8e7af33de0280f43ba505013f..108affc422ce9874499df87a7112c3c0a03f1745 100644 (file)
@@ -76,6 +76,12 @@ typedef struct {
     //  1 - The initial C_PIN_SID PIN value is equal to the C_PIN_MSID PIN value\r
     //\r
     UINT32 CpinUponRevert : 1;\r
+\r
+    //\r
+    // Media encryption supported (0 - not supported, 1 - supported)\r
+    //\r
+    UINT32 BlockSid : 1;\r
+\r
 } OPAL_DISK_SUPPORT_ATTRIBUTE;\r
 \r
 //\r
index f60a427012bc4480359a23f2d28cdf6a348cdb8b..7674ee5716811b811f09eb179bdcda7804e3b04e 100644 (file)
@@ -1515,6 +1515,12 @@ OpalGetSupportedAttributesInfo(
     SupportedAttributes->MediaEncryption = Feat->Locking.MediaEncryption;\r
   }\r
 \r
+  Size = 0;\r
+  Feat = (OPAL_LEVEL0_FEATURE_DESCRIPTOR*) TcgGetFeature (DiscoveryHeader, TCG_FEATURE_BLOCK_SID, &Size);\r
+  if (Feat != NULL && Size >= sizeof (TCG_BLOCK_SID_FEATURE_DESCRIPTOR)) {\r
+    SupportedAttributes->BlockSid = TRUE;\r
+  }\r
+\r
   DEBUG ((DEBUG_INFO, "Base COMID 0x%04X \n", *OpalBaseComId));\r
 \r
 \r