fix: Send AUTH to sub-master but generate wrong password
This commit is contained in:
@@ -1867,6 +1867,7 @@ BOOL CMy2015RemoteDlg::OnInitDialog()
|
||||
}
|
||||
|
||||
THIS_CFG.SetStr("settings", "PwdHash", GetPwdHash());
|
||||
THIS_CFG.SetStr("settings", "UpperHash", GetUpperHash());
|
||||
THIS_CFG.SetStr("settings", "MasterHash", GetMasterHash());
|
||||
THIS_CFG.SetStr("settings", "Version", VERSION_STR);
|
||||
|
||||
@@ -5507,6 +5508,7 @@ VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
std::string("-") + getFixedLengthID(finalKey);
|
||||
memcpy(devId, fixedKey.c_str(), fixedKey.length());
|
||||
devId[fixedKey.length()] = 0;
|
||||
Mprintf("Request AUTH: SN= %s, Password= %s\n", deviceID.c_str(), fixedKey.c_str());
|
||||
|
||||
// 检查该设备原授权是 V1 还是 V2
|
||||
std::string origPasscode, origHmac, origRemark;
|
||||
@@ -5541,6 +5543,7 @@ VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
|
||||
memcpy(resp + 64, hmac.c_str(), hmac.length());
|
||||
resp[64+hmac.length()] = 0;
|
||||
resp[64 + hmac.length() + 1] = 0;
|
||||
|
||||
// 构建 Authorization(多层授权)- 让下级主控知道向谁进行授权校验
|
||||
// 注意:isV2Auth 判断的是当前服务端是否是授权服务器(有 V2 私钥),而非被授权设备的原授权类型
|
||||
|
||||
@@ -585,6 +585,7 @@ std::string signPasswordV2(const std::string& deviceId, const std::string& passw
|
||||
// 签名
|
||||
BYTE signature[V2_SIGNATURE_SIZE];
|
||||
if (!SignMessageV2(privateKeyFile, (const BYTE*)payload.c_str(), (int)payload.length(), signature)) {
|
||||
Mprintf("signPasswordV2: SignMessageV2 failed: %s\n", payload.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -640,7 +641,7 @@ std::string signAuthorizationV2(const std::string& license, const std::string& s
|
||||
|
||||
BYTE signature[V2_SIGNATURE_SIZE];
|
||||
if (!SignMessageV2(privateKeyFile, (const BYTE*)payload.c_str(), (int)payload.length(), signature)) {
|
||||
Mprintf("signAuthorizationV2: SignMessageV2 failed\n");
|
||||
Mprintf("signAuthorizationV2: SignMessageV2 failed: %s\n", license.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user