TianoCore EDK2 master
Loading...
Searching...
No Matches
TcgStorageOpalLib.h
Go to the documentation of this file.
1
29#ifndef _OPAL_CORE_H_
30#define _OPAL_CORE_H_
31
33
36
37#pragma pack(1)
38
39typedef struct {
40 //
41 // Opal SSC 1 support (0 - not supported, 1 - supported)
42 //
43 UINT32 OpalSsc1 : 1;
44
45 //
46 // Opal SSC 2support (0 - not supported, 1 - supported)
47 //
48 UINT32 OpalSsc2 : 1;
49
50 //
51 // Opal SSC Lite support (0 - not supported, 1 - supported)
52 //
53 UINT32 OpalSscLite : 1;
54
55 //
56 // Pyrite SSC support (0 - not supported, 1 - supported)
57 //
58 UINT32 PyriteSsc : 1;
59
60 //
61 // Security protocol 1 support (0 - not supported, 1 - supported)
62 //
63 UINT32 Sp1 : 1;
64
65 //
66 // Security protocol 2 support (0 - not supported, 1 - supported)
67 //
68 UINT32 Sp2 : 1;
69
70 //
71 // Security protocol IEEE1667 support (0 - not supported, 1 - supported)
72 //
73 UINT32 SpIeee1667 : 1;
74
75 //
76 // Media encryption supported (0 - not supported, 1 - supported)
77 //
78 UINT32 MediaEncryption : 1;
79
80 //
81 // Initial C_PIN_SID PIN Indicator
82 // 0 - The initial C_PIN_SID PIN value is NOT equal to the C_PIN_MSID PIN value
83 // 1 - The initial C_PIN_SID PIN value is equal to the C_PIN_MSID PIN value
84 //
85 UINT32 InitCpinIndicator : 1;
86
87 //
88 // Behavior of C_PIN_SID PIN upon TPer Revert
89 // 0 - The initial C_PIN_SID PIN value is NOT equal to the C_PIN_MSID PIN value
90 // 1 - The initial C_PIN_SID PIN value is equal to the C_PIN_MSID PIN value
91 //
92 UINT32 CpinUponRevert : 1;
93
94 //
95 // Media encryption supported (0 - not supported, 1 - supported)
96 //
97 UINT32 BlockSid : 1;
98
99 //
100 // Pyrite SSC V2 support (0 - not supported, 1 - supported)
101 //
102 UINT32 PyriteSscV2 : 1;
103
104 //
105 // Supported Data Removal Mechanism support (0 - not supported, 1 - supported)
106 //
107 UINT32 DataRemoval : 1;
109
110//
111// Opal device ownership type
112// The type indicates who was the determined owner of the device.
113//
114typedef enum {
115 //
116 // Represents the device ownership is unknown because starting a session as the SID authority with the ADMIN SP
117 // was unsuccessful with the provided PIN
118 //
119 OpalOwnershipUnknown,
120
121 //
122 // Represents that the ADMIN SP SID authority contains the same PIN as the MSID PIN
123 //
124 OpalOwnershipNobody,
125} OPAL_OWNER_SHIP;
126
127//
128// Structure that is used to represent an Opal session.
129// The structure must be initialized by calling OpalStartSession before being used as a parameter
130// for any other Opal function.
131// This structure should NOT be directly modified by the client of this library.
132//
133//
134typedef struct {
135 UINT32 HostSessionId;
136 UINT32 TperSessionId;
137 UINT16 ComIdExtension;
138
139 UINT16 OpalBaseComId;
140
142 UINT32 MediaId;
144#pragma pack()
145
157EFIAPI
159 OPAL_SESSION *Session,
160 UINTN BufferSize,
161 VOID *BuffAddress
162 );
163
175EFIAPI
177 OPAL_SESSION *Session,
178 UINTN BufferSize,
179 VOID *BuffAddress
180 );
181
201EFIAPI
203 OPAL_SESSION *Session,
204 TCG_UID SpId,
205 BOOLEAN Write,
206 UINT32 HostChallengeLength,
207 const VOID *HostChallenge,
208 TCG_UID HostSigningAuthority,
209 UINT8 *MethodStatus
210 );
211
219EFIAPI
221 OPAL_SESSION *Session
222 );
223
232EFIAPI
234 OPAL_SESSION *AdminSpSession
235 );
236
248EFIAPI
250 OPAL_SESSION *AdminSpSession,
251 UINT32 MsidBufferSize,
252 UINT8 *Msid,
253 UINT32 *MsidLength
254 );
255
267EFIAPI
269 OPAL_SESSION *AdminSpSession,
270 UINT8 *MethodStatus
271 );
272
285EFIAPI
287 OPAL_SESSION *Session,
288 TCG_UID CpinRowUid,
289 const VOID *NewPin,
290 UINT32 NewPinLength,
291 UINT8 *MethodStatus
292 );
293
304EFIAPI
306 OPAL_SESSION *LockingSpSession,
307 UINT8 *MethodStatus
308 );
309
323EFIAPI
325 OPAL_SESSION *LockingSpSession,
326 BOOLEAN ReadLocked,
327 BOOLEAN WriteLocked,
328 UINT8 *MethodStatus
329 );
330
348EFIAPI
350 OPAL_SESSION *LockingSpSession,
351 TCG_UID LockingRangeUid,
352 UINT64 RangeStart,
353 UINT64 RangeLength,
354 BOOLEAN ReadLockEnabled,
355 BOOLEAN WriteLockEnabled,
356 BOOLEAN ReadLocked,
357 BOOLEAN WriteLocked,
358 UINT8 *MethodStatus
359 );
360
375EFIAPI
377 OPAL_SESSION *LockingSpSession,
378 TCG_UID CpinRowUid,
379 TCG_UID AuthorityUid,
380 const VOID *NewPin,
381 UINT32 NewPinLength,
382 UINT8 *MethodStatus
383 );
384
394EFIAPI
396 OPAL_SESSION *LockingSpSession,
397 UINT8 *MethodStatus
398 );
399
411EFIAPI
413 OPAL_SESSION *LockingSpSession,
414 BOOLEAN KeepUserData,
415 UINT8 *MethodStatus
416 );
417
428EFIAPI
430 OPAL_SESSION *LockingSpSession,
431 TCG_UID RowUid,
432 UINT32 *TryLimit
433 );
434
447EFIAPI
449 const OPAL_SESSION *Session,
450 TCG_CREATE_STRUCT *CreateStruct,
451 UINT32 *Size
452 );
453
463EFIAPI
465 TCG_PARSE_STRUCT *ParseStruct,
466 TCG_UID *ActiveKey
467 );
468
478EFIAPI
480 OPAL_SESSION *Session,
481 TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature
482 );
483
492BOOLEAN
493EFIAPI
495 OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes
496 );
497
509BOOLEAN
510EFIAPI
512 OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes,
513 TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature
514 );
515
526BOOLEAN
528 OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes,
529 TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature
530 );
531
540EFIAPI
542 OPAL_SESSION *Session,
543 BOOLEAN HardwareReset
544 );
545
556EFIAPI
558 OPAL_SESSION *Session,
559 OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes,
560 UINT16 *OpalBaseComId
561 );
562
572EFIAPI
574 OPAL_SESSION *AdminSpSession,
575 const VOID *Psid,
576 UINT32 PsidLength
577 );
578
592EFIAPI
594 OPAL_SESSION *AdminSpSession,
595 const VOID *GeneratedSid,
596 UINT32 SidLength,
597 const VOID *Password,
598 UINT32 PassLength
599 );
600
619EFIAPI
621 OPAL_SESSION *LockingSpSession,
622 const VOID *Password,
623 UINT32 PassLength,
624 TCG_UID LockingRangeUid,
625 UINT64 RangeStart,
626 UINT64 RangeLength,
627 BOOLEAN ReadLockEnabled,
628 BOOLEAN WriteLockEnabled,
629 BOOLEAN ReadLocked,
630 BOOLEAN WriteLocked
631 );
632
646EFIAPI
648 OPAL_SESSION *AdminSpSession,
649 const VOID *OldPassword,
650 UINT32 OldPasswordLength,
651 const VOID *NewPassword,
652 UINT32 NewPasswordLength
653 );
654
667EFIAPI
669 OPAL_SESSION *LockingSpSession,
670 const VOID *OldPassword,
671 UINT32 OldPasswordLength,
672 const VOID *NewPassword,
673 UINT32 NewPasswordLength
674 );
675
686EFIAPI
688 OPAL_SESSION *LockingSpSession,
689 const VOID *Password,
690 UINT32 PasswordLength,
691 TCG_UID HostSigningAuthority
692 );
693
705EFIAPI
707 OPAL_SESSION *LockingSpSession,
708 const VOID *Password,
709 UINT32 PasswordLength,
710 BOOLEAN *PasswordFailed
711 );
712
723EFIAPI
725 OPAL_SESSION *LockingSpSession,
726 const VOID *Password,
727 UINT32 PasswordLength,
728 BOOLEAN *PasswordFailed
729 );
730
744EFIAPI
746 OPAL_SESSION *LockingSpSession,
747 BOOLEAN KeepUserData,
748 const VOID *Password,
749 UINT32 PasswordLength,
750 BOOLEAN *PasswordFailed,
751 UINT8 *Msid,
752 UINT32 MsidLength
753 );
754
766EFIAPI
768 OPAL_SESSION *AdminSpSession,
769 const VOID *Password,
770 UINT32 PasswordLength,
771 UINT8 *Msid,
772 UINT32 MsidLength
773 );
774
786EFIAPI
788 OPAL_SESSION *LockingSpSession,
789 const VOID *Password,
790 UINT32 PasswordLength,
791 BOOLEAN ReadLocked,
792 BOOLEAN WriteLocked
793 );
794
805EFIAPI
807 OPAL_SESSION *Session,
808 UINT8 *Msid,
809 UINT32 MsidBufferLength,
810 UINT32 *MsidLength
811 );
812
825OPAL_OWNER_SHIP
826EFIAPI
828 OPAL_SESSION *Session,
829 UINT8 *Msid,
830 UINT32 MsidLength
831 );
832
844BOOLEAN
845EFIAPI
847 IN UINT16 OwnerShip,
848 IN TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature
849 );
850
861EFIAPI
863 OPAL_SESSION *Session,
864 const VOID *GeneratedSid,
865 UINT32 SidLength,
866 UINT8 *ActiveDataRemovalMechanism
867 );
868
877EFIAPI
879 IN OPAL_SESSION *Session,
880 OUT UINT32 *RemovalMechanismLists
881 );
882
883#endif // _OPAL_CORE_H_
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 TCG_UID
UID in host native byte order.
TCG_RESULT
TCG_RESULT EFIAPI OpalGetSupportedAttributesInfo(OPAL_SESSION *Session, OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, UINT16 *OpalBaseComId)
BOOLEAN EFIAPI OpalFeatureSupported(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes)
TCG_RESULT EFIAPI OpalSetPassword(OPAL_SESSION *Session, TCG_UID CpinRowUid, const VOID *NewPin, UINT32 NewPinLength, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilGetActiveDataRemovalMechanism(OPAL_SESSION *Session, const VOID *GeneratedSid, UINT32 SidLength, UINT8 *ActiveDataRemovalMechanism)
TCG_RESULT EFIAPI OpalUtilSetAdminPasswordAsSid(OPAL_SESSION *AdminSpSession, const VOID *GeneratedSid, UINT32 SidLength, const VOID *Password, UINT32 PassLength)
TCG_RESULT EFIAPI OpalSetLockingSpAuthorityEnabledAndPin(OPAL_SESSION *LockingSpSession, TCG_UID CpinRowUid, TCG_UID AuthorityUid, const VOID *NewPin, UINT32 NewPinLength, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilSecureErase(OPAL_SESSION *LockingSpSession, const VOID *Password, UINT32 PasswordLength, BOOLEAN *PasswordFailed)
TCG_RESULT EFIAPI OpalBlockSid(OPAL_SESSION *Session, BOOLEAN HardwareReset)
TCG_RESULT EFIAPI OpalUtilUpdateGlobalLockingRange(OPAL_SESSION *LockingSpSession, const VOID *Password, UINT32 PasswordLength, BOOLEAN ReadLocked, BOOLEAN WriteLocked)
TCG_RESULT EFIAPI OpalUtilSetSIDtoMSID(OPAL_SESSION *AdminSpSession, const VOID *Password, UINT32 PasswordLength, UINT8 *Msid, UINT32 MsidLength)
TCG_RESULT EFIAPI OpalGetLockingInfo(OPAL_SESSION *Session, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)
TCG_RESULT EFIAPI OpalEndSession(OPAL_SESSION *Session)
TCG_RESULT EFIAPI OpalSetLockingRange(OPAL_SESSION *LockingSpSession, TCG_UID LockingRangeUid, UINT64 RangeStart, UINT64 RangeLength, BOOLEAN ReadLockEnabled, BOOLEAN WriteLockEnabled, BOOLEAN ReadLocked, BOOLEAN WriteLocked, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalGetTryLimit(OPAL_SESSION *LockingSpSession, TCG_UID RowUid, UINT32 *TryLimit)
TCG_RESULT EFIAPI OpalStartSession(OPAL_SESSION *Session, TCG_UID SpId, BOOLEAN Write, UINT32 HostChallengeLength, const VOID *HostChallenge, TCG_UID HostSigningAuthority, UINT8 *MethodStatus)
BOOLEAN OpalDeviceLocked(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)
TCG_RESULT EFIAPI OpalUtilVerifyPassword(OPAL_SESSION *LockingSpSession, const VOID *Password, UINT32 PasswordLength, TCG_UID HostSigningAuthority)
TCG_RESULT EFIAPI OpalGetMsid(OPAL_SESSION *AdminSpSession, UINT32 MsidBufferSize, UINT8 *Msid, UINT32 *MsidLength)
TCG_RESULT EFIAPI OpalParseRetrieveGlobalLockingRangeActiveKey(TCG_PARSE_STRUCT *ParseStruct, TCG_UID *ActiveKey)
TCG_RESULT EFIAPI OpalRetrieveLevel0DiscoveryHeader(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress)
TCG_RESULT EFIAPI OpalActivateLockingSp(OPAL_SESSION *AdminSpSession, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilDisableUser(OPAL_SESSION *LockingSpSession, const VOID *Password, UINT32 PasswordLength, BOOLEAN *PasswordFailed)
BOOLEAN EFIAPI OpalUtilAdminPasswordExists(IN UINT16 OwnerShip, IN TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)
TCG_RESULT EFIAPI OpalUtilSetAdminPassword(OPAL_SESSION *AdminSpSession, const VOID *OldPassword, UINT32 OldPasswordLength, const VOID *NewPassword, UINT32 NewPasswordLength)
TCG_RESULT EFIAPI OpalCreateRetrieveGlobalLockingRangeActiveKey(const OPAL_SESSION *Session, TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size)
OPAL_OWNER_SHIP EFIAPI OpalUtilDetermineOwnership(OPAL_SESSION *Session, UINT8 *Msid, UINT32 MsidLength)
TCG_RESULT EFIAPI OpalRetrieveSupportedProtocolList(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress)
TCG_RESULT EFIAPI OpalAdminRevert(OPAL_SESSION *LockingSpSession, BOOLEAN KeepUserData, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalDisableUser(OPAL_SESSION *LockingSpSession, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilRevert(OPAL_SESSION *LockingSpSession, BOOLEAN KeepUserData, const VOID *Password, UINT32 PasswordLength, BOOLEAN *PasswordFailed, UINT8 *Msid, UINT32 MsidLength)
TCG_RESULT EFIAPI OpalGlobalLockingRangeGenKey(OPAL_SESSION *LockingSpSession, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilGetDataRemovalMechanismLists(IN OPAL_SESSION *Session, OUT UINT32 *RemovalMechanismLists)
TCG_RESULT EFIAPI OpalPsidRevert(OPAL_SESSION *AdminSpSession)
TCG_RESULT EFIAPI OpalUtilPsidRevert(OPAL_SESSION *AdminSpSession, const VOID *Psid, UINT32 PsidLength)
TCG_RESULT EFIAPI OpalUtilGetMsid(OPAL_SESSION *Session, UINT8 *Msid, UINT32 MsidBufferLength, UINT32 *MsidLength)
TCG_RESULT EFIAPI OpalUpdateGlobalLockingRange(OPAL_SESSION *LockingSpSession, BOOLEAN ReadLocked, BOOLEAN WriteLocked, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalUtilSetUserPassword(OPAL_SESSION *LockingSpSession, const VOID *OldPassword, UINT32 OldPasswordLength, const VOID *NewPassword, UINT32 NewPasswordLength)
TCG_RESULT EFIAPI OpalUtilSetOpalLockingRange(OPAL_SESSION *LockingSpSession, const VOID *Password, UINT32 PassLength, TCG_UID LockingRangeUid, UINT64 RangeStart, UINT64 RangeLength, BOOLEAN ReadLockEnabled, BOOLEAN WriteLockEnabled, BOOLEAN ReadLocked, BOOLEAN WriteLocked)
BOOLEAN EFIAPI OpalFeatureEnabled(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)