Skip to content

Commit

Permalink
sed: update SED password when initalizing
Browse files Browse the repository at this point in the history
The SED key and kernel keyring were not being updated by the
initialization operation. Add password update after the other
initialization tasks are completed.

Signed-off-by: Greg Joyce <[email protected]>
  • Loading branch information
gjoyce-ibm authored and igaw committed Mar 28, 2024
1 parent 7c0dac0 commit 743c232
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plugins/sed/sedopal_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ int sedopal_cmd_initialize(int fd)
struct opal_key key;
struct opal_lr_act lr_act = {};
struct opal_user_lr_setup lr_setup = {};
struct opal_new_pw new_pw = {};

sedopal_ask_key = true;
sedopal_ask_new_key = true;
Expand Down Expand Up @@ -218,6 +219,21 @@ int sedopal_cmd_initialize(int fd)
return rc;
}

/*
* set password
*/
new_pw.new_user_pw.who = OPAL_ADMIN1;
new_pw.new_user_pw.opal_key.lr = 0;
new_pw.session.who = OPAL_ADMIN1;
new_pw.session.sum = 0;
new_pw.session.opal_key.lr = 0;
new_pw.session.opal_key = key;
new_pw.new_user_pw.opal_key = key;

rc = ioctl(fd, IOC_OPAL_SET_PW, &new_pw);
if (rc != 0)
fprintf(stderr, "Error: failed setting password - %d\n", rc);

return rc;
}

Expand Down

0 comments on commit 743c232

Please sign in to comment.