fix: Send AUTH to sub-master but generate wrong password

This commit is contained in:
yuanyuanxiang
2026-05-21 12:35:17 +02:00
parent e5bb405f79
commit da443283f2
3 changed files with 13 additions and 6 deletions

View File

@@ -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 私钥),而非被授权设备的原授权类型