Skip to content

Commit

Permalink
kptools with -s instead of -S, to avoide side-channel detection
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Jul 31, 2024
1 parent b8deb49 commit ec82432
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/base/predata.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static struct patch_symbol *patch_symbol = 0;
static const char bstr[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

static uint64_t _rand_next = 1000000007;
static bool enable_root_key = true;
static bool enable_root_key = false;

int auth_superkey(const char *key)
{
Expand Down Expand Up @@ -114,8 +114,11 @@ void predata_init()
if (*(uint64_t *)(superkey)) _rand_next *= *(uint64_t *)(superkey);
if (*(uint64_t *)(root_superkey)) _rand_next *= *(uint64_t *)(root_superkey);

enable_root_key = false;

// random key
if (lib_strnlen(superkey, SUPER_KEY_LEN) <= 0) {
enable_root_key = true;
int len = SUPER_KEY_LEN > 16 ? 16 : SUPER_KEY_LEN;
len--;
for (int i = 0; i < len; ++i) {
Expand Down

0 comments on commit ec82432

Please sign in to comment.