Compare commits

...

24 Commits

Author SHA1 Message Date
f05f8dab76 Version set to 1.2 2017-05-17 13:10:54 +02:00
ba11abff1d WLANManager.exe now deployed as WLANManager-Win32.exe and WLANManager-x64.exe 2017-05-17 13:09:26 +02:00
22f578b451 Documentation update 2017-05-17 12:53:10 +02:00
7bc76ac54c Supported OS list update 2017-05-17 12:28:14 +02:00
5e35c5769a Documentation update 2017-05-17 12:25:39 +02:00
3f888dd781 Secondary error message pop-up removed 2017-05-17 10:26:41 +02:00
5b065bce3d Update README.md 2017-05-16 13:34:06 +02:00
d8a1fe95aa Sub-module update 2017-05-16 13:31:39 +02:00
f57ee6c0f8 Documentation update 2017-05-16 13:31:24 +02:00
3364719ba1 WLANManager support for multiple wireless interfaces 2017-05-16 13:11:10 +02:00
e46739a510 Indentation fix 2017-03-14 09:36:48 +01:00
adc860fa6e Version set to 1.2-beta2 2017-02-24 11:09:27 +01:00
d4cc3053a6 Clean-up 2017-02-23 12:09:00 +01:00
38c6189d5f AuthMode setting correctly logged now 2017-02-23 11:18:23 +01:00
bf4c4d846e Incorrect CoCreateInstance() result evaluation fixed 2017-02-23 11:05:13 +01:00
5040ebba8e Pop-up window single flash replaced with periodic flashing 2017-02-22 11:48:39 +01:00
4598528765 Debugging-related exception in WlanUIEditProfile() resolved 2017-02-22 11:11:57 +01:00
8fbcf27f6a Locale is dynamic now, since wxLocale does not support re-initialization (when module is reused) 2017-02-22 09:42:18 +01:00
48d46617d2 Pop-ups are no longer children of the GetForegroundWindow() when no parent window is specified. Instead, they are displayed as a standalone app. 2017-02-21 15:13:20 +01:00
e7d5ecb50b Documentation update 2017-02-21 12:01:54 +01:00
6a77f3f7b3 New version of wxExtend 2017-02-20 10:57:53 +01:00
a4673f9fb9 Compilation of debug MSI files fixed 2017-02-20 10:05:03 +01:00
c84a8b5a70 Documentation update 2017-02-13 08:00:07 +01:00
31a3b67cba 64-bit language detection removed from 32-bit MSI resolving ICE80 warning 2017-02-09 13:40:43 +01:00
19 changed files with 373 additions and 251 deletions

Binary file not shown.

BIN
Makefile

Binary file not shown.

View File

@@ -1,8 +1,10 @@
# GÉANTLink
Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X plug-ins for enterprise network authentication
Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X clients for enterprise network authentication
## Features
- Integrates into Windows seamlessly
- Wired and wireless network support
### Authentication methods
- EAP-TTLS with the following inner methods:
@@ -14,7 +16,7 @@ Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X plug-ins for enterp
### Security
- Microsoft Windows Credential Manager stored user credentials
- User credentials can be shared between different network profiles
- User credentials can be shared between different network profiles, regardless of their connection: wired or wireless
- Encrypted EapHost inter-process communication
- TLS:
- Separate trusted root CA list
@@ -30,11 +32,21 @@ Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X plug-ins for enterp
- Lockable network profile configuration
### Deployment
- Released as multi-lingual 32 and 64-bit MSI packages
- Released as multi-lingual 32 and 64-bit MSI packages; Group Policy deployment supported
- [MsiUseFeature utility](https://github.com/Amebis/GEANTLink/tree/master/MsiUseFeature) for GÉANTLink install state testing (for embedding GÉANTLink into other setup packages)
- [CredWrite utility](https://github.com/Amebis/GEANTLink/tree/master/CredWrite) for automated user credential import to Credential Manager
- [WLANManager utility](https://github.com/Amebis/GEANTLink/tree/master/WLANManager) to allow network profile configuration dialog shortcuts
### Supported operating systems
- Windows Vista, Windows Server 2008
- Windows 7, Windows Server 2008 R2
- Windows 8 Desktop, Windows Server 2012
- Windows 8.1 Desktop, Windows Server 2012 R2
- Windows 10 Desktop, Windows Server 2016
## Download
Binaries are available for download [here](https://github.com/Amebis/GEANTLink/releases).
## Building
### Building Environment Requirements
@@ -117,3 +129,6 @@ Command | Explanation
`nmake SetupDebug` | Builds a debug version of project and debug MSI setup files. The resulting files can be found in `output\Setup` folder.
The `/ls` flag can be appended to the commands above to reduce NMAKEs verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading.
### Translating into your language
GÉANTLink is fully localizable. We kindly invite you to help [translating it on Transifex](https://www.transifex.com/eduroam_devel/geantlink/).

View File

@@ -60,6 +60,10 @@ static int WLANManager()
return -1;
}
wstring interface_name;
if (nArgs >= 5 && _wcsicmp(pwcArglist[3], L"interface") == 0)
interface_name = pwcArglist[4];
// Open WLAN handle.
DWORD dwNegotiatedVersion;
wlan_handle wlan;
@@ -83,21 +87,55 @@ static int WLANManager()
interfaces.reset(pInterfaceList);
}
tstring_guid devclass_net(GUID_DEVCLASS_NET);
bool profile_found = false;
for (DWORD i = 0; i < interfaces->dwNumberOfItems; i++) {
if (interfaces->InterfaceInfo[i].isState == wlan_interface_state_not_ready) {
// This interface is not ready.
continue;
}
if (!interface_name.empty()) {
// Read the interface name from registry.
reg_key key;
if (key.open(HKEY_LOCAL_MACHINE, tstring_printf(_T("SYSTEM\\CurrentControlSet\\Control\\Network\\%s\\%s\\Connection"), devclass_net.c_str(), tstring_guid(interfaces->InterfaceInfo[i].InterfaceGuid).c_str()).c_str(), 0, KEY_READ)) {
wstring name;
if (RegQueryStringValue(key, _T("Name"), name) == ERROR_SUCCESS && _wcsicmp(interface_name.c_str(), name.c_str()) != 0) {
// Not the interface we are interested in.
continue;
}
}
}
unique_ptr<WLAN_PROFILE_INFO_LIST, WlanFreeMemory_delete<WLAN_PROFILE_INFO_LIST> > profiles;
{
// Get a list of profiles.
WLAN_PROFILE_INFO_LIST *pProfileList;
DWORD dwResult = WlanGetProfileList(wlan, &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, &pProfileList);
if (dwResult != ERROR_SUCCESS) {
DisplayError(_T("%s function failed (error %u)."), _T("WlanGetProfileList"), dwResult);
return 4;
}
profiles.reset(pProfileList);
}
for (DWORD j = 0; j < profiles->dwNumberOfItems; j++)
if (_wcsicmp(profiles->ProfileInfo[j].strProfileName, pwcArglist[2]) == 0) {
profile_found = true;
break;
}
if (!profile_found)
continue;
// Launch WLAN profile config dialog.
// Note: When a debugger is attached to this process the WlanUIEditProfile() will raise an exception and fail.
WLAN_REASON_CODE wlrc;
WLAN_REASON_CODE wlrc = L2_REASON_CODE_SUCCESS;
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
if (dwResult != ERROR_SUCCESS) {
DisplayError(_T("%s function failed (error %u)."), _T("WlanUIEditProfile"), dwResult);
// WlanUIEditProfile() displays own error dialog on failure.
//DisplayError(_T("%s function failed (error %u)."), _T("WlanUIEditProfile"), dwResult);
return 5;
}
if (wlrc != WLAN_REASON_CODE_SUCCESS) {
} else if (wlrc != WLAN_REASON_CODE_SUCCESS) {
tstring reason;
if (WlanReasonCodeToString(wlrc, reason, NULL) == ERROR_SUCCESS)
DisplayError(_T("%s function failed: %s"), _T("WlanUIEditProfile"), reason.c_str());
@@ -108,6 +146,9 @@ static int WLANManager()
break;
}
if (!profile_found)
DisplayError(_T("%ls profile not found."), pwcArglist[2]);
return 0;
}
@@ -119,6 +160,13 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
int res = 0;
{
// Note: When a debugger is attached to this process, the WlanUIEditProfile() will raise an exception and fail.
// It was accidentially discovered, that COM initialization resolves this issue.
com_initializer com_init(NULL);
{
// Initialize Windows XP visual styles
INITCOMMONCONTROLSEX icc;
@@ -129,7 +177,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
pfnWlanReasonCodeToString = WlanReasonCodeToString;
int res = WLANManager();
res = WLANManager();
}
assert(!_CrtDumpMemoryLeaks());
return res;

View File

@@ -1,12 +1,13 @@
#WLANManager
# WLANManager
Invokes standard Windows Wireless Network Properties dialog
##Usage
## Usage
```
WLANManager profile <name>
WLANManager profile <profile name> [interface <interface name>]
```
- `name` - The name of the network profile (not neccessarely the same as SSID)
- `profile name` - The name of the network profile (not neccessarely the same as SSID)
- `interface name` - The name of the specific network interface to search the profile at
Return codes:
- -1 = Invalid parameters

View File

@@ -28,6 +28,7 @@
#include <Windows.h>
#include <CommCtrl.h>
#include <devguid.h>
#include <tchar.h>
#include <memory>

View File

@@ -29,7 +29,7 @@
// Product version as a single DWORD
// Note: Used for version comparison within C/C++ code.
//
#define PRODUCT_VERSION 0x01020200
#define PRODUCT_VERSION 0x01020400
//
// Product version by components
@@ -39,26 +39,26 @@
//
#define PRODUCT_VERSION_MAJ 1
#define PRODUCT_VERSION_MIN 2
#define PRODUCT_VERSION_REV 2
#define PRODUCT_VERSION_REV 4
#define PRODUCT_VERSION_BUILD 0
//
// Human readable product version and build year for UI
//
#define PRODUCT_VERSION_STR "1.2-beta1"
#define PRODUCT_BUILD_YEAR_STR "2016"
#define PRODUCT_VERSION_STR "1.2"
#define PRODUCT_BUILD_YEAR_STR "2017"
//
// Numerical version presentation for ProductVersion propery in
// MSI packages (syntax: N.N[.N[.N]])
//
#define PRODUCT_VERSION_INST "1.2.2"
#define PRODUCT_VERSION_INST "1.2.4"
//
// The product code for ProductCode property in MSI packages
// Replace with new on every version change, regardless how minor it is.
//
#define PRODUCT_VERSION_GUID "{FF5DD25D-917C-4B33-81D3-C75B5E1C8CA8}"
#define PRODUCT_VERSION_GUID "{3490271F-380F-4618-83F9-114A340E2C00}"
//
// Product vendor

View File

@@ -360,6 +360,14 @@ public:
///
/// Constructs a credential dialog
///
/// \param[in] prov Provider configuration data
/// \param[in] parent Parent window
/// \param[in] id An identifier for the dialog. A value of -1 is taken to mean a default.
/// \param[in] title The title of the dialog
/// \param[in] pos The dialog position. The value \c wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
/// \param[in] size The dialog size. The value \c wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
/// \param[in] style The window style
///
wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("EAP Credentials"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
};

View File

@@ -108,10 +108,10 @@ void eap::config_method_eapgtc::load(_In_ IXMLDOMNode *pConfigRoot)
} else
throw invalid_argument(string_printf(__FUNCTION__ " Unsupported authentication mode (%ls).", (BSTR)auth_mode));
m_module.log_config((xpath + L"/AuthMode").c_str(), (BSTR)auth_mode);
// Load method configuration.
config_method_with_cred::load(pConfigRoot);
m_module.log_config((xpath + L"/AuthMode").c_str(), auth_mode);
}

View File

@@ -100,6 +100,14 @@ public:
///
/// Constructs a credential dialog
///
/// \param[in] prov Provider configuration data
/// \param[in] parent Parent window
/// \param[in] id An identifier for the dialog. A value of -1 is taken to mean a default.
/// \param[in] title The title of the dialog
/// \param[in] pos The dialog position. The value \c wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
/// \param[in] size The dialog size. The value \c wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
/// \param[in] style The window style
///
wxGTCResponseDialog(const eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("GTC Challenge"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
};

View File

@@ -55,7 +55,6 @@ wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindow
sb_root_ca_btn->Add( m_root_ca_add_file, 0, wxRIGHT|wxLEFT, 5 );
m_root_ca_remove = new wxButton( sb_server_trust->GetStaticBox(), wxID_ANY, _("&Remove CA"), wxDefaultPosition, wxDefaultSize, 0 );
m_root_ca_remove->Enable( false );
m_root_ca_remove->SetToolTip( _("Removes selected certificate authorities from the list") );
sb_root_ca_btn->Add( m_root_ca_remove, 0, wxLEFT, 5 );

View File

@@ -659,7 +659,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>

View File

@@ -43,7 +43,7 @@ public:
protected:
static wxCriticalSection s_lock; ///< Initialization lock
static unsigned long s_init_ref_count; ///< Initialization reference counter
static wxLocale s_locale; ///< Locale
static wxLocale *s_locale; ///< Locale
};
@@ -118,19 +118,27 @@ void eap::peer_ttls_ui::invoke_config_ui(
// Initialize application.
wxInitializerPeer init(m_instance);
{
wxWindow *parent;
if (hwndParent) {
// Create wxWidget-approved parent window.
wxWindow parent;
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
parent.AdoptAttributesFromHWND();
wxTopLevelWindows.Append(&parent);
parent = new wxWindow;
parent->SetHWND((WXHWND)hwndParent);
parent->AdoptAttributesFromHWND();
wxTopLevelWindows.Append(parent);
} else
parent = NULL;
// Create and launch configuration dialog.
wxEAPConfigDialog<wxTTLSConfigWindow> dlg(cfg, &parent);
wxEAPConfigDialog<wxTTLSConfigWindow> dlg(cfg, parent);
if (!parent) {
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
::FlashWindowEx(&fwi);
}
result = dlg.ShowModal();
wxTopLevelWindows.DeleteObject(&parent);
parent.SetHWND((WXHWND)NULL);
if (parent) {
wxTopLevelWindows.DeleteObject(parent);
parent->SetHWND((WXHWND)NULL);
}
}
@@ -153,6 +161,9 @@ void eap::peer_ttls_ui::invoke_identity_ui(
_Out_ DWORD *pdwUserDataOutSize,
_Out_ LPWSTR *ppwszIdentity)
{
#ifdef _DEBUG
//::Sleep(10000);
#endif
assert(ppwszIdentity);
// Unpack configuration.
@@ -178,19 +189,26 @@ void eap::peer_ttls_ui::invoke_identity_ui(
// Initialize application.
wxInitializerPeer init(m_instance);
{
wxWindow *parent;
if (hwndParent) {
// Create wxWidget-approved parent window.
wxWindow parent;
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
parent.AdoptAttributesFromHWND();
wxTopLevelWindows.Append(&parent);
parent = new wxWindow;
parent->SetHWND((WXHWND)hwndParent);
parent->AdoptAttributesFromHWND();
wxTopLevelWindows.Append(parent);
} else
parent = NULL;
if (cfg.m_providers.size() > 1) {
// Multiple identity providers: User has to select one first.
wxEAPProviderSelectDialog dlg(cfg, &parent);
wxEAPProviderSelectDialog dlg(cfg, parent);
// Centre and display dialog.
dlg.Centre(wxBOTH);
if (!parent) {
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
::FlashWindowEx(&fwi);
}
if ((result = dlg.ShowModal()) == wxID_OK) {
cfg_prov = dlg.GetSelection();
assert(cfg_prov);
@@ -240,7 +258,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
src_outer != eap::credentials::source_config && eap::config_method::status_cred_begin <= cfg_method->m_last_status && cfg_method->m_last_status < eap::config_method::status_cred_end)
{
// Build dialog to prompt for outer credentials.
wxEAPCredentialsDialog dlg(*cfg_prov, &parent);
wxEAPCredentialsDialog dlg(*cfg_prov, parent);
if (eap::config_method::status_cred_begin <= cfg_method->m_last_status && cfg_method->m_last_status < eap::config_method::status_cred_end)
dlg.AddContent(new wxEAPCredentialWarningPanel(*cfg_prov, cfg_method->m_last_status, &dlg));
auto panel = new wxTLSCredentialsPanel(*cfg_prov, *cfg_method, *cred, &dlg, false);
@@ -253,6 +271,10 @@ void eap::peer_ttls_ui::invoke_identity_ui(
// Centre and display dialog.
dlg.Centre(wxBOTH);
if (!parent) {
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
::FlashWindowEx(&fwi);
}
if ((result = dlg.ShowModal()) == wxID_OK) {
// Write credentials to credential manager.
if (panel->GetRemember()) {
@@ -290,7 +312,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
#endif
{
// Native inner methods. Build dialog to prompt for inner credentials.
wxEAPCredentialsDialog dlg(*cfg_prov, &parent);
wxEAPCredentialsDialog dlg(*cfg_prov, parent);
if (eap::config_method::status_cred_begin <= cfg_method->m_inner->m_last_status && cfg_method->m_inner->m_last_status < eap::config_method::status_cred_end)
dlg.AddContent(new wxEAPCredentialWarningPanel(*cfg_prov, cfg_method->m_inner->m_last_status, &dlg));
wxEAPCredentialsPanelBase *panel = NULL;
@@ -321,6 +343,10 @@ void eap::peer_ttls_ui::invoke_identity_ui(
// Centre and display dialog.
dlg.Centre(wxBOTH);
if (!parent) {
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
::FlashWindowEx(&fwi);
}
if ((result = dlg.ShowModal()) == wxID_OK) {
// Write credentials to credential manager.
if (panel->GetRemember()) {
@@ -374,8 +400,9 @@ void eap::peer_ttls_ui::invoke_identity_ui(
}
}
wxTopLevelWindows.DeleteObject(&parent);
parent.SetHWND((WXHWND)NULL);
if (parent) {
wxTopLevelWindows.DeleteObject(parent);
parent->SetHWND((WXHWND)NULL);
}
}
@@ -434,12 +461,15 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
// Initialize application.
wxInitializerPeer init(m_instance);
{
wxWindow *parent;
if (hwndParent) {
// Create wxWidget-approved parent window.
wxWindow parent;
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
parent.AdoptAttributesFromHWND();
wxTopLevelWindows.Append(&parent);
parent = new wxWindow;
parent->SetHWND((WXHWND)hwndParent);
parent->AdoptAttributesFromHWND();
wxTopLevelWindows.Append(parent);
} else
parent = NULL;
{
sanitizing_wstring
@@ -447,7 +477,7 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
response;
// Build dialog to prompt for response.
wxGTCResponseDialog dlg(*cfg_prov, &parent);
wxGTCResponseDialog dlg(*cfg_prov, parent);
auto panel = new wxGTCResponsePanel(response, challenge.c_str(), &dlg);
dlg.AddContent(panel);
@@ -457,6 +487,10 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
// Centre and display dialog.
dlg.Centre(wxBOTH);
if (!parent) {
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
::FlashWindowEx(&fwi);
}
if ((result = dlg.ShowModal()) == wxID_OK) {
// Save response.
ctx.m_data.assign(
@@ -465,8 +499,9 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
}
}
wxTopLevelWindows.DeleteObject(&parent);
parent.SetHWND((WXHWND)NULL);
if (parent) {
wxTopLevelWindows.DeleteObject(parent);
parent->SetHWND((WXHWND)NULL);
}
}
@@ -523,9 +558,10 @@ wxInitializerPeer::wxInitializerPeer(_In_ HINSTANCE instance)
// Do our wxWidgets configuration and localization initialization.
wxInitializeConfig();
if (wxInitializeLocale(s_locale)) {
s_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
s_locale.AddCatalog(wxT("EAPTTLSUI"));
s_locale = new wxLocale;
if (wxInitializeLocale(*s_locale)) {
s_locale->AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
s_locale->AddCatalog(wxT("EAPTTLSUI"));
}
}
@@ -537,9 +573,14 @@ wxInitializerPeer::~wxInitializerPeer()
return;
wxEntryCleanup();
if (s_locale) {
delete s_locale;
s_locale = NULL;
}
}
wxCriticalSection wxInitializerPeer::s_lock;
unsigned long wxInitializerPeer::s_init_ref_count = 0;
wxLocale wxInitializerPeer::s_locale;
wxLocale *wxInitializerPeer::s_locale = NULL;