mirror of
https://github.com/openharmony/device_manager.git
synced 2026-07-20 21:58:27 -04:00
!339 bug:扫碰错误码/重复功能代码/设备下线不具备通过networkid查寻所新增的map/pin码
Merge pull request !339 from wuqi/master
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user