Skip to content

Commit

Permalink
disable hash superkey after reset key
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Jul 31, 2024
1 parent 4455d14 commit 6ea388d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/base/predata.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int auth_superkey(const char *key)
int len = SHA256_BLOCK_SIZE > ROOT_SUPER_KEY_HASH_LEN ? ROOT_SUPER_KEY_HASH_LEN : SHA256_BLOCK_SIZE;
rc = lib_memcmp(root_superkey, hash, len);

static int first_time = 1;
static bool first_time = true;
if (!rc && first_time) {
first_time = 0;
reset_superkey(key);
Expand All @@ -52,6 +52,7 @@ void reset_superkey(const char *key)
{
lib_strncpy(superkey, key, SUPER_KEY_LEN - 1);
superkey[SUPER_KEY_LEN - 1] = '\0';
enable_root_key = false;
dsb(ish);
}

Expand Down

0 comments on commit 6ea388d

Please sign in to comment.