mirror of https://github.com/OpenVPN/openvpn-gui
fix:
1. Replace FLAG_SAVE_KEY_PASS instead of FLAG_DISABLE_SAVE_PASS in GenericPassDialogFun 2. Honor FLAG_DISABLE_SAVE_PASS flag in GenericPassDialogFunpull/753/head
parent
77deef95f0
commit
a17335b1b2
13
openvpn.c
13
openvpn.c
|
@ -890,6 +890,12 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
ID_TXT_DESCRIPTION,
|
||||
LoadLocalizedString(IDS_NFO_TOKEN_PASSWORD_REQUEST, param->id));
|
||||
|
||||
if (param->c->flags & FLAG_DISABLE_SAVE_PASS)
|
||||
{
|
||||
ShowWindow(GetDlgItem(hwndDlg, ID_CHK_SAVE_PASS), SW_HIDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RecallSmartCardPin(param->c->config_name, password))
|
||||
{
|
||||
SetDlgItemTextW(hwndDlg, ID_EDT_RESPONSE, password);
|
||||
|
@ -915,6 +921,7 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
SecureZeroMemory(password, sizeof(password));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteStatusLog(param->c, L"GUI> ", L"Unknown password request", false);
|
||||
|
@ -974,8 +981,8 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case ID_CHK_SAVE_PASS:
|
||||
param->c->flags ^= FLAG_SAVE_AUTH_PASS;
|
||||
if (param->c->flags & FLAG_SAVE_AUTH_PASS)
|
||||
param->c->flags ^= FLAG_SAVE_KEY_PASS;
|
||||
if (param->c->flags & FLAG_SAVE_KEY_PASS)
|
||||
{
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED);
|
||||
}
|
||||
|
@ -1043,7 +1050,7 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
ManagementCommandFromInput(param->c, fmt, hwndDlg, ID_EDT_RESPONSE);
|
||||
free(fmt);
|
||||
|
||||
if (param->flags & FLAG_PASS_TOKEN && param->c->flags & FLAG_SAVE_AUTH_PASS)
|
||||
if (param->flags & FLAG_PASS_TOKEN && param->c->flags & FLAG_SAVE_KEY_PASS)
|
||||
{
|
||||
SaveSmartCardPin(param->c->config_name, password);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue