Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support in LinuxPBA for also unlocking OPAL Enterprise SSC disks. #414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions LinuxPBA/UnlockSEDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ along with sedutil. If not, see <http://www.gnu.org/licenses/>.
#include "DtaDevGeneric.h"
#include "DtaDevOpal1.h"
#include "DtaDevOpal2.h"
#include "DtaDevEnterprise.h"

#include <dirent.h>
#include <fnmatch.h>
Expand Down Expand Up @@ -62,21 +63,23 @@ uint8_t UnlockSEDs(char * password) {
if (!tempDev->isPresent()) {
break;
}
if ((!tempDev->isOpal1()) && (!tempDev->isOpal2())) {
if (!tempDev->isAnySSC()) {
printf("Drive %-10s %-40s not OPAL \n", devref, tempDev->getModelNum());

delete tempDev;
continue;
}
if (tempDev->isOpal2())
d = new DtaDevOpal2(devref);
else
else if (tempDev->isOpal1())
d = new DtaDevOpal1(devref);
else
d = new DtaDevEnterprise(devref);
delete tempDev;
d->no_hash_passwords = false;
failed = 0;
if (d->Locked()) {
if (d->MBREnabled()) {
if (!d->isEprise() && d->MBREnabled()) {
if (d->setMBRDone(1, password)) {
failed = 1;
}
Expand Down