Open liuligang opened 8 years ago
Hi, I want to know what is your SSD?
My SSD is Samsung SSD 850 EVO 120GB. I do the --query command and show following: OPAL 2.0 function (0x0203) Base comID = 0x1004, Initial PIN = 0x0 , Reverted PIN = 0x0 , comIDs = 1 Locking Admins = 4, Locking Users = 9, Range Crossing = N
It shows Locking Users = 9.
Did you ever figure this out?
I detailed said what I do caused by this mistake. ACE_Locking_Range0_Set _RdLocked_UID.Set[Values = [BooleanExpr = [User8 | User7 | User6 | User5 | User4_UID | User3_UID | User2_UID | User1_UID] ] ACE_Locking_Range0_Set _WrLocked_UID.Set[Values = [BooleanExpr = [User8 | User7 | User6 | User5 | User4_UID | User3_UID | User2_UID | User1_UID] ]
I add User1,User2,User3,User4,User5,User6,User7,User8 to access LockingRange0. I refer to the following content in the document. http://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage_Opal_SSC_Application_Note_1-00_1-00-Final.pdf
When I use User8,User7,User6,User5,Use4-the five users to access LockingRange0,I can use any one user(user8,user7,user6, user5,user4) to unlockinng range0. I can receive succeed. But when I use User3,User2,User1-the three users to access LockingRange0,there is not any one user(user3,user2,user1) in three users to unlockinng range0 . when I DEBUG the code of unlock the range by setting the Locked columns in the Locking table to false, I can receive the mistake of method status code TPER_MALFUNCTION.But I find the Payload DATAis right.
The following is my add users data packets. LR.push_back(OPAL_SHORT_ATOM::BYTESTRING8); for (int i = 0; i < 8; i++) { LR.push_back(OPALUID[OPAL_UID::OPAL_LOCKINGRANGE0_ACE_RDLOCKED][i]); } vector USER1;
USER1.push_back(OPAL_SHORT_ATOM::BYTESTRING8);
for (int i = 0; i < 8; i++)
{
USER1.push_back(OPALUID[OPAL_UID::OPAL_USER1_UID][i]);
}
vector HALF_UID_AUTHORITY;
HALF_UID_AUTHORITY.push_back(OPAL_SHORT_ATOM::BYTESTRING4);
for (int i = 0; i < 4; i++)
{
HALF_UID_AUTHORITY.push_back(OPALUID [OPAL_UID::OPAL_HALF_UID_AUTHORITY_OBJ_REF][i]);
}
vector HALF_UID_BOOLEAN;
HALF_UID_BOOLEAN.push_back(OPAL_SHORT_ATOM::BYTESTRING4);
for (int i = 0; i < 4; i++)
{
HALF_UID_BOOLEAN.push_back(OPALUID[OPAL_UID::OPAL_HALF_UID_BOOLEAN_ACE][i]);
}
session = new DtaSession(this); if (NULL == session) { LOG(E) << "Unable to create session object "; return DTAERROR_OBJECT_CREATE_FAILED; } if ((lastRC = session->start(OPAL_UID::OPAL_LOCKINGSP_UID, password, OPAL_UID::OPAL_ADMIN1_UID)) != 0) { delete session; return lastRC; }
DtaCommand *set_read = new DtaCommand(); if (NULL == set_read) { LOG(E) << "Unable to create command object "; delete session; return DTAERROR_OBJECT_CREATE_FAILED; } set_read->reset(OPAL_UID::OPAL_AUTHORITY_TABLE, OPAL_METHOD::SET); set_read->changeInvokingUid(LR); set_read->addToken(OPAL_TOKEN::STARTLIST); set_read->addToken(OPAL_TOKEN::STARTNAME); set_read->addToken(OPAL_TOKEN::VALUES); set_read->addToken(OPAL_TOKEN::STARTLIST); set_read->addToken(OPAL_TOKEN::STARTNAME); set_read->addToken(OPAL_TOKEN::OPAL_BOOLEAN_EXPR); set_read->addToken(OPAL_TOKEN::STARTLIST); for(int i=8; i>0; i--) { USER1[8] = i; set_read->addToken(OPAL_TOKEN::STARTNAME); set_read->addToken(HALF_UID_AUTHORITY); set_read->addToken(USER1); set_read->addToken(OPAL_TOKEN::ENDNAME); } for(int j =0; j<7; j++ ) { set_read->addToken(OPAL_TOKEN::STARTNAME); set_read->addToken(HALF_UID_BOOLEAN); set_read->addToken(UINT_01); set_read->addToken(OPAL_TOKEN::ENDNAME); }
set_read->addToken(OPAL_TOKEN::ENDLIST); set_read->addToken(OPAL_TOKEN::ENDNAME); set_read->addToken(OPAL_TOKEN::ENDLIST); set_read->addToken(OPAL_TOKEN::ENDNAME); set_read->addToken(OPAL_TOKEN::ENDLIST); set_read->complete();