Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Common/DtaDev.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ class DtaDev {
virtual uint8_t loadPBA(char * password, char * filename) = 0;
/** Change the locking state of a locking range
* @param lockingrange The number of the locking range (0 = global)
* @param lockingstate the locking state to set
* @param Admin1Password password of administrative authority for locking range
* @param lockingstate The locking state to set
* @param userid The userid which will lock/unlock the locking range
* @param password Password of the authority for locking range
*/
virtual uint8_t setLockingRange(uint8_t lockingrange, uint8_t lockingstate,
char * Admin1Password) = 0;
const char *userid, char * password) = 0;
/** Change the locking state of a locking range in Single User Mode
* @param lockingrange The number of the locking range (0 = global)
* @param lockingstate the locking state to set
Expand Down Expand Up @@ -201,9 +202,10 @@ class DtaDev {
virtual uint8_t setBandsEnabled(int16_t rangeid, char * password) = 0;
/** Primitive to set the MBRDone flag.
* @param state 0 or 1
* @param Admin1Password Locking SP authority with access to flag
* @param userid the authority name
* @param password Locking SP authority with access to flag
*/
virtual uint8_t setMBRDone(uint8_t state, char * Admin1Password) = 0;
virtual uint8_t setMBRDone(uint8_t state, const char *userid, char * password) = 0;
/** Primitive to set the MBREnable flag.
* @param state 0 or 1
* @param Admin1Password Locking SP authority with access to flag
Expand Down Expand Up @@ -283,6 +285,11 @@ class DtaDev {
virtual uint8_t exec(DtaCommand * cmd, DtaResponse & resp, uint8_t protocol = 0x01) = 0;
/** return the communications ID to be used for sessions to this device */
virtual uint16_t comID() = 0;
/** Add the UserX authority to Locking (Rd/RW) ACEs
* @param userid The user to add to Locking ACEs
* @param Admin1Password Password of the LockingSP authority
*/
virtual uint8_t addUserToLockingACEs(const char *userid, char* Admin1Password) = 0;
bool no_hash_passwords; /** disables hashing of passwords */
sedutiloutput output_format; /** standard, readable, JSON */
protected:
Expand Down
15 changes: 11 additions & 4 deletions Common/DtaDevEnterprise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ uint8_t DtaDevEnterprise::initialSetup(char * password)
return lastRC;
}
if ((lastRC = setLockingRange(0,
OPAL_LOCKINGSTATE::READWRITE, password)) != 0) {
OPAL_LOCKINGSTATE::READWRITE, "Admin1", password)) != 0) {
LOG(E) << "Initial setup failed - unable to unlock for read/write";
return lastRC;
}
Expand Down Expand Up @@ -478,10 +478,10 @@ uint8_t DtaDevEnterprise::setMBREnable(uint8_t mbrstate, char * Admin1Password)
LOG(D1) << "Exiting DtaDevEnterprise::setMBREnable";
return 0;
}
uint8_t DtaDevEnterprise::setMBRDone(uint8_t mbrstate, char * Admin1Password)
uint8_t DtaDevEnterprise::setMBRDone(uint8_t mbrstate, const char *userid, char * password)
{
LOG(D1) << "Entering DtaDevEnterprise::setMBRDone";
if (NULL == Admin1Password) { LOG(E) << "This shouldn't happen " << mbrstate; }
if (NULL == password) { LOG(E) << "This shouldn't happen " << mbrstate; }
LOG(I) << "MBR shadowing is optional in the Enterprise SSC and not supported";
LOG(D1) << "Exiting DtaDevEnterprise::setMBRDone";
return 0;
Expand Down Expand Up @@ -757,7 +757,7 @@ uint8_t DtaDevEnterprise::listLockingRanges(char * password, int16_t rangeid)
}

uint8_t DtaDevEnterprise::setLockingRange(uint8_t lockingrange, uint8_t lockingstate,
char * password)
const char *userid, char * password)
{
LOG(D1) << "Entering DtaDevEnterprise::setLockingRange";
uint8_t lastRC;
Expand Down Expand Up @@ -1677,6 +1677,13 @@ uint8_t DtaDevEnterprise::objDump(char *sp, char * auth, char *pass,
LOG(D1) << "Exiting DtaDevEnterprise::objDump";
return 0;
}
uint8_t DtaDevEnterprise::addUserToLockingACEs(const char *userid, char * Admin1Password)
{
LOG(D1) << "Entering DtaDevEnterprise::addUserLockingACEs";
LOG(I) << "Enable User1 Locking ACES in the Enterprise SSC is not supported";
LOG(D1) << "Exiting DtaDevEnterprise::addUserLockingACEs";
return 0;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
10 changes: 8 additions & 2 deletions Common/DtaDevEnterprise.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DtaDevEnterprise : public DtaDevOS {
* @param state 0 or 1
* @param Admin1Password Locking SP authority with access to flag
*/
uint8_t setMBRDone(uint8_t state, char * Admin1Password);
uint8_t setMBRDone(uint8_t state, const char *userid, char * password);
/** Primitive to set the MBREnable flag.
* @param state 0 or 1
* @param Admin1Password Locking SP authority with access to flag
Expand All @@ -129,7 +129,7 @@ class DtaDevEnterprise : public DtaDevOS {
/** dummy code not implemented in the enterprise SSC*/
uint8_t setNewPassword_SUM(char * password, char * userid, char * newpassword);
uint8_t setLockingRange(uint8_t lockingrange, uint8_t lockingstate,
char * password);
const char *userid, char * password);
/** dummy code not implemented in the enterprise SSC*/
uint8_t setLockingRange_SUM(uint8_t lockingrange, uint8_t lockingstate,
char * password);
Expand Down Expand Up @@ -205,6 +205,12 @@ class DtaDevEnterprise : public DtaDevOS {
uint8_t rawCmd(char *sp, char *hexauth, char *pass,
char *hexinvokingUID, char *hexmethod, char *hexparms);

/** Add the UserX authority to Locking (Rd/RW) ACEs
* @param userid The user to add to Locking ACEs
* @param Admin1Password Password of the LockingSP authority
*/
uint8_t addUserToLockingACEs(const char *userid, char *Admin1Password);

protected:
uint8_t getDefaultPassword();
private:
Expand Down
5 changes: 3 additions & 2 deletions Common/DtaDevGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ uint8NOCODE(setup_SUM, uint8_t lockingrange, uint64_t start, uint64_t length, ch
uint8NOCODE(setPassword,char * password, char * userid, char * newpassword)
uint8NOCODE(setNewPassword_SUM,char * password, char * userid, char * newpassword)
uint8NOCODE(setMBREnable,uint8_t mbrstate, char * Admin1Password)
uint8NOCODE(setMBRDone,uint8_t mbrstate, char * Admin1Password)
uint8NOCODE(setMBRDone,uint8_t mbrstate, const char *userid, char * password)
uint8NOCODE(setLockingRange,uint8_t lockingrange, uint8_t lockingstate,
char * Admin1Password)
const char *userid, char * password)
uint8NOCODE(setLockingRange_SUM, uint8_t lockingrange, uint8_t lockingstate,
char * password)
uint8NOCODE(setupLockingRange,uint8_t lockingrange, uint64_t start,
Expand All @@ -93,6 +93,7 @@ uint8NOCODE(eraseLockingRange_SUM, uint8_t lockingrange, char * password)
uint8NOCODE(takeOwnership, char * newpassword)
uint8NOCODE(setSIDPassword,char * oldpassword, char * newpassword,
uint8_t hasholdpwd, uint8_t hashnewpwd)
uint8NOCODE(addUserToLockingACEs, const char* userid, char * Admin1Password)
uint16_t DtaDevGeneric::comID()
{
LOG(E) << "Generic Device class does not support function " << "comID" << std::endl;
Expand Down
9 changes: 7 additions & 2 deletions Common/DtaDevGeneric.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class DtaDevGeneric : public DtaDevOS {
* @param Admin1Password password of administrative authority for locking range
*/
uint8_t setLockingRange(uint8_t lockingrange, uint8_t lockingstate,
char * Admin1Password) ;
const char *userid, char * password) ;
/** Change the locking state of a locking range in Single User Mode
* @param lockingrange The number of the locking range (0 = global)
* @param lockingstate the locking state to set
Expand Down Expand Up @@ -147,7 +147,7 @@ class DtaDevGeneric : public DtaDevOS {
* @param lockingrange locking range number
*/
uint8_t setBandsEnabled(int16_t rangeid, char * password);
uint8_t setMBRDone(uint8_t state, char * Admin1Password) ;
uint8_t setMBRDone(uint8_t state, const char *userid, char * password) ;
/** Primitive to set the MBREnable flag.
* @param state 0 or 1
* @param Admin1Password Locking SP authority with access to flag
Expand Down Expand Up @@ -224,4 +224,9 @@ class DtaDevGeneric : public DtaDevOS {
uint8_t exec(DtaCommand * cmd, DtaResponse & resp, uint8_t protocol = 1) ;
/** return the communications ID to be used for sessions to this device */
uint16_t comID() ;
/** Add the UserX authority to Locking (Rd/RW) ACEs
* @param userid The user to add to Locking ACEs
* @param Admin1Password Password of the LockingSP authority
*/
uint8_t addUserToLockingACEs(const char *userid, char *Admin1Password);
};
Loading