Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-7831
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Sep 12, 2023
1 parent 5660689 commit 1d14018
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/OpenRoamin_GlobalReach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ namespace OpenWifi {
auto F=[&](const ProvObjects::GLBLRAccountInfo &Info) {
poco_information(Logger(),fmt::format("Adding {} to cache.",Info.info.name));
if(!Info.privateKey.empty() && !Info.GlobalReachAcctId.empty() ) {
DBGLINE
MakeToken(Info.GlobalReachAcctId, Info.privateKey);
DBGLINE
}
return true;
};
Expand Down Expand Up @@ -160,10 +162,13 @@ namespace OpenWifi {
Poco::SharedPtr<Poco::Crypto::ECKey> Key;
auto KeyHash = Utils::ComputeHash(PrivateKey);
auto KeyHint = PrivateKeys_.find(GlobalReachAccountId);
DBGLINE
if (KeyHint != PrivateKeys_.end() && KeyHint->first == KeyHash) {
DBGLINE
Key = KeyHint->second.second;
} else {
if (PrivateKey.empty()) {
DBGLINE
return "";
}
Poco::TemporaryFile F;
Expand All @@ -174,6 +179,7 @@ namespace OpenWifi {
new Poco::Crypto::ECKey("", F.path(), ""));
Key = NewKey;
PrivateKeys_[GlobalReachAccountId] = std::make_pair(KeyHash, NewKey);
DBGLINE
}

Poco::JWT::Signer Signer;
Expand Down

0 comments on commit 1d14018

Please sign in to comment.