!339 bug:扫碰错误码/重复功能代码/设备下线不具备通过networkid查寻所新增的map/pin码

Merge pull request !339 from wuqi/master
This commit is contained in:
openharmony_ci
2022-03-09 06:03:54 +00:00
committed by Gitee
+7 -2
View File
@@ -16,6 +16,7 @@
#include "pin_auth.h"
#include <memory>
#include <cstring>
#include "dm_constants.h"
#include "dm_log.h"
@@ -65,14 +66,18 @@ int32_t PinAuth::StartAuth(std::string &authToken, std::shared_ptr<DmAuthManager
int32_t PinAuth::VerifyAuthentication(std::string &authToken, const std::string &authParam)
{
times_ += 1;
nlohmann::json authParamJson = nlohmann::json::parse(authParam, nullptr, false);
if (authParamJson.is_discarded()) {
if (strlen(authParam.c_str()) == 1) {
if (authParam == "0") {
return DM_OK;
}
LOGE("Peer rejection");
return DM_FAILED;
}
nlohmann::json authParamJson = nlohmann::json::parse(authParam, nullptr, false);
if (authParamJson.is_discarded()) {
LOGE("DecodeRequestAuth jsonStr error");
return DM_FAILED;
}
nlohmann::json authTokenJson = nlohmann::json::parse(authToken, nullptr, false);
if (authTokenJson.is_discarded()) {
LOGE("DecodeRequestAuth jsonStr error");