Commit Graph

864 Commits (57f9cad58a5629fb03005ae3c42c9db548d1be1b)

Author SHA1 Message Date
Lev Stipakov 2ab79c9721 CMakeLists.txt: generate PDB for release builds
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-05-25 18:43:44 +03:00
Frank Lichtenheld 4921b1e544 Bump version to 11.42.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-04-26 14:21:54 +02:00
Lev Stipakov 8cdffbe817 Add transparency to eye icons
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-04-26 13:23:50 +02:00
Selva Nair 641f880b1f fixup! Implement Password Reveal Feature
Moved the central circle by 1/2 pixel to make the image symmetric
2023-04-26 11:08:15 +03:00
Selva Nair 14c7a69c79 fixup! Password-reveal: Respect group policy setting, if any
- Minor edit in registry.c
2023-04-26 11:08:15 +03:00
Selva Nair fa1191b799 Password-reveal: Copy dialog resource changes to all languages
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-04-26 11:08:15 +03:00
Selva Nair 982e1a4319 Password-reveal: Respect group policy setting, if any
- The policy setting is checked when GUI is started. Any change
  in policy will be effective only after restarting the GUI.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-04-26 11:08:15 +03:00
Selva Nair 9186648285 Implement Password Reveal Feature
- Only "hot" user input -- i.e, freshly typed password starting
  from an empty string, with keyboard focus still in the edit
  box -- can be revealed.
  In particular, prefilled passwod (from cached value) cannot be
  revealed.
- Once keyboard focus moves out of the password edit box, the inpit has
  to be deleted for the reveal feature to get re-enabled.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-04-26 11:08:15 +03:00
Lev Stipakov d24495bd74
Merge pull request #621 from lstipakov/fix_man_delay
Bring back delay before management is ready
2023-04-18 08:13:49 +03:00
Lev Stipakov fcfad50543 Bring back delay before management is ready
Commit 2b1e586

"Replace Sleep by a Wait function that pumps messages"

replaced Sleep() with a wait function which also processes messages.
However WM_MANAGEMENT message in some cases requires actual delay to be
processed. To achieve that, bring back original Sleep().

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-04-17 21:41:16 +03:00
Frank Lichtenheld 18a499e481 Bump version to 11.41.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-04-13 12:42:51 +02:00
Frank Lichtenheld ec90109cd2 Makefile.am: fix make dist
Fixup for commit 0bea5549f1

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-04-13 12:39:16 +02:00
Frank Lichtenheld e755c42627 Bump version to 11.40.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-04-13 12:33:26 +02:00
Selva Nair 141a7adaca Add missing copyright header in save_pass.[ch]
- This was missed in 2016 when these files were added

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-03-27 07:50:21 -07:00
Selva Nair 0bea5549f1 Remove private key password-change feature
- With this, dependence on OpenSSL is also gone. CI build
  tasks are updated accordingly.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-03-27 07:50:21 -07:00
Selva Nair 7d23e63411 Update CHANGES.rst for 11.39.0
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-03-26 17:03:16 -07:00
Frank Lichtenheld 8634f03207 Bump version to 11.39.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-03-24 14:10:22 +01:00
Selva Nair c51a37c2ff Do not remove tray icon when WM_OVPN_STOPALL is processed
- commit f8a243fbe introduced removing the tray icon during
  the wait for exit to avoid further user interaction. This
  is done in StopAllOpenVPN(). However, this function is also
  reused for processing WM_OVPN_STOPALL message received from
  a second instance via --comamnd disconnect_all. In this case
  the tray icon should not be removed as we are not exiting.

Fixes issue #607

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-03-13 05:55:02 -07:00
Selva Nair 4803c7ad08 Update CHANGES.rst for 11.38
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-03-13 05:55:02 -07:00
Frank Lichtenheld 326b078e80 Bump version to 11.38.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-03-08 16:22:04 +01:00
Selva Nair 7cc3ccda84 End open dialogs on state change
Modal dialogs opened within the connection thread may
hang around if the connection restarts. Intercept the state
change message and call EndDialog when that happens.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair f8a243fbe8 Remove tray icon during exit processing
During the wait for threads to exit,  we no longer sleep, but
continue pumping messages. Disable the tray icon during this
period to not allow user interaction with the main menu.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair ecf9998652 Use CloseHandleEx in script.c
- log_handle was not getting closed always.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair 2b1e5867f0 Replace Sleep by a Wait function that pumps messages
- The wait function optionally calls IsDialogMessage() if a dialog
  handle is specified. For other customizations the caller can
  install a WH_MSGFILTER hook. The hook will get called with
  nCode = MSGF_OVPN_WAIT and lParam = &msg.

- Use this in place of Sleep in main.c, scripts.c and PLAP dll.

Fixes #576

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair 141a687ddd Set status window as the owner of modal dialogs in same thread
For all dialogs in a thread, set its status window in the same
thread as the owner.

Also set the owner of message boxes appropriately instead of
using NULL. This has the side effect of some of the modal message
popups blocking access to the status Window until dismissed.

Next:
Replace Sleep by a wait that pumps messages.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair a8771e94a2 Delete an extraneous backslash in the resource file for Russian
- Fixes: res/openvpn-gui-res-ru.rc:414: unrecognized escape sequence

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-23 08:04:06 -08:00
Selva Nair 9a1e6b08c6 Scroll log window after appending text
- Automatic scroll sometimes does not appear to work as expected.
  Add an explicit command to scroll to current selection.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-23 08:04:06 -08:00
Selva Nair 4085f259a6 On WM_CLOSE do not ask user confirmation
- WM_CLOSE is sent if the process is terminated from task manager
  or by taskkill etc. Waiting for user confirmation in such cases
  leads to abnormal termination of process leaving behind openvpn.exe,
  active connections state not saved to the registry etc.

  CloseApplication() now gets a second argument ask_user.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-23 08:04:06 -08:00
Selva Nair acb5b8f9c8 Fix a handle leak: close registry key in localization.c
- Also call Kill the IDT_STOP_TIMER in StatusDialogFunc. Though timers
  will get destroyed during Window destruction an explicit KillTimer
  in case still running is the "right" thing to do.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-23 08:02:40 -08:00
Selva Nair aaeb8d2700 Fix memory leak in PLAP
When LogonUI unloads and reloads the PLAP dll, or when the provider
is released and re-created, memory allocated for config list and
groups leak.

- Fix by freeing config list and groups in DeleteUI

We do not call this before exiting WinMain in the GUI code,
as its hard to do it safely -- have to ensure all status
threads have terminated. Anyway, freeing is only cosmetic in this case.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-23 08:02:40 -08:00
Frank Lichtenheld 828399526d Bump version to 11.37.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-26 16:52:10 +01:00
Frank Lichtenheld b58925d5c4 Update CHANGES.rst for 11.37
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-26 16:49:35 +01:00
Lev Stipakov e923f2caa8 Fix broken menu functionality with single profile
To get connection for menu command, we use "dwMenuData" property
of a menu. With single connection profile we read "dwMenuData"
of a main menu, not a submenu. There has been a bug in code which hasn't
set "dwMenuData" for the main menu but it has worked until recently, since
this property stored index of connection array and index 0 has always
worked.

Since commit 94179911 ("Use a list instead of array for connections list")
we have switched to a linked list and store list pointer in dwMenuData.
However due to bug dwMenuData has always being 0, and logic which
fetches connections doesn't work:

        minfo.fMask = MIM_MENUDATA;
        GetMenuInfo((HMENU) lParam, &minfo);
        c  = (connection_t *) minfo.dwMenuData;
        if (!c)
            break; /* ignore invalid connection */

Fix by assigning main menu's dwMenuData to a head of connections list.

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

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-01-26 16:41:32 +01:00
Frank Lichtenheld 11bdc44481 Bump version to 11.36.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-25 15:05:24 +01:00
Selva Nair 555fe4c948 Update CHANGES.rst
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-25 14:51:20 +01:00
Selva Nair 152130e003
Check return value of SetProp() (#591)
* Check return value of SetProp

- If SetProp() is unsuccessful, we'll crash later when GetProp()
  returns null. Add a check, log the error and close the dialog.
  
  We could abort here, but closing the current dialog and possibly the
  corresponding connection, provides a chance for the user to fix the OOM
  condition which is the most likely cause of SetProp() failure.

- In pkcs11.c if SetProp() fails just do not use bold font for
  header instead of leaking the font resource.
  Also correct a bad fixup in commit 80697ecae6: hfontProp was not set!

  Github: Fixes OpenVPN/openvpn-gui#577
  
  Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-24 11:40:26 -05:00
Lev Stipakov 7c11841f5d Suppress certain warnings
We have tons of warnings like

  warning C4244: '=': conversion from 'DWORD' to 'LANGID', possible loss of data
  warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
  warning C4996: 'wcsncpy': This function or variable may be unsafe

We should fix those at some point, but meanwhile let's suppress those since they
pollute build logs and make it very hard to analyse.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-01-20 17:26:02 -08:00
Selva Nair 939cbfd5d5 Do not open multiple Settings Windows
- Do not allow more than one settings menu to be opened

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-20 10:27:37 -08:00
Selva Nair 71c0a251bf Do not use assert as it can terminate LogonUI in PLAP use
- assert while on login screen is hard to get out of.

Only one of these occurrences is relevant for PLAP, but not using assert
at all looks a safer option.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-20 10:27:37 -08:00
Selva Nair 80697ecae6 Property not removed due to wrong property name in pkcs11.c
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-20 10:27:37 -08:00
Selva Nair 9417991168 Use a list instead of array for connections list
Currently we use an array of connection pointers which needs
to be reallocated when space runs out. But, that happens from
the main thread while the status thread may be referring to those
pointers. Its very hard to fence against possible invalid memory
access. Instead, use a list so that connection pointer never
changes once created.

The connection list is no longer recreated from scratch even when
no connections are active. This means configs added while GUI is
running will always appear at the bottom of the root group listing
until the GUI is restarted.

TODO: This behaviour could be improved by scanning through the groups to
graft new configs at the right branch in the config-group tree.

v2: removed unused references to SetMenuStatusById()

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-19 14:08:15 -08:00
Selva Nair 8a4fec9d13 Remove restriction of num_configs related to management_port_offset
Since we started finding a free port dynamically, management_port_offset
is used only for making an initial hint. The limit applied to num_configs
base don this does not make sense any longer.

Also the current code does not work as expected as we allow changing of
management_port_offset from the settings menu.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-19 14:08:15 -08:00
Frank Lichtenheld 724a2409f9 Makefile.am: Fix dist* targets to include all required files
Also fix "make distcheck" to actually succeed.

Fixes #585

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-19 12:30:10 -08:00
Selva Nair 6c6bf9e4e6 Bugfix AutoCloseHandler(): accommodate wraparound of 32 bit time
- GetTickcount() and current-time passed-in to the callback are
  both 32 bit which wraps around every ~50 days. In the stop
  condition compare the elasped ticks and timeout value instead
  of end-time and now. The latter can wraparound in a long-running
  process.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-19 09:43:30 -08:00
bovirus e4089c2141
Update italian language (#580)
* Update italian language
2023-01-18 23:12:35 -05:00
Frank Lichtenheld e0d57b8d80 Bump version to 11.35.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-12 14:27:37 +01:00
Frank Lichtenheld c354c19e8f .gitignore: update
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-01-12 14:02:26 +01:00
Selva Nair 53ae2844b6 Update CHANGES.rst
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-12 10:09:09 +01:00
Selva Nair 28a568201c Handle CONNECTED,ROUTE_ERROR state message
When connected, the daemon now reports the state as
CONNECTED,ROUTE_ERROR on routing errors that would have been
reported as CONNECTED,SUCCESS in the past.

To not overly disrupt the current behaviour we treat CONNECTED,ROUTE_ERROR
almost the same was as CONNECTED,SUCCESS except that an error is logged and
the status window is popped up if not already open for all cases other
that CONNECTED,SUCCESS.

Further, the icons on the status window, is left at yellow
and the status text is set to "Connected with routing errors"
in case of ROUTE_ERROR.

Tray and menu icons will change to green. Leaving them yellow is not
persistent as we do not yet have a state variable in the GUI that distinguishes
between "successfully connected" and "connected with route errors".

TODO: re-work this CONNECTED state handling based on how critical
ROUTE_ERROR is in real use.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-12 10:09:09 +01:00
Selva Nair b4e3e076b8 Support colouring of WriteStatusLog messages
If the prefix string includes ERROR or WARNING these messages
are now shown in colour (red or yellow) similar to how log lines
are displayed.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-12 10:09:09 +01:00