Commit Graph

8 Commits (7d23e6341116f8717dc7803533a0c6bc7a54f485)

Author SHA1 Message Date
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 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 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
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 c1b0f0bbd2 Auto adjust column widths in pkcs11 list view
Currently a fixed width is assigned for valid until
column and its not enough for the date in all locales
(e.g., date in Chinese traditional overflows).

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-08-10 09:22:12 -04:00
Selva Nair 6d67f81814 Show certificate details on double-clicking pkcs11 list entries
- For mingw builds, currently this works only for x64 target
  due to missing library for i686 target.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-07-19 12:08:02 +02:00
Selva Nair 84be448777 Handle pkcs11-id query from daemon
Add support for selecting pkcs11-id  from the GUI.
Requires --management-pkcs11-id in the config file.
This option is not added by the GUI.

A list of all available pkcs11 certificates are presented to the
user with buttons OK, Cancel, Retry. OK submits the selected
entry, Cancel closes the connection, Retry reconstructs the
list of certificates by querying the daemon again. The latter
can be used to retry after inserting a token.

If no certificates are found, a message suggesting to insert
a token and press 'Retry' is displayed.

The list shows the "Issued-to", "Issued-by" names
(usually the subject & issuer common names) and valid-until
date in current locale for each certificate.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-07-19 12:08:02 +02:00