Skip to content

Commit

Permalink
default session key to 12345 if command line switch is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Mar 31, 2022
1 parent 171e2a5 commit b9241bd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ BraveSessionCache::BraveSessionCache(ExecutionContext& context)
.Utf8();
if (domain.empty())
return;

base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
DCHECK(cmd_line->HasSwitch(kBraveSessionToken));
base::StringToUint64(cmd_line->GetSwitchValueASCII(kBraveSessionToken),
base::StringToUint64(cmd_line->HasSwitch(kBraveSessionToken)
? cmd_line->GetSwitchValueASCII(kBraveSessionToken)
// https://github.com/brave/brave-browser/issues/22021
: "12345",
&session_key_);

crypto::HMAC h(crypto::HMAC::SHA256);
CHECK(h.Init(reinterpret_cast<const unsigned char*>(&session_key_),
sizeof session_key_));
Expand Down

0 comments on commit b9241bd

Please sign in to comment.