diff --git a/Makefile.am b/Makefile.am index ded9a66..d526be7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -91,6 +91,7 @@ openvpn_gui_SOURCES = \ openvpn_config.h \ access.c access.h \ chartable.h \ + save_pass.c save_pass.h \ openvpn-gui-res.h openvpn_gui_LDFLAGS = -mwindows diff --git a/main.c b/main.c index 2f7b293..e115ea8 100644 --- a/main.c +++ b/main.c @@ -48,6 +48,7 @@ #include "localization.h" #include "manage.h" #include "misc.h" +#include "save_pass.h" #ifndef DISABLE_CHANGE_PASSWORD #include @@ -355,6 +356,9 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM if ( (LOWORD(wParam) >= IDM_EDITMENU) && (LOWORD(wParam) < IDM_EDITMENU + MAX_CONFIGS) ) { EditConfig(LOWORD(wParam) - IDM_EDITMENU); } + if ( (LOWORD(wParam) >= IDM_CLEARPASSMENU) && (LOWORD(wParam) < IDM_CLEARPASSMENU + MAX_CONFIGS) ) { + DisablePasswordSave(&o.conn[LOWORD(wParam) - IDM_CLEARPASSMENU]); + } #ifndef DISABLE_CHANGE_PASSWORD if ( (LOWORD(wParam) >= IDM_PASSPHRASEMENU) && (LOWORD(wParam) < IDM_PASSPHRASEMENU + MAX_CONFIGS) ) { ShowChangePassphraseDialog(&o.conn[LOWORD(wParam) - IDM_PASSPHRASEMENU]); diff --git a/main.h b/main.h index a75f193..1a16a73 100644 --- a/main.h +++ b/main.h @@ -111,6 +111,8 @@ __snprintf_0(char *buf, size_t size, char *format, ...) } while(0) void PrintDebugMsg(TCHAR *msg); +#else +#define PrintDebug(...) do { } while(0) #endif DWORD GetDllVersion(LPCTSTR lpszDllName); diff --git a/misc.c b/misc.c index 4ebfb84..8ed98c4 100644 --- a/misc.c +++ b/misc.c @@ -359,7 +359,7 @@ InitSemaphore (void) semaphore = CreateSemaphore (NULL, 1, 1, NULL); if (!semaphore) { - MessageBoxW (NULL, L"PACKAGE_NAME", L"Error creating semaphore", MB_OK); + MessageBoxW (NULL, L"Error creating semaphore", TEXT(PACKAGE_NAME), MB_OK); #ifdef DEBUG PrintDebug (L"InitSemaphore: CreateSemaphore failed [error = %lu]", GetLastError()); #endif diff --git a/openvpn-gui-res.h b/openvpn-gui-res.h index 8057f0c..8f7b478 100644 --- a/openvpn-gui-res.h +++ b/openvpn-gui-res.h @@ -60,6 +60,7 @@ #define ID_DLG_AUTH_CHALLENGE 183 #define ID_TXT_AUTH_CHALLENGE 184 #define ID_EDT_AUTH_CHALLENGE 185 +#define ID_CHK_SAVE_PASS 186 /* Proxy Settings Dialog */ #define ID_DLG_PROXY 200 @@ -114,6 +115,7 @@ #define IDS_MENU_SERVICEONLY_RESTART 1021 #define IDS_MENU_ASK_STOP_SERVICE 1022 #define IDS_MENU_IMPORT 1023 +#define IDS_MENU_CLEARPASS 1024 /* LogViewer Dialog */ #define IDS_ERR_START_LOG_VIEWER 1101 @@ -264,4 +266,7 @@ #define IDS_ERR_IMPORT_FAILED 1902 #define IDS_NFO_IMPORT_SUCCESS 1903 +/* Save password related messages */ +#define IDS_NFO_DELETE_PASS 2001 + #endif diff --git a/openvpn.c b/openvpn.c index 3e8f186..d048d5d 100644 --- a/openvpn.c +++ b/openvpn.c @@ -47,6 +47,7 @@ #include "localization.h" #include "misc.h" #include "access.h" +#include "save_pass.h" #define WM_OVPN_STOP (WM_APP + 10) #define WM_OVPN_SUSPEND (WM_APP + 11) @@ -200,6 +201,10 @@ OnStateChange(connection_t *c, char *data) if (c->failed_psw_attempts >= o.psw_attempts - 1) ManagementCommand(c, "auth-retry none", NULL, regular); + if (strcmp(message, "auth-failure") == 0 && (c->flags & FLAG_SAVE_AUTH_PASS)) + SaveAuthPass(c->config_name, L""); + else if (strcmp(message, "private-key-password-failure") == 0 && (c->flags & FLAG_SAVE_KEY_PASS)) + SaveKeyPass(c->config_name, L""); c->state = reconnecting; CheckAndSetTrayIcon(); @@ -217,6 +222,8 @@ INT_PTR CALLBACK UserAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { auth_param_t *param; + WCHAR username[USER_PASS_LEN]; + WCHAR password[USER_PASS_LEN]; switch (msg) { @@ -238,6 +245,16 @@ UserAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) if(param->challenge_echo) SendMessage(wnd_challenge, EM_SETPASSWORDCHAR, 0, 0); } + if (RecallUsername(param->c->config_name, username)) + SetDlgItemTextW(hwndDlg, ID_EDT_AUTH_USER, username); + if (RecallAuthPass(param->c->config_name, password)) + { + SetDlgItemTextW(hwndDlg, ID_EDT_AUTH_PASS, password); + SecureZeroMemory(password, sizeof(password)); + } + if (param->c->flags & FLAG_SAVE_AUTH_PASS) + Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); + if (param->c->state == resuming) ForceForegroundWindow(hwndDlg); else @@ -256,7 +273,29 @@ UserAuthDialogFunc(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) + Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); + else + { + DeleteSavedAuthPass(param->c->config_name); + Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_UNCHECKED); + } + break; + case IDOK: + if (GetDlgItemTextW(hwndDlg, ID_EDT_AUTH_USER, username, _countof(username))) + { + SaveUsername(param->c->config_name, username); + } + if ( param->c->flags & FLAG_SAVE_AUTH_PASS && + GetDlgItemTextW(hwndDlg, ID_EDT_AUTH_PASS, password, _countof(password)) && + wcslen(password) ) + { + SaveAuthPass(param->c->config_name, password); + SecureZeroMemory(password, sizeof(password)); + } ManagementCommandFromInput(param->c, "username \"Auth\" \"%s\"", hwndDlg, ID_EDT_AUTH_USER); if (param->challenge_str) ManagementCommandFromInputBase64(param->c, "password \"Auth\" \"SCRV1:%s:%s\"", hwndDlg, ID_EDT_AUTH_PASS, ID_EDT_AUTH_CHALLENGE); @@ -295,6 +334,7 @@ INT_PTR CALLBACK PrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { connection_t *c; + WCHAR passphrase[KEY_PASS_LEN]; switch (msg) { @@ -302,6 +342,17 @@ PrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) /* Set connection for this dialog and show it */ c = (connection_t *) lParam; SetProp(hwndDlg, cfgProp, (HANDLE) c); + if (RecallKeyPass(c->config_name, passphrase) && wcslen(passphrase)) + { + /* Use the saved password and skip the dialog */ + SetDlgItemTextW(hwndDlg, ID_EDT_PASSPHRASE, passphrase); + SecureZeroMemory(passphrase, sizeof(passphrase)); + ManagementCommandFromInput(c, "password \"Private Key\" \"%s\"", hwndDlg, ID_EDT_PASSPHRASE); + EndDialog(hwndDlg, IDOK); + return TRUE; + } + if (c->flags & FLAG_SAVE_KEY_PASS) + Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); if (c->state == resuming) ForceForegroundWindow(hwndDlg); else @@ -312,13 +363,32 @@ PrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) c = (connection_t *) GetProp(hwndDlg, cfgProp); switch (LOWORD(wParam)) { + case ID_CHK_SAVE_PASS: + c->flags ^= FLAG_SAVE_KEY_PASS; + if (c->flags & FLAG_SAVE_KEY_PASS) + Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); + else + { + Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_UNCHECKED); + DeleteSavedKeyPass(c->config_name); + } + break; + case IDOK: + if ((c->flags & FLAG_SAVE_KEY_PASS) && + GetDlgItemTextW(hwndDlg, ID_EDT_PASSPHRASE, passphrase, _countof(passphrase)) && + wcslen(passphrase) > 0) + { + SaveKeyPass(c->config_name, passphrase); + SecureZeroMemory(passphrase, sizeof(passphrase)); + } ManagementCommandFromInput(c, "password \"Private Key\" \"%s\"", hwndDlg, ID_EDT_PASSPHRASE); EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; case IDCANCEL: EndDialog(hwndDlg, LOWORD(wParam)); + StopOpenVPN(c); return TRUE; } break; @@ -660,7 +730,7 @@ OnService(connection_t *c, UNUSED char *msg) free (buf); return; } - + p = buf + 11; while (iswspace(*p)) ++p; @@ -1310,3 +1380,13 @@ out: CloseHandle(hStdOutWrite); return retval; } + +void +DisablePasswordSave(connection_t *c) +{ + if (ShowLocalizedMsgEx(MB_OKCANCEL, TEXT(PACKAGE_NAME), IDS_NFO_DELETE_PASS, c->config_name) == IDCANCEL) + return; + DeleteSavedPasswords(c->config_name); + c->flags &= ~(FLAG_SAVE_KEY_PASS | FLAG_SAVE_AUTH_PASS); + SetMenuStatus(c, c->state); +} diff --git a/openvpn.h b/openvpn.h index c372932..fdc0beb 100644 --- a/openvpn.h +++ b/openvpn.h @@ -36,6 +36,8 @@ void OnStateChange(connection_t *, char *); void OnPassword(connection_t *, char *); void OnStop(connection_t *, char *); +void DisablePasswordSave(connection_t *); + extern const TCHAR *cfgProp; /* These error codes are from openvpn service sources */ diff --git a/openvpn_config.c b/openvpn_config.c index 65709a8..7ee90e9 100644 --- a/openvpn_config.c +++ b/openvpn_config.c @@ -30,6 +30,7 @@ #include "openvpn-gui-res.h" #include "options.h" #include "localization.h" +#include "save_pass.h" typedef enum { @@ -120,6 +121,11 @@ AddConfigFileToList(int config, const TCHAR *filename, const TCHAR *config_dir) break; } } + /* check whether passwords are saved */ + if (IsAuthPassSaved(c->config_name)) + c->flags |= FLAG_SAVE_AUTH_PASS; + if (IsKeyPassSaved(c->config_name)) + c->flags |= FLAG_SAVE_KEY_PASS; } diff --git a/options.h b/options.h index e283175..e38f833 100644 --- a/options.h +++ b/options.h @@ -82,6 +82,9 @@ typedef struct { WCHAR readbuf[512]; } service_io_t; +#define FLAG_SAVE_KEY_PASS 1<<4 +#define FLAG_SAVE_AUTH_PASS 1<<5 + /* Connections parameters */ struct connection { TCHAR config_file[MAX_PATH]; /* Name of the config file */ @@ -112,6 +115,7 @@ struct connection { HANDLE exit_event; DWORD threadId; HWND hwndStatus; + int flags; }; /* All options used within OpenVPN GUI */ diff --git a/registry.c b/registry.c index dbd69c1..78d8729 100644 --- a/registry.c +++ b/registry.c @@ -303,7 +303,6 @@ int SetRegistryValue(HKEY regkey, const TCHAR *name, const TCHAR *data) } return(1); - } int @@ -316,3 +315,79 @@ SetRegistryValueNumeric(HKEY regkey, const TCHAR *name, DWORD data) ShowLocalizedMsg(IDS_ERR_WRITE_REGVALUE, GUI_REGKEY_HKCU, name); return 0; } + +/* + * Open HKCU\Software\OpenVPN-GUI\config-name (create if doesn't exist). + * The caller must close the key. Returns 1 on success. + */ +static int +OpenConfigRegistryKey(const WCHAR *config_name, HKEY *regkey) +{ + DWORD status; + const WCHAR fmt[] = L"SOFTWARE\\OpenVPN-GUI\\%s"; + int count = (wcslen(config_name) + wcslen(fmt) + 1); + WCHAR *name = malloc(count * sizeof(WCHAR)); + + if (!name) + return 0; + + _snwprintf(name, count, fmt, config_name); + name[count-1] = L'\0'; + + /* create if key doesn't exist */ + status = RegCreateKeyEx(HKEY_CURRENT_USER, name, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, regkey, NULL); + free (name); + + return (status == ERROR_SUCCESS); +} + +int +SetConfigRegistryValueBinary(const WCHAR *config_name, const WCHAR *name, const BYTE *data, DWORD len) +{ + HKEY regkey; + DWORD status; + + if (!OpenConfigRegistryKey(config_name, ®key)) + return 0; + status = RegSetValueEx(regkey, name, 0, REG_BINARY, data, len); + RegCloseKey(regkey); + + return (status == ERROR_SUCCESS); +} + +/* + * Read registry value into the user supplied buffer data that can hold + * up to len bytes. Returns the actual number of bytes read or zero on error. + * If data is NULL returns the required buffer size, and no data is read. + */ +DWORD +GetConfigRegistryValue(const WCHAR *config_name, const WCHAR *name, BYTE *data, DWORD len) +{ + DWORD status; + DWORD type; + HKEY regkey; + + if (!OpenConfigRegistryKey(config_name, ®key)) + return 0; + status = RegQueryValueEx(regkey, name, NULL, &type, data, &len); + RegCloseKey(regkey); + if (status == ERROR_SUCCESS) + return len; + else + return 0; +} + +int +DeleteConfigRegistryValue(const WCHAR *config_name, const WCHAR *name) +{ + DWORD status; + HKEY regkey; + + if (!OpenConfigRegistryKey(config_name, ®key)) + return 0; + status = RegDeleteValue(regkey, name); + RegCloseKey(regkey); + + return (status == ERROR_SUCCESS); +} diff --git a/registry.h b/registry.h index 136ae88..9a415e5 100644 --- a/registry.h +++ b/registry.h @@ -28,5 +28,8 @@ LONG GetRegistryValue(HKEY regkey, const TCHAR *name, TCHAR *data, DWORD len); LONG GetRegistryValueNumeric(HKEY regkey, const TCHAR *name, DWORD *data); int SetRegistryValue(HKEY regkey, const TCHAR *name, const TCHAR *data); int SetRegistryValueNumeric(HKEY regkey, const TCHAR *name, DWORD data); +int SetConfigRegistryValueBinary(const WCHAR *config_name, const WCHAR *name, const BYTE *data, DWORD len); +DWORD GetConfigRegistryValue(const WCHAR *config_name, const WCHAR *name, BYTE *data, DWORD len); +int DeleteConfigRegistryValue(const WCHAR *config_name, const WCHAR *name); #endif diff --git a/res/openvpn-gui-res-de.rc b/res/openvpn-gui-res-de.rc index 2e97c33..4d566da 100644 --- a/res/openvpn-gui-res-de.rc +++ b/res/openvpn-gui-res-de.rc @@ -21,7 +21,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -30,12 +30,13 @@ LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT BEGIN LTEXT "Passwort:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Ok", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Abbrechen", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "Ok", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Abbrechen", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Benutzer Authentifizierung" FONT 8, "Microsoft Sans Serif" @@ -45,12 +46,13 @@ BEGIN LTEXT "Passwort:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Ok", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Abbrechen", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "Ok", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Abbrechen", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -63,8 +65,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Ok", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Abbrechen", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "Ok", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Abbrechen", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-dk.rc b/res/openvpn-gui-res-dk.rc index 98581a6..732b410 100644 --- a/res/openvpn-gui-res-dk.rc +++ b/res/openvpn-gui-res-dk.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOG 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_DANISH, SUBLANG_DEFAULT BEGIN LTEXT "Indtast password:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Annuller", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Annuller", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Brugerkontrol" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "Password:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuller", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuller", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuller", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuller", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-en.rc b/res/openvpn-gui-res-en.rc index f5756ef..e1520fb 100644 --- a/res/openvpn-gui-res-en.rc +++ b/res/openvpn-gui-res-en.rc @@ -21,21 +21,22 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST -CAPTION "OpenVPN" +CAPTION "OpenVPN - Private Key Password" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT BEGIN LTEXT "Enter Password:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Cancel", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -45,12 +46,13 @@ BEGIN LTEXT "Password:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancel", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancel", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -63,8 +65,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancel", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancel", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ @@ -189,6 +192,7 @@ BEGIN IDS_MENU_VIEWLOG "View Log" IDS_MENU_EDITCONFIG "Edit Config" IDS_MENU_PASSPHRASE "Change Password" + IDS_MENU_CLEARPASS "Clear Saved Passwords" IDS_MENU_SERVICE_START "Start" IDS_MENU_SERVICE_STOP "Stop" IDS_MENU_SERVICE_RESTART "Restart" @@ -385,4 +389,7 @@ BEGIN IDS_ERR_IMPORT_FAILED "Failed to import file. The following path could not be created.\n\n" \ "%s\n\nMake sure you have the right permissions." IDS_NFO_IMPORT_SUCCESS "File imported successfully." + + /* save/delete password */ + IDS_NFO_DELETE_PASS "Press OK to delete saved passwords for config ""%s""" END diff --git a/res/openvpn-gui-res-es.rc b/res/openvpn-gui-res-es.rc index 3589f75..7c61615 100644 --- a/res/openvpn-gui-res-es.rc +++ b/res/openvpn-gui-res-es.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT BEGIN LTEXT "Introduce clave:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Cancelar", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Cancelar", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Autenticación de usuario" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Password:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancelar", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancelar", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancelar", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancelar", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-fi.rc b/res/openvpn-gui-res-fi.rc index 9939838..50cb38c 100644 --- a/res/openvpn-gui-res-fi.rc +++ b/res/openvpn-gui-res-fi.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT BEGIN LTEXT "Anna salasana:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Peruuta", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Peruuta", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Käyttäjän todennus" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "Salasana:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Peruuta", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Peruuta", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Peruuta", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Peruuta", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-fr.rc b/res/openvpn-gui-res-fr.rc index b301770..72b79fa 100644 --- a/res/openvpn-gui-res-fr.rc +++ b/res/openvpn-gui-res-fr.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT BEGIN LTEXT "Entrez un mot de passe:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Annuler", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Annuler", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "Authentification d'utilisateur" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Mot de passe:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuler", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuler", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuler", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuler", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-it.rc b/res/openvpn-gui-res-it.rc index 34cf6bb..e6281a5 100644 --- a/res/openvpn-gui-res-it.rc +++ b/res/openvpn-gui-res-it.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT BEGIN LTEXT "Inserisci la password:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Annulla", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Annulla", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Autenticazione dell'utente" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Password:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annulla", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annulla", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annulla", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annulla", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-jp.rc b/res/openvpn-gui-res-jp.rc index 5b02265..7eadeb2 100644 --- a/res/openvpn-gui-res-jp.rc +++ b/res/openvpn-gui-res-jp.rc @@ -23,7 +23,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -32,12 +32,13 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT BEGIN LTEXT "パスワード:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "キャンセル", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "キャンセル", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - ユーザー認証" FONT 8, "Microsoft Sans Serif" @@ -47,12 +48,13 @@ BEGIN LTEXT "パスワード:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "キャンセル", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "キャンセル", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -65,8 +67,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "キャンセル", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "キャンセル", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-nl.rc b/res/openvpn-gui-res-nl.rc index 4471d01..606cdd1 100644 --- a/res/openvpn-gui-res-nl.rc +++ b/res/openvpn-gui-res-nl.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT BEGIN LTEXT "Wachtwoord:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Annuleren", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Annuleren", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Gebruikersauthenticatie" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Wachtwoord:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuleren", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuleren", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Gebruikersauthenticatie" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Annuleren", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Annuleren", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-no.rc b/res/openvpn-gui-res-no.rc index 5543b63..c3b6b23 100644 --- a/res/openvpn-gui-res-no.rc +++ b/res/openvpn-gui-res-no.rc @@ -21,7 +21,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOG 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -30,12 +30,13 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_DEFAULT BEGIN LTEXT "Oppgi passord:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Avbryt", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Avbryt", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Brukerautentisering" FONT 8, "Microsoft Sans Serif" @@ -45,12 +46,13 @@ BEGIN LTEXT "Passord:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Avbryt", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Avbryt", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -63,8 +65,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Avbryt", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Avbryt", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-pl.rc b/res/openvpn-gui-res-pl.rc index d80d9be..e97c41e 100644 --- a/res/openvpn-gui-res-pl.rc +++ b/res/openvpn-gui-res-pl.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT BEGIN LTEXT "Hasło:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Anuluj", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Anuluj", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Autentykacja Użytkownika" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "Hasło:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Anuluj", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Anuluj", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Anuluj", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Anuluj", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-pt.rc b/res/openvpn-gui-res-pt.rc index bae295e..035969a 100644 --- a/res/openvpn-gui-res-pt.rc +++ b/res/openvpn-gui-res-pt.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT BEGIN LTEXT "Digite a senha:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Cancelar", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Cancelar", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Autenticação de usuário" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Senha:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancelar", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancelar", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Autenticação de usuário" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Cancelar", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Cancelar", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-ru.rc b/res/openvpn-gui-res-ru.rc index d72c320..e2ef10b 100644 --- a/res/openvpn-gui-res-ru.rc +++ b/res/openvpn-gui-res-ru.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT BEGIN LTEXT "Введите пароль:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Отмена", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Отмена", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 180, 62 +ID_DLG_AUTH DIALOG 6, 18, 180, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Аутентификация пользователя" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "Пароль:", 0, 6, 26, 70, 10 EDITTEXT ID_EDT_AUTH_USER, 80, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 80, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 30, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Отмена", IDCANCEL, 100, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 30, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Отмена", IDCANCEL, 100, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Отмена", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Отмена", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-se.rc b/res/openvpn-gui-res-se.rc index b9e89d8..d3e0db9 100644 --- a/res/openvpn-gui-res-se.rc +++ b/res/openvpn-gui-res-se.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOG 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT BEGIN LTEXT "Ange Lösenord:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Avbryt", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Avbryt", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Användar Autentisering" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Lösenord:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 60, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Avbryt", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Avbryt", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Avbryt", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Avbryt", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-tr.rc b/res/openvpn-gui-res-tr.rc index 9dfd794..da6c668 100644 --- a/res/openvpn-gui-res-tr.rc +++ b/res/openvpn-gui-res-tr.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT BEGIN LTEXT "Şifreyi Giriniz:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Tamam", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Çıkış", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "Tamam", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Çıkış", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Oturum Açma" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "Şifre:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 50, 6, 104, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 50, 23, 104, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Tamam", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Çıkış", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "Tamam", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Çıkış", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "Tamam", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Çıkış", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "Tamam", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Çıkış", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-ua.rc b/res/openvpn-gui-res-ua.rc index 5d388ea..07c2dd3 100644 --- a/res/openvpn-gui-res-ua.rc +++ b/res/openvpn-gui-res-ua.rc @@ -20,7 +20,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -29,12 +29,13 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT BEGIN LTEXT "Введіть пароль:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 6, 33, 50, 14 - PUSHBUTTON "Скасувати", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "OK", IDOK, 6, 49, 50, 14 + PUSHBUTTON "Скасувати", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 180, 62 +ID_DLG_AUTH DIALOG 6, 18, 180, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - Перевірка подлінності користувача" FONT 8, "Microsoft Sans Serif" @@ -44,12 +45,13 @@ BEGIN LTEXT "Пароль:", 0, 6, 26, 70, 10 EDITTEXT ID_EDT_AUTH_USER, 80, 6, 94, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 80, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 30, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Скасувати", IDCANCEL, 100, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "OK", IDOK, 30, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Скасувати", IDCANCEL, 100, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -62,8 +64,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "OK", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "Скасувати", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "OK", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "Скасувати", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/res/openvpn-gui-res-zh-hant.rc b/res/openvpn-gui-res-zh-hant.rc index 93d5cf2..f97298c 100644 --- a/res/openvpn-gui-res-zh-hant.rc +++ b/res/openvpn-gui-res-zh-hant.rc @@ -22,7 +22,7 @@ */ /* Passphrase Dialog */ -ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 51 +ID_DLG_PASSPHRASE DIALOGEX 6, 18, 120, 67 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND EXSTYLE WS_EX_TOPMOST CAPTION "OpenVPN" @@ -31,12 +31,13 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL BEGIN LTEXT "輸入密碼:", 201, 6, 6, 100, 10 EDITTEXT ID_EDT_PASSPHRASE, 6, 17, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "確認", IDOK, 6, 33, 50, 14 - PUSHBUTTON "取消", IDCANCEL, 64, 33, 50, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 33, 100, 10 + PUSHBUTTON "確認", IDOK, 6, 49, 50, 14 + PUSHBUTTON "取消", IDCANCEL, 64, 49, 50, 14 END /* Auth Username/Password Dialog */ -ID_DLG_AUTH DIALOG 6, 18, 160, 62 +ID_DLG_AUTH DIALOG 6, 18, 160, 78 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - 使用者權限" FONT 8, "Microsoft Sans Serif" @@ -46,12 +47,13 @@ BEGIN LTEXT "密碼:", 0, 6, 26, 50, 10 EDITTEXT ID_EDT_AUTH_USER, 52, 6, 102, 12, ES_AUTOHSCROLL EDITTEXT ID_EDT_AUTH_PASS, 52, 23, 102, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "確認", IDOK, 20, 42, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "取消", IDCANCEL, 90, 42, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 42, 100, 10 + PUSHBUTTON "確認", IDOK, 20, 58, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "取消", IDCANCEL, 90, 58, 52, 14 END /* Auth Username/Password/Challenge Dialog */ -ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 96 +ID_DLG_AUTH_CHALLENGE DIALOG 6, 18, 160, 112 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | DS_CENTER | DS_SETFOREGROUND CAPTION "OpenVPN - User Authentication" FONT 8, "Microsoft Sans Serif" @@ -64,8 +66,9 @@ BEGIN EDITTEXT ID_EDT_AUTH_PASS, 60, 23, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "", ID_TXT_AUTH_CHALLENGE, 6, 43, 148, 10 EDITTEXT ID_EDT_AUTH_CHALLENGE, 60, 57, 94, 12, ES_PASSWORD | ES_AUTOHSCROLL - PUSHBUTTON "確認", IDOK, 20, 76, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED - PUSHBUTTON "取消", IDCANCEL, 90, 76, 52, 14 + CHECKBOX "Save password", ID_CHK_SAVE_PASS, 6, 76, 100, 10 + PUSHBUTTON "確認", IDOK, 20, 92, 50, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_DISABLED + PUSHBUTTON "取消", IDCANCEL, 90, 92, 52, 14 END /* Status Dialog */ diff --git a/save_pass.c b/save_pass.c new file mode 100644 index 0000000..e2ea7f8 --- /dev/null +++ b/save_pass.c @@ -0,0 +1,263 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "main.h" +#include "registry.h" +#include "save_pass.h" +#include "passphrase.h" + +#define KEY_PASS_DATA L"key-data" +#define AUTH_PASS_DATA L"auth-data" +#define ENTROPY_DATA L"entropy" +#define AUTH_USER_DATA L"username" +#define ENTROPY_LEN 16 + +static DWORD +crypt_protect(BYTE *data, int szdata, char *entropy, BYTE **out) +{ + DATA_BLOB data_out; + DATA_BLOB data_in; + DATA_BLOB e; + + data_in.pbData = data; + data_in.cbData = szdata; + e.pbData = (BYTE*) entropy; + e.cbData = entropy? strlen(entropy) : 0; + + if(CryptProtectData(&data_in, NULL, &e, NULL, NULL, 0, &data_out)) + { + *out = data_out.pbData; + return data_out.cbData; + } + PrintDebug(L"CryptProtectData failed (error = %lu)", GetLastError()); + return 0; +} + +static DWORD +crypt_unprotect(BYTE *data, int szdata, char *entropy, BYTE **out) +{ + DATA_BLOB data_in; + DATA_BLOB data_out = {0,0}; + DATA_BLOB e; + + data_in.pbData = data; + data_in.cbData = szdata; + e.pbData = (BYTE *) entropy; + e.cbData = entropy? strlen(entropy) : 0; + + if(CryptUnprotectData(&data_in, NULL, &e, NULL, NULL, 0, &data_out)) + { + *out = data_out.pbData; + return data_out.cbData; + } + else + { + PrintDebug(L"CryptUnprotectData: decryption failed"); + LocalFree (data_out.pbData); + return 0; + } +} + +/* + * If not found in registry and generate is true, a new nul terminated + * random string is generated and saved in registry. + * Else a zero-length string is returned and registry is not updated. + */ +static void +get_entropy(const WCHAR *config_name, char *e, int sz, BOOL generate) +{ + int len; + + len = GetConfigRegistryValue(config_name, ENTROPY_DATA, (BYTE *) e, sz); + if (len > 0) + { + e[len-1] = '\0'; + PrintDebug(L"Got entropy from registry: %S (len = %d)", e, len); + return; + } + else if (generate && GetRandomPassword(e, sz)) + { + e[sz-1] = '\0'; + PrintDebug(L"Created new entropy string : %S", e); + if (SetConfigRegistryValueBinary(config_name, ENTROPY_DATA, (BYTE *)e, sz)) + return; + } + if (generate) + PrintDebug(L"Failed to generate or save new entropy string -- using null string"); + *e = '\0'; + return; +} +/* + * Given a nul terminated string password, encrypt it and save in + * a config specific registry key with specified name. + * Returns 1 on success. + */ +static int +save_encrypted(const WCHAR *config_name, const WCHAR *password, const WCHAR *name) +{ + BYTE *out; + DWORD len = (wcslen(password) + 1) * sizeof(WCHAR); + char entropy[ENTROPY_LEN+1]; + + get_entropy(config_name, entropy, sizeof(entropy), true); + len = crypt_protect((BYTE*) password, len, entropy, &out); + if(len > 0) + { + SetConfigRegistryValueBinary(config_name, name, out, len); + LocalFree(out); + return 1; + } + else + return 0; +} + +/* + * Encrypt the nul terminated string password and store it in the + * registry with key name KEY_PASS_DATA. Returns 1 on success. + */ +int +SaveKeyPass(const WCHAR *config_name, const WCHAR *password) +{ + return save_encrypted(config_name, password, KEY_PASS_DATA); +} + +/* + * Encrypt the nul terminated string password and store it in the + * registry with key name AUTH_PASS_DATA. Returns 1 on success. + */ +int +SaveAuthPass(const WCHAR *config_name, const WCHAR *password) +{ + return save_encrypted(config_name, password, AUTH_PASS_DATA); +} + +/* + * Returns 1 on success, 0 on failure. password should have space + * for up to capacity wide chars incluing nul termination + */ +static int +recall_encrypted(const WCHAR *config_name, WCHAR *password, DWORD capacity, const WCHAR *name) +{ + BYTE in[2048]; + BYTE *out; + DWORD len; + int retval = 0; + char entropy[ENTROPY_LEN+1]; + + get_entropy(config_name, entropy, sizeof(entropy), false); + + memset (password, 0, capacity); + + len = GetConfigRegistryValue(config_name, name, in, sizeof(in)); + if(len == 0) + return 0; + + len = crypt_unprotect(in, len, entropy, &out); + if(len == 0) + return 0; + + if (len <= capacity * sizeof(*password)) + { + memcpy(password, out, len); + password[capacity-1] = L'\0'; /* in case the data was corrupted */ + retval = 1; + } + else + PrintDebug(L"recall_encrypted: saved '%s' too long (len = %d bytes)", name, len); + + SecureZeroMemory(out, len); + LocalFree(out); + + return retval; +} + +/* + * Reccall saved private key password. The buffer password should be + * have space for up to KEY_PASS_LEN WCHARs including nul. + * Returns 1 on success, 0 on failure. + */ +int +RecallKeyPass(const WCHAR *config_name, WCHAR *password) +{ + return recall_encrypted(config_name, password, KEY_PASS_LEN, KEY_PASS_DATA); +} + +/* + * Reccall saved auth password. The buffer password should be + * have space for up to USER_PASS_LEN WCHARs including nul. + * Returns 1 on success, 0 on failure. + */ +int +RecallAuthPass(const WCHAR *config_name, WCHAR *password) +{ + return recall_encrypted(config_name, password, USER_PASS_LEN, AUTH_PASS_DATA); +} + +int +SaveUsername(const WCHAR *config_name, const WCHAR *username) +{ + DWORD len = (wcslen(username) + 1) * sizeof(*username); + SetConfigRegistryValueBinary(config_name, AUTH_USER_DATA,(BYTE *) username, len); + return 1; +} +/* + * The buffer username should be have space for up to USER_PASS_LEN + * WCHARs including nul. + */ +int +RecallUsername(const WCHAR *config_name, WCHAR *username) +{ + DWORD capacity = USER_PASS_LEN * sizeof(WCHAR); + DWORD len; + + len = GetConfigRegistryValue(config_name, AUTH_USER_DATA, (BYTE *) username, capacity); + if (len == 0) + return 0; + username[USER_PASS_LEN-1] = L'\0'; + return 1; +} + +void +DeleteSavedKeyPass(const WCHAR *config_name) +{ + DeleteConfigRegistryValue(config_name, KEY_PASS_DATA); +} + +void +DeleteSavedAuthPass(const WCHAR *config_name) +{ + DeleteConfigRegistryValue(config_name, AUTH_PASS_DATA); +} + +/* delete saved config-specific auth password and private key passphrase */ +void +DeleteSavedPasswords(const WCHAR *config_name) +{ + DeleteConfigRegistryValue(config_name, KEY_PASS_DATA); + DeleteConfigRegistryValue(config_name, AUTH_PASS_DATA); + DeleteConfigRegistryValue(config_name, ENTROPY_DATA); +} + +/* check if auth password is saved */ +BOOL +IsAuthPassSaved(const WCHAR *config_name) +{ + DWORD len = 0; + len = GetConfigRegistryValue(config_name, AUTH_PASS_DATA, NULL, 0); + PrintDebug(L"checking auth-pass-data in registry returned len = %d", len); + return (len > 0); +} + +/* check if key password is saved */ +BOOL +IsKeyPassSaved(const WCHAR *config_name) +{ + DWORD len = 0; + len = GetConfigRegistryValue(config_name, KEY_PASS_DATA, NULL, 0); + PrintDebug(L"checking key-pass-data in registry returned len = %d", len); + return (len > 0); +} diff --git a/save_pass.h b/save_pass.h new file mode 100644 index 0000000..cdd831f --- /dev/null +++ b/save_pass.h @@ -0,0 +1,23 @@ +#ifndef SAVEPASS_H +#define SAVEPASS_H + +#include + +#define USER_PASS_LEN 128 +#define KEY_PASS_LEN 128 + +int SaveKeyPass(const WCHAR *config_name, const WCHAR *password); +int SaveAuthPass(const WCHAR *config_name, const WCHAR *password); +int SaveUsername(const WCHAR *config_name, const WCHAR *username); + +int RecallKeyPass(const WCHAR *config_name, WCHAR *password); +int RecallAuthPass(const WCHAR *config_name, WCHAR *password); +int RecallUsername(const WCHAR *config_name, WCHAR *username); + +void DeleteSavedAuthPass(const WCHAR *config_name); +void DeleteSavedKeyPass(const WCHAR *config_name); +void DeleteSavedPasswords(const WCHAR *config_name); + +BOOL IsAuthPassSaved(const WCHAR *config_name); +BOOL IsKeyPassSaved(const WCHAR *config_name); +#endif diff --git a/tray.c b/tray.c index 6ee754b..976a3b7 100644 --- a/tray.c +++ b/tray.c @@ -77,6 +77,7 @@ CreatePopupMenus() if (o.allow_edit[0] == '1') AppendMenu(hMenu, MF_STRING, IDM_EDITMENU, LoadLocalizedString(IDS_MENU_EDITCONFIG)); + AppendMenu(hMenu, MF_STRING, IDM_CLEARPASSMENU, LoadLocalizedString(IDS_MENU_CLEARPASS)); #ifndef DISABLE_CHANGE_PASSWORD if (o.allow_password[0] == '1') @@ -135,6 +136,7 @@ CreatePopupMenus() if (o.allow_edit[0] == '1') AppendMenu(hMenuConn[i], MF_STRING, IDM_EDITMENU + i, LoadLocalizedString(IDS_MENU_EDITCONFIG)); + AppendMenu(hMenuConn[i], MF_STRING, IDM_CLEARPASSMENU + i, LoadLocalizedString(IDS_MENU_CLEARPASS)); #ifndef DISABLE_CHANGE_PASSWORD if (o.allow_password[0] == '1') @@ -381,6 +383,10 @@ SetMenuStatus(connection_t *c, conn_state_t state) EnableMenuItem(hMenu, IDM_DISCONNECTMENU, MF_GRAYED); EnableMenuItem(hMenu, IDM_STATUSMENU, MF_ENABLED); } + if (c->flags & (FLAG_SAVE_AUTH_PASS | FLAG_SAVE_KEY_PASS)) + EnableMenuItem(hMenu, IDM_CLEARPASSMENU, MF_ENABLED); + else + EnableMenuItem(hMenu, IDM_CLEARPASSMENU, MF_GRAYED); } else { @@ -412,6 +418,10 @@ SetMenuStatus(connection_t *c, conn_state_t state) EnableMenuItem(hMenuConn[i], IDM_DISCONNECTMENU + i, MF_GRAYED); EnableMenuItem(hMenuConn[i], IDM_STATUSMENU + i, MF_ENABLED); } + if (c->flags & (FLAG_SAVE_AUTH_PASS | FLAG_SAVE_KEY_PASS)) + EnableMenuItem(hMenuConn[i], IDM_CLEARPASSMENU + i, MF_ENABLED); + else + EnableMenuItem(hMenuConn[i], IDM_CLEARPASSMENU + i, MF_GRAYED); } } diff --git a/tray.h b/tray.h index f417698..88ee852 100644 --- a/tray.h +++ b/tray.h @@ -41,6 +41,7 @@ #define IDM_VIEWLOGMENU (MAX_CONFIGS + IDM_STATUSMENU) #define IDM_EDITMENU (MAX_CONFIGS + IDM_VIEWLOGMENU) #define IDM_PASSPHRASEMENU (MAX_CONFIGS + IDM_EDITMENU) +#define IDM_CLEARPASSMENU (MAX_CONFIGS + IDM_PASSPHRASEMENU) void CreatePopupMenus(); void OnNotifyTray(LPARAM);