Skip to content

Commit

Permalink
resolve redefinition of masterkey
Browse files Browse the repository at this point in the history
  • Loading branch information
tttttangTH committed Aug 26, 2020
1 parent d83733c commit 5694906
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rest/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ void Resource::PutCurrentNetworkCallback(const Request &aRequest, Response &aRes
std::string requestBody;
otExtendedPanId extPanid;
long panid;
std::string masterKey, prefix, extPanId, networkName, panId;
std::string masterkey, prefix, extPanId, networkName, panId;
int32_t channel;
char * endptr;
bool defaultRoute;
Expand All @@ -528,7 +528,7 @@ void Resource::PutCurrentNetworkCallback(const Request &aRequest, Response &aRes

requestBody = aRequest.GetBody();

VerifyOrExit(Json::JsonString2String(requestBody, std::string("masterKey"), masterKey),
VerifyOrExit(Json::JsonString2String(requestBody, std::string("masterKey"), masterkey),
error = PostError::kPostBadRequest, errorDescription = "Failed at decode json : masterKey");
VerifyOrExit(Json::JsonString2Bool(requestBody, std::string("defaultRoute"), defaultRoute),
error = PostError::kPostBadRequest, errorDescription = "Failed at decode json : defaultRoute");
Expand All @@ -542,7 +542,7 @@ void Resource::PutCurrentNetworkCallback(const Request &aRequest, Response &aRes
errorDescription = "Failed at decode json : channel");
VerifyOrExit(Json::JsonString2String(requestBody, std::string("panId"), panId), error = PostError::kPostBadRequest,
errorDescription = "Failed at decode json : panId");
VerifyOrExit(otbr::Utils::Hex2Bytes(masterKey.c_str(), masterKey.m8, sizeof(masterKey.m8)) == OT_MASTER_KEY_SIZE,
VerifyOrExit(otbr::Utils::Hex2Bytes(masterkey.c_str(), masterKey.m8, sizeof(masterKey.m8)) == OT_MASTER_KEY_SIZE,
error = PostError::kPostBadRequest, errorDescription = "Failed at encode masterkey : not valid");

// Set Master Key
Expand Down

0 comments on commit 5694906

Please sign in to comment.