diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 67b6a03..afabec7 100644 Binary files a/server/2015Remote/2015Remote.rc and b/server/2015Remote/2015Remote.rc differ diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp index 4e7b30c..b572532 100644 --- a/server/2015Remote/2015RemoteDlg.cpp +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -3139,8 +3139,10 @@ void CMy2015RemoteDlg::OnToolInputPassword() CInputDialog dlg(this); dlg.m_str = pwd; dlg.Init("更改口令", "请输入新的口令:"); + dlg.Init2("HMAC (非必须):", THIS_CFG.GetStr("settings", "HMAC", "").c_str()); if (dlg.DoModal() == IDOK) { THIS_CFG.SetStr("settings", "Password", dlg.m_str.GetString()); + THIS_CFG.SetStr("settings", "HMAC", dlg.m_sSecondInput.GetString()); #ifdef _DEBUG SetTimer(TIMER_CHECK, 10 * 1000, NULL); #else @@ -3613,7 +3615,7 @@ LRESULT CALLBACK CMy2015RemoteDlg::LowLevelKeyboardProc(int nCode, WPARAM wParam } } } - else if (g_2015RemoteDlg->m_pActiveSession) + else if (g_2015RemoteDlg->m_pActiveSession && operateWnd) { auto screen = (CScreenSpyDlg*)(g_2015RemoteDlg->m_pActiveSession); if (!screen->m_bIsCtrl) { diff --git a/server/2015Remote/CPasswordDlg.cpp b/server/2015Remote/CPasswordDlg.cpp index 7a9e08c..5827a42 100644 --- a/server/2015Remote/CPasswordDlg.cpp +++ b/server/2015Remote/CPasswordDlg.cpp @@ -164,6 +164,7 @@ void CPwdGenDlg::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_EDIT_HOSTNUM, m_EditHostNum); DDX_Text(pDX, IDC_EDIT_HOSTNUM, m_nHostNum); DDV_MinMaxInt(pDX, m_nHostNum, 2, 10000); + DDX_Control(pDX, IDC_EDIT_HMAC, m_EditHMAC); } @@ -197,9 +198,12 @@ void CPwdGenDlg::OnBnClickedButtonGenkey() std::string hardwareID = getHardwareID(); std::string hashedID = hashSHA256(hardwareID); std::string deviceID = getFixedLengthID(hashedID); + std::string hmac = genHMAC(pwdHash, m_sUserPwd.GetString()); + m_EditHMAC.SetWindowTextA(hmac.c_str()); if (deviceID == m_sDeviceID.GetString()) { // 授权的是当前主控程序 auto settings = "settings", pwdKey = "Password"; THIS_CFG.SetStr(settings, pwdKey, fixedKey.c_str()); + THIS_CFG.SetStr(settings, "HMAC", hmac); } } diff --git a/server/2015Remote/CPasswordDlg.h b/server/2015Remote/CPasswordDlg.h index df9a5d6..421b563 100644 --- a/server/2015Remote/CPasswordDlg.h +++ b/server/2015Remote/CPasswordDlg.h @@ -76,4 +76,5 @@ public: virtual BOOL OnInitDialog(); CEdit m_EditHostNum; int m_nHostNum; + CEdit m_EditHMAC; }; diff --git a/server/2015Remote/resource.h b/server/2015Remote/resource.h index dc39aee..6149df6 100644 Binary files a/server/2015Remote/resource.h and b/server/2015Remote/resource.h differ