UCT04_ActivateLockingSP(dir, &itemStr) { var logFileName, fd; var testResult; var MSC; var LockingSPLCS; var LockingSPLCSName; var Admin1PinVal; c::sprintf(logFileName, "%s/%s.log", dir, __FUNCTION__); fd = c::fopen(logFileName, "w"); dev::cleanCmdHistory(); itemStr = "UCT-04: Activate Locking SP"; c::util::logPrintf(fd, "%s\n\n", itemStr); testResult = 1; c::util::logPrintf(fd, "Prerequisites:\n\n"); c::util::logPrintf(fd, "Get the life cycle state of Locking SP"); wd.session.init(); // in order to make HSN as 0x00000001 in the following session LockingSPLCS = AdminSP_Anybody_GetLockingSPLifeCycleStateByASession(1, fd, wd); LockingSPLCSName = GetSPLifeCycleStateName(LockingSPLCS); c::util::logPrintf(fd, "\nLocking SP LifeCycleState = %d (%s)!\n\n\n", LockingSPLCS, LockingSPLCSName); if (LockingSPLCS == SP_LCS_Manufactured_Inactive) { // // Activate LockingSP // c::util::logPrintf(fd, "Test Sequence:\n\n"); // 1) Invoke StartSession method with SPID = Admin SP UID and HostSigningAuthority = SID authority UID c::util::logPrintf(fd, "1) Invoke StartSession method with SPID = Admin SP UID and HostSigningAuthority = SID authority UID\n"); c::util::logPrintf(fd, "2) Invoke Activate method on Locking SP object\n"); c::util::logPrintf(fd, "3) CLOSE_SESSION\n"); wd.session.init(); // in order to make HSN as 0x00000001 in the following session $1 = latestSetupRecords_g.GetRec_SIDPinValue(); testResult = AdminSP_SID_ActivateLockingSPByASession(cMessageLevel_detail, fd, wd, $1); if (!testResult) { c::util::logPrintf(fd, "Error: Fail to activate LockingSP!\n"); goto LLL_return; } c::util::logPrintf(fd, "\n\n"); // Start a session to LockingSP with Authority as Admin1. // If the spec. is Pyrite 1.00 or Pyrite 2.00, the PIN value of Admin1 in LockingSP is SID. // If the spec. is Opal 1.00 or Opal 2.00, the PIN value of Admin1 in LockingSP is SID or MSID. // Opal 1.00 // // 5.2.1.1 Side effects of Activate // Upon successful activation of an SP that was in the 'Manufactured-Inactive' state, the following changes // SHALL be made: // * The LifeCycleState column of SP’s object in the Admin SP’s SP table SHALL change to 'Manufactured'. // * The current SID PIN (C_PIN_SID) in the Admin SP is copied into the PIN column of Admin1’s C_PIN // credential (C_PIN_Admin1) in the activated SP. This allows for taking ownership of the SP with a // known PIN credential. // Opal 2.00 // // 5.1.1.2 Side effects of Activate // Upon successful activation of an SP that was in the 'Manufactured-Inactive' state, the following changes SHALL be // made: // * The LifeCycleState column of SP’s object in the Admin SP’s SP table SHALL change to 'Manufactured'. // * The current SID PIN (C_PIN_SID) in the Admin SP is copied into the PIN column of Admin1’s C_PIN credential // (C_PIN_Admin1) in the activated SP. This allows for taking ownership of the SP with a known PIN credential. // 4) Invoke StartSession method with SPID = Locking SP UID and HostSigningAuthority = Admin1 authority UID c::util::logPrintf(fd, "4) Invoke StartSession method with SPID = Locking SP UID and HostSigningAuthority = Admin1 authority UID"); if (bTPerLockingSPInitStateIsManufacturedInactive_g) { //LockingSP's Admin1 PIN value = SID's PIN value Admin1PinVal = latestSetupRecords_g.GetRec_SIDPinValue(); } else { //LockingSP's Admin1 PIN value = MSID's PIN value Admin1PinVal = latestSetupRecords_g.GetRec_MSIDPinValue(); } wd.session.init(); latestSetupRecords_g.SetRec_LockingSPAdmin1PinValue(Admin1PinVal); wd.goNewSession(UID_LockingSP, 1, UID_LockingSP_AuthorityTable_Admin1, Admin1PinVal); MSC = StartSession(cMessageLevel_detail, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (MSC != MSC_SUCCESS) { PromptStartSessionFailed(fd, wd.session); goto LLL_return; } c::util::logPrintf(fd, "\n"); // 5) CLOSE_SESSION c::util::logPrintf(fd, "5) CLOSE_SESSION\n"); if (!EndOfSession(cMessageLevel_detail, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "Error: Fail to close the session!\n"); testResult = 0; } } tag LLL_return: c::util::logPrintf(fd, "\nTest Result: %s\n", testResult ? "PASS" : "FAIL"); c::fclose(fd); return (testResult ? TR_PASS : TR_FAIL); }