Commit Graph

9 Commits (577d982b51670f7f68d6dad9d0bf08f8a01879ba)

Author SHA1 Message Date
Selva Nair 577d982b51 PLAP: try to start automatic service if not running
Connection profiles shown on the login screen using PLAP
requires automatic service that starts openvpn.exe
processes for these profiles.

This commit adds an attempt to start the service from
PLAP dll. The service is started only if any PLAP enabled
profiles are found.

As starting the service can spawn up OpenVPN.exe processes and
the GUI may attach to them, auto-connect in the GUI is
suspended during session lock to leave the connections free to
be controlled from PLAP screen.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-19 09:49:15 -04:00
Selva Nair 67a8db7664 PLAP: Do not show profiles with no management address
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-19 09:49:15 -04:00
Selva Nair 2ea4bf9229 Add a test program for PLAP provider module
- instantiate OpenVPN PLAP provider which will enumerate configs
  in config-auto directory.
- Attempt to connect each config found one after the other

The test program is deliberately written in C++ as that's how most
Windows programs (and likely, LogonUI.exe) may use the COM object.

Note that duplicate configs are ignored, so ensure  that config
files in config-auto are not "shadowed" by identical named one's
in user's profile or in global config folder.

Additional notes:
The test program is not linked to the plap dll.
Instead it finds the module using CoGetClassObject,
so the plap dll must be registered in the system.

It also tests dynamically loading the dll from
C:\Program Files\OpenVPN\bin\libopenvpn_plap.dll
which should succeed even if the registration is not
proper.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00
Selva Nair a60b3c540b Enable MSVC build of libopenvpn_plap.dll
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00
Selva Nair c5c856aaa1 Add credentialprovider.h not in mingw-w64
This header has been recently added to mingw-w64 on our
request. Until its available in released versions,
wget it from mingw-w64's github repo.

Only affects autotools-based builds -- MSVC builds will pick the
native header.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00
Selva Nair ed0ceeb95b Add a progress dialog during Connect()
- The dialog supports retry and cancel and shows
  a progress marquee

Signed-off-by: Selva Nair <selva.nair@gmail.com
2022-10-17 11:05:44 -04:00
Selva Nair e64b18074f Intercept management callbacks for better control of the UI
- Dialog windows of connections can popup at any time due to
  restarts not in user's control. Avoid this by marking current
  current profile being connected, and intercepting dialogs for
  other profiles.

  This is implemented by hooking into management callbacks such as
  OnPassword, OnNeedOk etc.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00
Lev Stipakov 70610afc2f Add a BMP image for PLAP tile and use it 2022-10-17 11:05:44 -04:00
Selva Nair a500b9553e Implement Pre-Logon Access Provider for start before logon
- COM interfaces for ICredentialProvider and
  IConnectableCredentialProviderCredential combined
  with a trimmed down user-interface implemented as
  libopenvpn_plap.dll

- Connections autostarted by OpenVPNService are enumerated
  as possible PLAP connections. The user is expected to leave
  these in management hold so that "connect" will popup any
  required user dialogs.

To use:
 - Register the dll as a PLAP provider (see included .reg files)
 - The enumerated connections will show up as tiles in the PLAP
   screen of the login desktop (secure desktop).

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00