Commit Graph

920 Commits (c2f6df1ab2d89ff766ad92b2d2da807e13d19a57)

Author SHA1 Message Date
OpenVPN Renovate c2f6df1ab2 Update vcpkg digest to 7824193 2025-11-20 03:16:56 +00:00
Selva Nair 8a28d4f7e2 Update CHANGES.rst
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-18 22:01:09 -05:00
Lev Stipakov ecb548efea TRY_GETPROP: make it more pretty for VOID callers
Because

  TRY_GETPROP(hwnd, cfgProp, c, );

looks a bit scary.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-11-17 18:59:54 +01:00
Yuriy Darnobyt 211cc8c5c2 Bump version to 11.58.0.0
Signed-off-by: Yuriy Darnobyt <yura.darnobyt@openvpn.net>
2025-11-17 14:06:09 +02:00
Selva Nair e0a5ed42fe Check the return value of GetProp()
Most of GetProp() calls are replaced by a macro that logs a message and
returns on error.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-15 14:04:35 -05:00
Selva Nair 77659c3f3b Make config path check similar to that in interactive service
The check here is not critical as its used only to provide the user
with an option to fix it before failing validation in the service.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-14 12:12:50 +02:00
Selva Nair c4e9c12d9b Add backslash to global paths read from HKLM
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-14 12:12:50 +02:00
Selva Nair 1a30e3c591 Escape the type id of password message received from openvpn
For password/PIN requests such as for a token, the type of the request includes
the token name. This string is included in the response (parsed as param->id).
When such strings contain special characters such as quotes, we currently fail
as openvpn.exe cannot parse the response correctly:

Eg., token name = "Test Token" including the quotes, lead to the following error:

  password of type '' entered, but we need one of type '"Test Token" token'

We already escape username and password. Escape param->id as well.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-14 11:45:23 +02:00
Selva Nair 08608b2213 Close registry key after use
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-09 10:21:35 -05:00
Selva Nair 854f5dc0e8 Add a message source for event logging
The message file eventmsg.mc is copied from oepenvpnserv
sources so that we can reuse openvpnservmsg.dll as our
event source.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-04 10:21:19 -05:00
Christopher Ng 29cf1b7c7e Check correct management daemon path when OpenVPN3 is enabled
If OpenVPN3 is enabled then the check needs to verify against the
`omi_exe_path` registry key, not the `exe_path` key.

Signed-off-by: Christopher Ng <facboy@gmail.com>
2025-11-04 10:31:48 +02:00
Christopher Ng 1418a06f45 Fix OpenVPN3 radio button label size when OVPN3 is enabled
When ENABLE_OVPN3 is set, the end of its radio button label in the GUI was previously cut off.

Signed-off-by: Christopher Ng <facboy@gmail.com>
2025-11-04 10:07:13 +02:00
Selva Nair 4faa58934d Use GetTempPath() for debug file in plap as well
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-03 15:13:49 +02:00
Selva Nair 8b3f3f765c Migrate all saved plain usernames to encrypted format
This is done at startup as a part of registry upgrade
process.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-11-03 15:13:38 +02:00
Yuriy Darnobyt 92da0ec23e Bump version to 11.57.0.0
Signed-off-by: Yuriy Darnobyt <yura.darnobyt@openvpn.net>
2025-10-31 14:13:42 +02:00
Selva Nair db520488af Excplicitly check that urls start with http:// or https://
This is slightly better than macthing only "http"

Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:12:23 +02:00
Selva Nair fff2048802 Replace % characters in param->id as it's used in format template
Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:12:23 +02:00
Selva Nair dab4dffa6b Disallow Windows special filenames for imported profile
Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:12:23 +02:00
Selva Nair 6ec7b236fe Add MB_ICONERROR to some error display message boxes
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:12:23 +02:00
Selva Nair c6623258c6 Error out if imported profile file name is too long
Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:12:23 +02:00
Selva Nair 55d6c0883f Check the path of the process listening on management port
Check that the process listening on management port has image path
matching exe_path set in the registry. The check is done soon after
connecting to the port, but before sending any data to it.

Helps with:
  (i) not revealing management password to a malicious process
  (ii) passing user credentials etc. only to a known process
  (iii) ensuring PLAP interface is connecting to a known process

Note: This uses an undocumented API as alternatives like "QueryFullProcessImageNameW"
requires PROCESS_QUERY_INFORMATION rights which we normally do not have.

Motivated by some issues found by ZeroPath

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:11:10 +02:00
Selva Nair 6d540763cc Refactor to make IsSamePath() reusable
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-30 09:11:10 +02:00
Selva Nair d5e57cf079 Avoid blocking calls during WM_OVPN_ECHOMSG processing
We send this message from the connection thread to the main
thread using a blocking SendMesssage as the echo message to display is
cleared soon after. This sometimes leads to timeouts (and
thus long waits). Avoid timeout using Async ShowWindow() and delaying
SetForegroundWindow() as these could otherwise wait if the current
foreground Window is controlled by the calling thread.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-29 17:18:06 +02:00
Selva Nair 700fdd315f Check for null text in ShowTrayBalloon()
Fixes segfault when echo msg-notify happens with
no message to display.

As ShellNotify does not display with empty messages, we
set space (L" ") as message to allow title-only notifications.

Closes github: #771

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-29 17:18:06 +02:00
Selva Nair 4fa6928463 Encrypt username saved in registry
Any previously saved plain text username is migrated to
DPAPI encrypted form.

Notes
 (i) plain username in registry is migrated only on first use
 (ii) username is always saved -- this patch does not alter
     that behaviour.

TODO: Migrate all saved usernames to encrypted form?

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-10-29 14:54:49 +01:00
Frank Lichtenheld 23e18c9132 Bump version to 11.56.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-09-22 13:49:20 +02:00
Selva Nair 44288aae4b Change WM_RBUTTONUP to WM_CONTEXTMENU
Required for correct behavior under right click as well as
keyboard event (Shift-F10) for context menu.

The location of the context menu is now taken from the
message as the cursor position may not match when triggered by
keyboard event.

Fixes Github #763

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-09-09 09:28:09 +03:00
Frank Lichtenheld ea13106cf6 Bump version to 11.55.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-07-31 15:46:00 +02:00
justwho 66eec353e3 Update openvpn-gui-res-zh-hans.rc 2025-07-21 10:32:23 +03:00
Yuriy Darnobyt 04fc59c6a0 Bump version to 11.54.0.0
Signed-off-by: Yuriy Darnobyt <yura.darnobyt@openvpn.net>
2025-06-19 19:37:59 +03:00
= 9b18fc821c Improve Turkish (tr) localization for OpenVPN GUI
This commit significantly improves the Turkish localization of the OpenVPN GUI by
translating numerous strings that were previously in English. The changes include:

1. User Interface Elements:
   - Translated all remaining English text in dialog boxes
   - Properly localized checkbox and button labels
   - Updated radio button text to Turkish
   - Improved existing translations for better clarity

2. Dialog Box Translations:
   - Passphrase Dialog: Translated "Save password" to "Şifreyi Kaydet"
   - Authentication Dialog: Translated remaining English elements
   - Advanced Dialog: Fully translated all configuration options
   - General Settings: Translated UI preferences and options
   - URL Profile Import: Localized all elements

3. Menu Items:
   - Translated all import-related menu options
   - Localized "Clear Saved Passwords" to "Kayıtlı Şifreleri Temizle"
   - Fixed other menu item translations

4. Status and Error Messages:
   - Translated OpenVPN daemon state names for connection progress
   - Localized error messages for import functionality
   - Updated authentication-related notifications
   - Translated PKCS11 certificate list headers

5. Technical Terminology:
   - Consistently translated technical terms across the application
   - Used appropriate Turkish terminology for networking concepts

These changes provide a more consistent and professional Turkish localization
that will improve the user experience for Turkish-speaking users.
2025-06-19 14:50:39 +03:00
bubuleur 501f887266 Update openvpn-gui-res-fr.rc
How long will it take for you to update OpenVpn so that I can see my contribution?
2025-06-10 08:37:46 -07:00
Frank Lichtenheld 3403732dee Bump version to 11.53.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-05-28 16:00:30 +02:00
Lev Stipakov d31c391b6b Keep PLAP dialog alive by simulating user activity
Add a timer to periodically simulate mouse movement
using SendInput, preventing the pre-logon UI from being
dismissed due to inactivity during mobile QR code authentication.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-04-24 08:36:03 -07:00
Selva Nair 3e4adfa49e Hide password reveal eye icon when no response box is shown
When CR_TEXT or dynamic CR prompt is triggered with
'response not required' ('R' not present in flags), we hide the response
box, but not the password reveal eye icon. Fix it.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-04-07 12:12:59 +03:00
bovirus b8f945c48b Italian language update 2025-04-07 09:51:15 +02:00
Lev Stipakov 034ecedaa8 Add QR dialog to all resource files
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-04-04 18:51:26 -07:00
Lev Stipakov d8249daf8f PLAP: support for webauth
Instead of opening the browser window in PLAP context (which is insecure),
display a dialog with QR code and ask user to scan it on mobile device.

QR code generation is taken from MIT-licensed library:

  https://github.com/nayuki/QR-Code-generator/blob/master/c/qrcodegen.c

Before I tried vcpkg libqrencode package but gave up after
10 mins of dependencies building (it requires msys2 etc).

Note that you need to add

  setenv IV_SSO webauth

to PLAP profile to make it work.

Fixes: https://github.com/OpenVPN/openvpn-gui/issues/687

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-04-04 18:51:26 -07:00
Lev Stipakov 2242c1cca4 Use stdbool.h for bool
No need to define own bool/true/false values.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-04-04 18:51:26 -07:00
Yuriy Darnobyt 5880925331 Bump version to 11.52.0.0
Signed-off-by: Yuriy Darnobyt <yura.darnobyt@openvpn.net>
2025-04-02 14:51:38 +03:00
Lev Stipakov 068ed823bd Use correct %TEMP% directory for log file
C:\\windows\\Temp\\ has been write-protected since a while,
so instead of hardcoding the (wrong) path, use GetTempPath().

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2025-03-28 13:30:31 +02:00
Selva Nair b3849327f6 Disable config in menu listing if its ovpn file becomes inaccessible
Since the introduction of persistent connections, we
no longer recreate the entire config menu but only add newly
added connection profiles during each rescan. This leaves
any deleted configs actively displayed in the menu until the
GUI is restarted.

Improve this situation by graying out entries corresponding to
profiles not readable from file system. If the file reappears,
the item gets automatically enabled again.

Also, if the corresponding connection is active, the item is not
grayed out to allow the user to disconnect or reconnect it.
Otherwise the corresponding OpenVPN core process will hang around
with no way to control it from the GUI. Here "active" includes
those on management-hold in case of persistent connections, as
those can be started even if the underlying config file has
gone missing.

Addresses github issue #729

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-03-28 12:06:36 +02:00
Frank Lichtenheld 5f844605ee echo.c: Avoid -Wsign-compare with MinGW on 32bit systems
echo.c:221:72: error: comparison of integer expressions of
different signedness: ‘long unsigned int’ and
‘time_t’ {aka ‘long int’} [-Werror=sign-compare]

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld 91b0b1e5be tray.c: Avoid -Waddress with MinGW
tray.c:783:36: error: the comparison will always
evaluate as ‘true’ for the pointer operand [...]
must not be NULL [-Werror=address]

True.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld 39c31aef98 openvpn.c: Avoid -Waddress warnings with MinGW
This happens on newer MinGW versions:
openvpn.c:176:19: error: the comparison will always
evaluate as ‘false’ for the pointer operand in
‘flags + -1’ must not be NULL [-Werror=address]

Strictly speaking this is a false positive, but
the pointer handling is a bit weird, so make the
code more straight-forward.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld 528df5e259 configure: For MinGW build enable -Werror
But avoid -Wcast-function-type (from -Wextra)
since that is not useful for code using
GetProcAddress.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld 2721540f89 Replace _wfopen with _wfopen_s
Avoid
warning C4996: '_wfopen': This function or variable may be unsafe

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld ec77d99c40 Replace usages of _snwprintf
Avoid
warning C4996: '_snwprintf': This function or variable may be unsafe

Also makes the code generally simpler.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
Frank Lichtenheld 913641ec41 openvpn.c: Avoid compiler warnings for sscanf with MinGW
openvpn.c:1709:29: warning: ISO C does not support the 'I'
 scanf flag [-Wformat=]
openvpn.c:1709:34: warning: format ‘%u’ expects argument
 of type ‘unsigned int *’, but argument 3 has type
 ‘long long unsigned int *’ [-Wformat=]

Switch to using portable identifiers.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-02-18 14:03:22 +01:00
OpenVPN Renovate ff0af59042 Update vcpkg digest to d5ec528 2025-02-17 15:04:08 +01:00