Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
f05f8dab76 | |||
ba11abff1d | |||
22f578b451 | |||
7bc76ac54c | |||
5e35c5769a | |||
3f888dd781 | |||
5b065bce3d | |||
d8a1fe95aa | |||
f57ee6c0f8 | |||
3364719ba1 | |||
e46739a510 | |||
adc860fa6e | |||
d4cc3053a6 | |||
38c6189d5f | |||
bf4c4d846e | |||
5040ebba8e | |||
4598528765 | |||
8fbcf27f6a | |||
48d46617d2 | |||
e7d5ecb50b | |||
6a77f3f7b3 | |||
a4673f9fb9 | |||
c84a8b5a70 | |||
31a3b67cba | |||
b44cb66b2a | |||
690a6d54d2 | |||
e7e57abf52 | |||
bda31a487f | |||
2908bc31a3 | |||
66dd2bf283 |
@@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: EAPMethods\n"
|
"Project-Id-Version: EAPMethods\n"
|
||||||
"POT-Creation-Date: 2017-02-02 18:14+0100\n"
|
"POT-Creation-Date: 2017-02-09 13:15+0100\n"
|
||||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||||
@@ -481,7 +481,7 @@ msgstr ""
|
|||||||
msgid "Configuring EAP method failed (error %u)."
|
msgid "Configuring EAP method failed (error %u)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:16 master/lib/GTC_UI/include/GTC_UI.h:93
|
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:16 master/lib/GTC_UI/include/GTC_UI.h:103
|
||||||
msgid "GTC Challenge"
|
msgid "GTC Challenge"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -497,11 +497,23 @@ msgstr ""
|
|||||||
msgid "Enter your response here"
|
msgid "Enter your response here"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/GTC_UI/src/GTC_UI.cpp:33
|
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:70
|
||||||
msgid "GTC User ID"
|
msgid "EAP-GTC authentication &mode:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/GTC_UI/src/GTC_UI.cpp:69
|
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:75
|
||||||
|
msgid "Select EAP-GTC authentication mode from the list"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: master/lib/GTC_UI/src/GTC_UI.cpp:39
|
||||||
|
msgid "Challenge/Response"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: master/lib/GTC_UI/src/GTC_UI.cpp:41
|
||||||
|
msgid "Password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: master/lib/GTC_UI/src/GTC_UI.cpp:119
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s Challenge"
|
msgid "%s Challenge"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -713,7 +725,7 @@ msgstr ""
|
|||||||
msgid "Custom outer identity to use"
|
msgid "Custom outer identity to use"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:262 master/lib/TTLS_UI/src/Module.cpp:319
|
#: master/lib/TTLS_UI/src/Module.cpp:262 master/lib/TTLS_UI/src/Module.cpp:330
|
||||||
#: ver1.0/lib/TTLS_UI/src/Module.cpp:274 ver1.0/lib/TTLS_UI/src/Module.cpp:284
|
#: ver1.0/lib/TTLS_UI/src/Module.cpp:274 ver1.0/lib/TTLS_UI/src/Module.cpp:284
|
||||||
#: ver1.1/lib/TTLS_UI/src/Module.cpp:262 ver1.1/lib/TTLS_UI/src/Module.cpp:318
|
#: ver1.1/lib/TTLS_UI/src/Module.cpp:262 ver1.1/lib/TTLS_UI/src/Module.cpp:318
|
||||||
#: master/lib/EAPBase_UI/include/EAP_UI.h:785
|
#: master/lib/EAPBase_UI/include/EAP_UI.h:785
|
||||||
@@ -723,7 +735,7 @@ msgstr ""
|
|||||||
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
|
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:264 master/lib/TTLS_UI/src/Module.cpp:321
|
#: master/lib/TTLS_UI/src/Module.cpp:264 master/lib/TTLS_UI/src/Module.cpp:332
|
||||||
#: ver1.0/lib/TTLS_UI/src/Module.cpp:276 ver1.0/lib/TTLS_UI/src/Module.cpp:286
|
#: ver1.0/lib/TTLS_UI/src/Module.cpp:276 ver1.0/lib/TTLS_UI/src/Module.cpp:286
|
||||||
#: ver1.1/lib/TTLS_UI/src/Module.cpp:264 ver1.1/lib/TTLS_UI/src/Module.cpp:320
|
#: ver1.1/lib/TTLS_UI/src/Module.cpp:264 ver1.1/lib/TTLS_UI/src/Module.cpp:320
|
||||||
#: master/lib/EAPBase_UI/include/EAP_UI.h:788
|
#: master/lib/EAPBase_UI/include/EAP_UI.h:788
|
||||||
@@ -732,22 +744,22 @@ msgstr ""
|
|||||||
msgid "Writing credentials failed."
|
msgid "Writing credentials failed."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:356 ver1.1/lib/TTLS_UI/src/Module.cpp:355
|
#: master/lib/TTLS_UI/src/Module.cpp:367 ver1.1/lib/TTLS_UI/src/Module.cpp:355
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invoking EAP identity UI failed (error %u, %s, %s)."
|
msgid "Invoking EAP identity UI failed (error %u, %s, %s)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:358 ver1.1/lib/TTLS_UI/src/Module.cpp:357
|
#: master/lib/TTLS_UI/src/Module.cpp:369 ver1.1/lib/TTLS_UI/src/Module.cpp:357
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invoking EAP identity UI failed (error %u)."
|
msgid "Invoking EAP identity UI failed (error %u)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:485
|
#: master/lib/TTLS_UI/src/Module.cpp:496
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invoking EAP interactive UI failed (error %u, %s, %s)."
|
msgid "Invoking EAP interactive UI failed (error %u, %s, %s)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/lib/TTLS_UI/src/Module.cpp:488
|
#: master/lib/TTLS_UI/src/Module.cpp:499
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invoking EAP interactive UI failed (error %u)."
|
msgid "Invoking EAP interactive UI failed (error %u)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -884,62 +896,38 @@ msgstr ""
|
|||||||
msgid "EAP Identity Provider"
|
msgid "EAP Identity Provider"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
msgid "EAP Methods"
|
msgid "EAP Methods"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:4
|
||||||
msgid "Modules to support individual EAP methods"
|
msgid "Modules to support individual EAP methods"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
msgid "TTLS"
|
msgid "TTLS"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: master/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: master/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: ver1.0/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: ver1.0/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
#: ver1.1/EAPMethods/MSIBuild/en_US.Win32.Release.Feature-2.idtx:5
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Debug.Feature-2.idtx:5
|
|
||||||
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
#: ver1.1/EAPMethods/MSIBuild/en_US.x64.Release.Feature-2.idtx:5
|
||||||
msgid "Tunneled Transport Layer Security"
|
msgid "Tunneled Transport Layer Security"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
Binary file not shown.
23
README.md
23
README.md
@@ -1,20 +1,22 @@
|
|||||||
# GÉANTLink
|
# 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
|
## Features
|
||||||
|
- Integrates into Windows seamlessly
|
||||||
|
- Wired and wireless network support
|
||||||
|
|
||||||
### Authentication methods
|
### Authentication methods
|
||||||
- EAP-TTLS with the following inner methods:
|
- EAP-TTLS with the following inner methods:
|
||||||
- PAP
|
- PAP
|
||||||
- MSCHAPv2
|
- MSCHAPv2
|
||||||
- EAP-MSCHAPv2
|
- EAP-MSCHAPv2
|
||||||
- EAP-GTC
|
- EAP-GTC: Challenge/Response and Password authentication modes
|
||||||
- System-installed EAP method chaining (experimental)
|
- System-installed EAP method chaining (experimental)
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
- Microsoft Windows Credential Manager stored user credentials
|
- 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
|
- Encrypted EapHost inter-process communication
|
||||||
- TLS:
|
- TLS:
|
||||||
- Separate trusted root CA list
|
- 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
|
- Lockable network profile configuration
|
||||||
|
|
||||||
### Deployment
|
### 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)
|
- [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
|
- [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
|
- [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
|
||||||
|
|
||||||
### Building Environment Requirements
|
### 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.
|
`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 NMAKE’s verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading.
|
The `/ls` flag can be appended to the commands above to reduce NMAKE’s 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/).
|
||||||
|
@@ -60,6 +60,10 @@ static int WLANManager()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wstring interface_name;
|
||||||
|
if (nArgs >= 5 && _wcsicmp(pwcArglist[3], L"interface") == 0)
|
||||||
|
interface_name = pwcArglist[4];
|
||||||
|
|
||||||
// Open WLAN handle.
|
// Open WLAN handle.
|
||||||
DWORD dwNegotiatedVersion;
|
DWORD dwNegotiatedVersion;
|
||||||
wlan_handle wlan;
|
wlan_handle wlan;
|
||||||
@@ -83,21 +87,55 @@ static int WLANManager()
|
|||||||
interfaces.reset(pInterfaceList);
|
interfaces.reset(pInterfaceList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tstring_guid devclass_net(GUID_DEVCLASS_NET);
|
||||||
|
bool profile_found = false;
|
||||||
for (DWORD i = 0; i < interfaces->dwNumberOfItems; i++) {
|
for (DWORD i = 0; i < interfaces->dwNumberOfItems; i++) {
|
||||||
if (interfaces->InterfaceInfo[i].isState == wlan_interface_state_not_ready) {
|
if (interfaces->InterfaceInfo[i].isState == wlan_interface_state_not_ready) {
|
||||||
// This interface is not ready.
|
// This interface is not ready.
|
||||||
continue;
|
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.
|
// 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 = L2_REASON_CODE_SUCCESS;
|
||||||
WLAN_REASON_CODE wlrc;
|
|
||||||
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
|
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
|
||||||
if (dwResult != ERROR_SUCCESS) {
|
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;
|
return 5;
|
||||||
}
|
} else if (wlrc != WLAN_REASON_CODE_SUCCESS) {
|
||||||
if (wlrc != WLAN_REASON_CODE_SUCCESS) {
|
|
||||||
tstring reason;
|
tstring reason;
|
||||||
if (WlanReasonCodeToString(wlrc, reason, NULL) == ERROR_SUCCESS)
|
if (WlanReasonCodeToString(wlrc, reason, NULL) == ERROR_SUCCESS)
|
||||||
DisplayError(_T("%s function failed: %s"), _T("WlanUIEditProfile"), reason.c_str());
|
DisplayError(_T("%s function failed: %s"), _T("WlanUIEditProfile"), reason.c_str());
|
||||||
@@ -108,6 +146,9 @@ static int WLANManager()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!profile_found)
|
||||||
|
DisplayError(_T("%ls profile not found."), pwcArglist[2]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,18 +160,26 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
|
|||||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||||
UNREFERENCED_PARAMETER(nCmdShow);
|
UNREFERENCED_PARAMETER(nCmdShow);
|
||||||
|
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
// Initialize Windows XP visual styles
|
// Note: When a debugger is attached to this process, the WlanUIEditProfile() will raise an exception and fail.
|
||||||
INITCOMMONCONTROLSEX icc;
|
// It was accidentially discovered, that COM initialization resolves this issue.
|
||||||
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
com_initializer com_init(NULL);
|
||||||
icc.dwICC = ICC_WIN95_CLASSES | ICC_STANDARD_CLASSES | ICC_LINK_CLASS;
|
|
||||||
InitCommonControlsEx(&icc);
|
{
|
||||||
|
// Initialize Windows XP visual styles
|
||||||
|
INITCOMMONCONTROLSEX icc;
|
||||||
|
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||||
|
icc.dwICC = ICC_WIN95_CLASSES | ICC_STANDARD_CLASSES | ICC_LINK_CLASS;
|
||||||
|
InitCommonControlsEx(&icc);
|
||||||
|
}
|
||||||
|
|
||||||
|
pfnWlanReasonCodeToString = WlanReasonCodeToString;
|
||||||
|
|
||||||
|
res = WLANManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
pfnWlanReasonCodeToString = WlanReasonCodeToString;
|
|
||||||
|
|
||||||
int res = WLANManager();
|
|
||||||
|
|
||||||
assert(!_CrtDumpMemoryLeaks());
|
assert(!_CrtDumpMemoryLeaks());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
#WLANManager
|
# WLANManager
|
||||||
Invokes standard Windows Wireless Network Properties dialog
|
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:
|
Return codes:
|
||||||
- -1 = Invalid parameters
|
- -1 = Invalid parameters
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <CommCtrl.h>
|
#include <CommCtrl.h>
|
||||||
|
#include <devguid.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2016 Amebis
|
Copyright 2016 Amebis
|
||||||
Copyright 2016 GÉANT
|
Copyright 2016 GÉANT
|
||||||
|
|
||||||
This file is part of GÉANTLink.
|
This file is part of GÉANTLink.
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2016 Amebis
|
Copyright 2016 Amebis
|
||||||
Copyright 2016 GÉANT
|
Copyright 2016 GÉANT
|
||||||
|
|
||||||
This file is part of GÉANTLink.
|
This file is part of GÉANTLink.
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
// Product version as a single DWORD
|
// Product version as a single DWORD
|
||||||
// Note: Used for version comparison within C/C++ code.
|
// Note: Used for version comparison within C/C++ code.
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION 0x01020100
|
#define PRODUCT_VERSION 0x01020400
|
||||||
|
|
||||||
//
|
//
|
||||||
// Product version by components
|
// Product version by components
|
||||||
@@ -39,26 +39,26 @@
|
|||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_MAJ 1
|
#define PRODUCT_VERSION_MAJ 1
|
||||||
#define PRODUCT_VERSION_MIN 2
|
#define PRODUCT_VERSION_MIN 2
|
||||||
#define PRODUCT_VERSION_REV 1
|
#define PRODUCT_VERSION_REV 4
|
||||||
#define PRODUCT_VERSION_BUILD 0
|
#define PRODUCT_VERSION_BUILD 0
|
||||||
|
|
||||||
//
|
//
|
||||||
// Human readable product version and build year for UI
|
// Human readable product version and build year for UI
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_STR "1.2-beta"
|
#define PRODUCT_VERSION_STR "1.2"
|
||||||
#define PRODUCT_BUILD_YEAR_STR "2016"
|
#define PRODUCT_BUILD_YEAR_STR "2017"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Numerical version presentation for ProductVersion propery in
|
// Numerical version presentation for ProductVersion propery in
|
||||||
// MSI packages (syntax: N.N[.N[.N]])
|
// MSI packages (syntax: N.N[.N[.N]])
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_INST "1.2.1"
|
#define PRODUCT_VERSION_INST "1.2.4"
|
||||||
|
|
||||||
//
|
//
|
||||||
// The product code for ProductCode property in MSI packages
|
// The product code for ProductCode property in MSI packages
|
||||||
// Replace with new on every version change, regardless how minor it is.
|
// Replace with new on every version change, regardless how minor it is.
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_GUID "{FDBF521E-65C3-4715-823F-CF7CE63E0470}"
|
#define PRODUCT_VERSION_GUID "{3490271F-380F-4618-83F9-114A340E2C00}"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Product vendor
|
// Product vendor
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2016 Amebis
|
Copyright 2016 Amebis
|
||||||
Copyright 2016 GÉANT
|
Copyright 2016 GÉANT
|
||||||
|
|
||||||
This file is part of GÉANTLink.
|
This file is part of GÉANTLink.
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2016 Amebis
|
Copyright 2016 Amebis
|
||||||
Copyright 2016 GÉANT
|
Copyright 2016 GÉANT
|
||||||
|
|
||||||
This file is part of GÉANTLink.
|
This file is part of GÉANTLink.
|
||||||
|
|
||||||
|
@@ -31,36 +31,6 @@ namespace eap
|
|||||||
class config_connection;
|
class config_connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \addtogroup EAPBaseStream
|
|
||||||
/// @{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Packs a configuration
|
|
||||||
///
|
|
||||||
/// \param[inout] cursor Memory cursor
|
|
||||||
/// \param[in] val Configuration to pack
|
|
||||||
///
|
|
||||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config &val);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns packed size of a configuration
|
|
||||||
///
|
|
||||||
/// \param[in] val Configuration to pack
|
|
||||||
///
|
|
||||||
/// \returns Size of data when packed (in bytes)
|
|
||||||
///
|
|
||||||
inline size_t pksizeof(_In_ const eap::config &val);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Unpacks a configuration
|
|
||||||
///
|
|
||||||
/// \param[inout] cursor Memory cursor
|
|
||||||
/// \param[out] val Configuration to unpack to
|
|
||||||
///
|
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val);
|
|
||||||
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
@@ -89,9 +59,9 @@ namespace eap
|
|||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Base class for configuration storage
|
/// Base class for packable and XML-exportable storage
|
||||||
///
|
///
|
||||||
class config
|
class config : public packable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
@@ -160,32 +130,6 @@ namespace eap
|
|||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// \name BLOB management
|
|
||||||
/// @{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Packs this object
|
|
||||||
///
|
|
||||||
/// \param[inout] cursor Memory cursor
|
|
||||||
///
|
|
||||||
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns packed size of this object
|
|
||||||
///
|
|
||||||
/// \returns Size of data when packed (in bytes)
|
|
||||||
///
|
|
||||||
virtual size_t get_pk_size() const;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Unpacks this object
|
|
||||||
///
|
|
||||||
/// \param[inout] cursor Memory cursor
|
|
||||||
///
|
|
||||||
virtual void operator>>(_Inout_ cursor_in &cursor);
|
|
||||||
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
module &m_module; ///< EAP module
|
module &m_module; ///< EAP module
|
||||||
|
|
||||||
@@ -530,24 +474,6 @@ namespace eap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config &val)
|
|
||||||
{
|
|
||||||
val.operator<<(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline size_t pksizeof(_In_ const eap::config &val)
|
|
||||||
{
|
|
||||||
return val.get_pk_size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val)
|
|
||||||
{
|
|
||||||
val.operator>>(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// \addtogroup EAPBaseStream
|
/// \addtogroup EAPBaseStream
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
@@ -584,6 +510,7 @@ inline size_t pksizeof(_In_ const eap::config_method::status_t &val)
|
|||||||
///
|
///
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config_method::status_t &val)
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config_method::status_t &val)
|
||||||
{
|
{
|
||||||
|
val = (eap::config_method::status_t)0; // Reset higher bytes to zero before reading to lower byte.
|
||||||
cursor >> (unsigned char&)val;
|
cursor >> (unsigned char&)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -571,6 +571,7 @@ inline size_t pksizeof(_In_ const eap::credentials_pass::enc_alg_t &val)
|
|||||||
///
|
///
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::credentials_pass::enc_alg_t &val)
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::credentials_pass::enc_alg_t &val)
|
||||||
{
|
{
|
||||||
|
val = (eap::credentials_pass::enc_alg_t)0; // Reset higher bytes to zero before reading to lower byte.
|
||||||
cursor >> (unsigned char&)val;
|
cursor >> (unsigned char&)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,6 +80,8 @@ namespace eap
|
|||||||
struct cursor_out;
|
struct cursor_out;
|
||||||
struct cursor_in;
|
struct cursor_in;
|
||||||
|
|
||||||
|
class packable;
|
||||||
|
|
||||||
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_f;
|
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_f;
|
||||||
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_zf;
|
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_zf;
|
||||||
|
|
||||||
@@ -499,6 +501,31 @@ inline size_t pksizeof(_In_ const EAP_METHOD_TYPE &val);
|
|||||||
///
|
///
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ EAP_METHOD_TYPE &val);
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ EAP_METHOD_TYPE &val);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Packs a packable object
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
/// \param[in] val Object to pack
|
||||||
|
///
|
||||||
|
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::packable &val);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Returns packed size of a packable object
|
||||||
|
///
|
||||||
|
/// \param[in] val Object to pack
|
||||||
|
///
|
||||||
|
/// \returns Size of data when packed (in bytes)
|
||||||
|
///
|
||||||
|
inline size_t pksizeof(_In_ const eap::packable &val);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Unpacks a packable object
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
/// \param[out] val Object to unpack to
|
||||||
|
///
|
||||||
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::packable &val);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -574,6 +601,45 @@ namespace eap
|
|||||||
ptr_type ptr_end; ///< Pointer to the end of BLOB
|
ptr_type ptr_end; ///< Pointer to the end of BLOB
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Base class for all packable data classes
|
||||||
|
///
|
||||||
|
class packable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
/// Constructs configuration
|
||||||
|
///
|
||||||
|
packable();
|
||||||
|
|
||||||
|
/// \name BLOB management
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Packs this object
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
///
|
||||||
|
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Returns packed size of this object
|
||||||
|
///
|
||||||
|
/// \returns Size of data when packed (in bytes)
|
||||||
|
///
|
||||||
|
virtual size_t get_pk_size() const;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Unpacks this object
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
///
|
||||||
|
virtual void operator>>(_Inout_ cursor_in &cursor);
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// \addtogroup EAPBaseSanitizing
|
/// \addtogroup EAPBaseSanitizing
|
||||||
@@ -1087,9 +1153,11 @@ inline size_t pksizeof(_In_ const winstd::cert_context &val)
|
|||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_context &val)
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_context &val)
|
||||||
{
|
{
|
||||||
DWORD dwCertEncodingType;
|
DWORD dwCertEncodingType;
|
||||||
|
assert(sizeof(dwCertEncodingType) == sizeof(unsigned int));
|
||||||
cursor >> (unsigned int&)dwCertEncodingType;
|
cursor >> (unsigned int&)dwCertEncodingType;
|
||||||
|
|
||||||
DWORD dwCertEncodedSize;
|
DWORD dwCertEncodedSize;
|
||||||
|
assert(sizeof(dwCertEncodingType) == sizeof(unsigned int));
|
||||||
cursor >> (unsigned int&)dwCertEncodedSize;
|
cursor >> (unsigned int&)dwCertEncodedSize;
|
||||||
|
|
||||||
if (dwCertEncodedSize) {
|
if (dwCertEncodedSize) {
|
||||||
@@ -1116,6 +1184,7 @@ inline size_t pksizeof(_In_ const winstd::eap_type_t &val)
|
|||||||
|
|
||||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::eap_type_t &val)
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::eap_type_t &val)
|
||||||
{
|
{
|
||||||
|
val = (winstd::eap_type_t)0; // Reset higher bytes to zero before reading to lower byte.
|
||||||
cursor >> (unsigned char&)val;
|
cursor >> (unsigned char&)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1198,6 +1267,24 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ EAP_METHOD_TYPE &va
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::packable &val)
|
||||||
|
{
|
||||||
|
val.operator<<(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline size_t pksizeof(_In_ const eap::packable &val)
|
||||||
|
{
|
||||||
|
return val.get_pk_size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::packable &val)
|
||||||
|
{
|
||||||
|
val.operator>>(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef htonll
|
#ifndef htonll
|
||||||
|
|
||||||
inline unsigned __int64 htonll(unsigned __int64 val)
|
inline unsigned __int64 htonll(unsigned __int64 val)
|
||||||
|
@@ -43,17 +43,16 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// UI context
|
/// UI context
|
||||||
///
|
///
|
||||||
class ui_context : public config
|
class ui_context : public packable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
/// Constructs context
|
/// Constructs context
|
||||||
///
|
///
|
||||||
/// \param[in] mod EAP module to use for global services
|
|
||||||
/// \param[in] cfg Connection configuration
|
/// \param[in] cfg Connection configuration
|
||||||
/// \param[in] cred Connection credentials
|
/// \param[in] cred Connection credentials
|
||||||
///
|
///
|
||||||
ui_context(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred);
|
ui_context(_In_ config_connection &cfg, _In_ credentials_connection &cred);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies context
|
/// Copies context
|
||||||
|
@@ -77,24 +77,6 @@ void eap::config::load(_In_ IXMLDOMNode *pConfigRoot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void eap::config::operator<<(_Inout_ cursor_out &cursor) const
|
|
||||||
{
|
|
||||||
UNREFERENCED_PARAMETER(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
size_t eap::config::get_pk_size() const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void eap::config::operator>>(_Inout_ cursor_in &cursor)
|
|
||||||
{
|
|
||||||
UNREFERENCED_PARAMETER(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const bstr eap::config::namespace_eapmetadata(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
const bstr eap::config::namespace_eapmetadata(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||||
|
|
||||||
|
|
||||||
|
@@ -20,10 +20,39 @@
|
|||||||
|
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
|
||||||
|
#pragma comment(lib, "Ws2_32.lib")
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace winstd;
|
using namespace winstd;
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// eap::packable
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
eap::packable::packable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::packable::operator<<(_Inout_ cursor_out &cursor) const
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t eap::packable::get_pk_size() const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::packable::operator>>(_Inout_ cursor_in &cursor)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// eap::diameter_avp_append
|
// eap::diameter_avp_append
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -28,8 +28,7 @@ using namespace winstd;
|
|||||||
// eap::ui_context
|
// eap::ui_context
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::ui_context::ui_context(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred) :
|
eap::ui_context::ui_context(_In_ config_connection &cfg, _In_ credentials_connection &cred) :
|
||||||
config(mod),
|
|
||||||
m_cfg(cfg),
|
m_cfg(cfg),
|
||||||
m_cred(cred)
|
m_cred(cred)
|
||||||
{
|
{
|
||||||
@@ -37,17 +36,17 @@ eap::ui_context::ui_context(_In_ module &mod, _In_ config_connection &cfg, _In_
|
|||||||
|
|
||||||
|
|
||||||
eap::ui_context::ui_context(_In_ const ui_context &other) :
|
eap::ui_context::ui_context(_In_ const ui_context &other) :
|
||||||
m_cfg (other.m_cfg ),
|
m_cfg (other.m_cfg ),
|
||||||
m_cred(other.m_cred),
|
m_cred (other.m_cred),
|
||||||
config(other )
|
packable(other )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eap::ui_context::ui_context(_Inout_ ui_context &&other) :
|
eap::ui_context::ui_context(_Inout_ ui_context &&other) :
|
||||||
m_cfg ( other.m_cfg ),
|
m_cfg ( other.m_cfg ),
|
||||||
m_cred( other.m_cred ),
|
m_cred ( other.m_cred ),
|
||||||
config(std::move(other ))
|
packable(std::move(other ))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ eap::ui_context& eap::ui_context::operator=(_In_ const ui_context &other)
|
|||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Copy context within same configuration only!
|
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Copy context within same configuration only!
|
||||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Copy context within same credentials only!
|
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Copy context within same credentials only!
|
||||||
(config&)*this = other;
|
(packable&)*this = other;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -69,7 +68,7 @@ eap::ui_context& eap::ui_context::operator=(_Inout_ ui_context &&other)
|
|||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move context within same configuration only!
|
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move context within same configuration only!
|
||||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move context within same credentials only!
|
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move context within same credentials only!
|
||||||
(config&)*this = std::move(other);
|
(packable&)*this = std::move(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -78,7 +77,7 @@ eap::ui_context& eap::ui_context::operator=(_Inout_ ui_context &&other)
|
|||||||
|
|
||||||
void eap::ui_context::operator<<(_Inout_ cursor_out &cursor) const
|
void eap::ui_context::operator<<(_Inout_ cursor_out &cursor) const
|
||||||
{
|
{
|
||||||
config::operator<<(cursor);
|
packable::operator<<(cursor);
|
||||||
cursor << m_cfg ;
|
cursor << m_cfg ;
|
||||||
cursor << m_cred;
|
cursor << m_cred;
|
||||||
}
|
}
|
||||||
@@ -87,7 +86,7 @@ void eap::ui_context::operator<<(_Inout_ cursor_out &cursor) const
|
|||||||
size_t eap::ui_context::get_pk_size() const
|
size_t eap::ui_context::get_pk_size() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
config::get_pk_size() +
|
packable::get_pk_size() +
|
||||||
pksizeof(m_cfg ) +
|
pksizeof(m_cfg ) +
|
||||||
pksizeof(m_cred);
|
pksizeof(m_cred);
|
||||||
}
|
}
|
||||||
@@ -95,7 +94,7 @@ size_t eap::ui_context::get_pk_size() const
|
|||||||
|
|
||||||
void eap::ui_context::operator>>(_Inout_ cursor_in &cursor)
|
void eap::ui_context::operator>>(_Inout_ cursor_in &cursor)
|
||||||
{
|
{
|
||||||
config::operator>>(cursor);
|
packable::operator>>(cursor);
|
||||||
cursor >> m_cfg ;
|
cursor >> m_cfg ;
|
||||||
cursor >> m_cred;
|
cursor >> m_cred;
|
||||||
}
|
}
|
||||||
|
@@ -360,6 +360,14 @@ public:
|
|||||||
///
|
///
|
||||||
/// Constructs a credential dialog
|
/// 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);
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -44,6 +44,15 @@ namespace eap
|
|||||||
///
|
///
|
||||||
class config_method_eapgtc : public config_method_with_cred
|
class config_method_eapgtc : public config_method_with_cred
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
/// Authentication mode
|
||||||
|
///
|
||||||
|
enum auth_mode_t {
|
||||||
|
auth_mode_response = 0, ///< Challenge/Response
|
||||||
|
auth_mode_password, ///< Password
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
@@ -87,6 +96,19 @@ namespace eap
|
|||||||
|
|
||||||
virtual config* clone() const;
|
virtual config* clone() const;
|
||||||
|
|
||||||
|
/// \name XML management
|
||||||
|
/// @{
|
||||||
|
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
|
||||||
|
virtual void load(_In_ IXMLDOMNode *pConfigRoot);
|
||||||
|
/// @}
|
||||||
|
|
||||||
|
/// \name BLOB management
|
||||||
|
/// @{
|
||||||
|
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
||||||
|
virtual size_t get_pk_size() const;
|
||||||
|
virtual void operator>>(_Inout_ cursor_in &cursor);
|
||||||
|
/// @}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// @copydoc eap::config_method::get_method_id()
|
/// @copydoc eap::config_method::get_method_id()
|
||||||
/// \returns This implementation always returns `winstd::eap_type_gtc`
|
/// \returns This implementation always returns `winstd::eap_type_gtc`
|
||||||
@@ -101,10 +123,53 @@ namespace eap
|
|||||||
|
|
||||||
///
|
///
|
||||||
/// @copydoc eap::config_method::make_credentials()
|
/// @copydoc eap::config_method::make_credentials()
|
||||||
/// \returns This implementation always returns `eap::credentials_identity` type of credentials
|
/// \returns This implementation returns `eap::credentials_identity` or `eap::credentials_pass` type of credentials, depending on authentication mode.
|
||||||
///
|
///
|
||||||
virtual credentials* make_credentials() const;
|
virtual credentials* make_credentials() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// \addtogroup EAPBaseStream
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Packs an EAP-GTC method authentication mode
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
/// \param[in] val Authentication mode to pack
|
||||||
|
///
|
||||||
|
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config_method_eapgtc::auth_mode_t &val)
|
||||||
|
{
|
||||||
|
cursor << (unsigned char)val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Returns packed size of an EAP-GTC method authentication mode
|
||||||
|
///
|
||||||
|
/// \param[in] val Authentication mode to pack
|
||||||
|
///
|
||||||
|
/// \returns Size of data when packed (in bytes)
|
||||||
|
///
|
||||||
|
inline size_t pksizeof(_In_ const eap::config_method_eapgtc::auth_mode_t &val)
|
||||||
|
{
|
||||||
|
return pksizeof((unsigned char)val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Unpacks an EAP-GTC method authentication mode
|
||||||
|
///
|
||||||
|
/// \param[inout] cursor Memory cursor
|
||||||
|
/// \param[out] val Authentication mode to unpack to
|
||||||
|
///
|
||||||
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config_method_eapgtc::auth_mode_t &val)
|
||||||
|
{
|
||||||
|
val = (eap::config_method_eapgtc::auth_mode_t)0; // Reset higher bytes to zero before reading to lower byte.
|
||||||
|
cursor >> (unsigned char&)val;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
@@ -50,7 +50,7 @@ namespace eap
|
|||||||
/// \param[in] cfg Method configuration
|
/// \param[in] cfg Method configuration
|
||||||
/// \param[in] cred User credentials
|
/// \param[in] cred User credentials
|
||||||
///
|
///
|
||||||
method_gtc(_In_ module &mod, _In_ config_method_eapgtc &cfg, _In_ credentials_identity &cred);
|
method_gtc(_In_ module &mod, _In_ config_method_eapgtc &cfg, _In_ credentials &cred);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Moves a GTC method
|
/// Moves a GTC method
|
||||||
@@ -109,7 +109,7 @@ namespace eap
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
config_method_eapgtc &m_cfg; ///< Method configuration
|
config_method_eapgtc &m_cfg; ///< Method configuration
|
||||||
credentials_identity &m_cred; ///< Method user credentials
|
credentials &m_cred; ///< Method user credentials
|
||||||
winstd::sanitizing_wstring m_challenge; ///< GTC challenge
|
winstd::sanitizing_wstring m_challenge; ///< GTC challenge
|
||||||
winstd::sanitizing_wstring m_response; ///< GTC response
|
winstd::sanitizing_wstring m_response; ///< GTC response
|
||||||
};
|
};
|
||||||
|
@@ -30,6 +30,7 @@ using namespace winstd;
|
|||||||
|
|
||||||
eap::config_method_eapgtc::config_method_eapgtc(_In_ module &mod, _In_ unsigned int level) : config_method_with_cred(mod, level)
|
eap::config_method_eapgtc::config_method_eapgtc(_In_ module &mod, _In_ unsigned int level) : config_method_with_cred(mod, level)
|
||||||
{
|
{
|
||||||
|
// Default to Challenge/Response authentication mode.
|
||||||
m_cred.reset(new credentials_identity(mod));
|
m_cred.reset(new credentials_identity(mod));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,6 +71,95 @@ eap::config* eap::config_method_eapgtc::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::config_method_eapgtc::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
|
||||||
|
{
|
||||||
|
assert(pDoc);
|
||||||
|
assert(pConfigRoot);
|
||||||
|
|
||||||
|
config_method_with_cred::save(pDoc, pConfigRoot);
|
||||||
|
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (dynamic_cast<credentials_identity*>(m_cred.get()))
|
||||||
|
hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"AuthMode"), namespace_eapmetadata, bstr(L"Challenge/Response"));
|
||||||
|
else if (dynamic_cast<credentials_pass*>(m_cred.get()))
|
||||||
|
hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"AuthMode"), namespace_eapmetadata, bstr(L"Password"));
|
||||||
|
else
|
||||||
|
throw invalid_argument(__FUNCTION__ " Unsupported authentication mode.");
|
||||||
|
if (FAILED(hr))
|
||||||
|
throw com_runtime_error(hr, __FUNCTION__ " Error creating <AuthMode> element.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::config_method_eapgtc::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||||
|
{
|
||||||
|
assert(pConfigRoot);
|
||||||
|
HRESULT hr;
|
||||||
|
wstring xpath(eapxml::get_xpath(pConfigRoot));
|
||||||
|
|
||||||
|
// Load authentication mode first, then (re)create credentials to match the authentication mode.
|
||||||
|
bstr auth_mode;
|
||||||
|
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:AuthMode"), auth_mode)) ||
|
||||||
|
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, auth_mode, auth_mode.length(), _L("Challenge/Response"), -1, NULL, NULL, 0) == CSTR_EQUAL)
|
||||||
|
{
|
||||||
|
m_cred.reset(new eap::credentials_identity(m_module));
|
||||||
|
} else if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, auth_mode, auth_mode.length(), _L("Password"), -1, NULL, NULL, 0) == CSTR_EQUAL) {
|
||||||
|
m_cred.reset(new eap::credentials_pass(m_module));
|
||||||
|
} 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::config_method_eapgtc::operator<<(_Inout_ cursor_out &cursor) const
|
||||||
|
{
|
||||||
|
// Save authentication mode first, as credential loading will require this information.
|
||||||
|
if (dynamic_cast<credentials_identity*>(m_cred.get()))
|
||||||
|
cursor << auth_mode_response;
|
||||||
|
else if (dynamic_cast<credentials_pass*>(m_cred.get()))
|
||||||
|
cursor << auth_mode_password;
|
||||||
|
else
|
||||||
|
throw invalid_argument(__FUNCTION__ " Unsupported authentication mode.");
|
||||||
|
|
||||||
|
config_method_with_cred::operator<<(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t eap::config_method_eapgtc::get_pk_size() const
|
||||||
|
{
|
||||||
|
auth_mode_t auth_mode;
|
||||||
|
if (dynamic_cast<credentials_identity*>(m_cred.get()))
|
||||||
|
auth_mode = auth_mode_response;
|
||||||
|
else if (dynamic_cast<credentials_pass*>(m_cred.get()))
|
||||||
|
auth_mode = auth_mode_password;
|
||||||
|
else
|
||||||
|
throw invalid_argument(__FUNCTION__ " Unsupported authentication mode.");
|
||||||
|
|
||||||
|
return
|
||||||
|
pksizeof(auth_mode) +
|
||||||
|
config_method_with_cred::get_pk_size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void eap::config_method_eapgtc::operator>>(_Inout_ cursor_in &cursor)
|
||||||
|
{
|
||||||
|
// (Re)create credentials to match the authentication mode.
|
||||||
|
auth_mode_t auth_mode;
|
||||||
|
cursor >> auth_mode;
|
||||||
|
switch (auth_mode) {
|
||||||
|
case auth_mode_response: m_cred.reset(new eap::credentials_identity(m_module)); break;
|
||||||
|
case auth_mode_password: m_cred.reset(new eap::credentials_pass (m_module)); break;
|
||||||
|
default : throw invalid_argument(string_printf(__FUNCTION__ " Unsupported authentication mode (%u).", auth_mode));
|
||||||
|
}
|
||||||
|
|
||||||
|
config_method_with_cred::operator>>(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
eap_type_t eap::config_method_eapgtc::get_method_id() const
|
eap_type_t eap::config_method_eapgtc::get_method_id() const
|
||||||
{
|
{
|
||||||
return eap_type_gtc;
|
return eap_type_gtc;
|
||||||
@@ -84,5 +174,10 @@ const wchar_t* eap::config_method_eapgtc::get_method_str() const
|
|||||||
|
|
||||||
eap::credentials* eap::config_method_eapgtc::make_credentials() const
|
eap::credentials* eap::config_method_eapgtc::make_credentials() const
|
||||||
{
|
{
|
||||||
return new eap::credentials_identity(m_module);
|
if (dynamic_cast<credentials_identity*>(m_cred.get()))
|
||||||
|
return new eap::credentials_identity(m_module);
|
||||||
|
else if (dynamic_cast<credentials_pass*>(m_cred.get()))
|
||||||
|
return new eap::credentials_pass (m_module);
|
||||||
|
else
|
||||||
|
throw invalid_argument(__FUNCTION__ " Unsupported authentication mode.");
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::method_gtc
|
// eap::method_gtc
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::method_gtc::method_gtc(_In_ module &mod, _In_ config_method_eapgtc &cfg, _In_ credentials_identity &cred) :
|
eap::method_gtc::method_gtc(_In_ module &mod, _In_ config_method_eapgtc &cfg, _In_ credentials &cred) :
|
||||||
m_cfg(cfg),
|
m_cfg(cfg),
|
||||||
m_cred(cred),
|
m_cred(cred),
|
||||||
method(mod)
|
method(mod)
|
||||||
@@ -83,13 +83,24 @@ EapPeerMethodResponseAction eap::method_gtc::process_request_packet(
|
|||||||
|
|
||||||
m_module.log_event(&EAPMETHOD_METHOD_HANDSHAKE_START2, event_data((unsigned int)eap_type_gtc), event_data::blank);
|
m_module.log_event(&EAPMETHOD_METHOD_HANDSHAKE_START2, event_data((unsigned int)eap_type_gtc), event_data::blank);
|
||||||
|
|
||||||
// Read authenticator challenge as UTF-8 encoded string.
|
credentials_pass *cred_pass;
|
||||||
MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pReceivedPacket, dwReceivedPacketSize, m_challenge);
|
if (dynamic_cast<credentials_identity*>(&m_cred)) {
|
||||||
|
// Read authenticator challenge as UTF-8 encoded string.
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pReceivedPacket, dwReceivedPacketSize, m_challenge);
|
||||||
|
|
||||||
m_module.log_event(&EAPMETHOD_GTC_RESPONSE_REQ, event_data((unsigned int)eap_type_gtc), event_data::blank);
|
m_module.log_event(&EAPMETHOD_GTC_RESPONSE_REQ, event_data((unsigned int)eap_type_gtc), event_data::blank);
|
||||||
|
|
||||||
// User must respond to the challenge.
|
// User must respond to the challenge.
|
||||||
return EapPeerMethodResponseActionInvokeUI;
|
return EapPeerMethodResponseActionInvokeUI;
|
||||||
|
} else if ((cred_pass = dynamic_cast<credentials_pass*>(&m_cred)) != NULL) {
|
||||||
|
// Ignore authenticator challenge and save password as GTC response.
|
||||||
|
m_response = cred_pass->m_password;
|
||||||
|
|
||||||
|
// Send the response.
|
||||||
|
m_cfg.m_last_status = config_method::status_cred_invalid; // Blame "credentials" if we fail beyond this point.
|
||||||
|
return EapPeerMethodResponseActionSend;
|
||||||
|
} else
|
||||||
|
throw invalid_argument(__FUNCTION__ " Unsupported authentication mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,13 +109,13 @@ void eap::method_gtc::get_response_packet(
|
|||||||
_In_opt_ DWORD size_max)
|
_In_opt_ DWORD size_max)
|
||||||
{
|
{
|
||||||
// Encode GTC response as UTF-8.
|
// Encode GTC response as UTF-8.
|
||||||
sanitizing_string reply_utf8;
|
sanitizing_string response_utf8;
|
||||||
WideCharToMultiByte(CP_UTF8, 0, m_response, reply_utf8, NULL, NULL);
|
WideCharToMultiByte(CP_UTF8, 0, m_response, response_utf8, NULL, NULL);
|
||||||
|
|
||||||
if (sizeof(sanitizing_string::value_type)*reply_utf8.length() > size_max)
|
if (sizeof(sanitizing_string::value_type)*response_utf8.length() > size_max)
|
||||||
throw invalid_argument(string_printf(__FUNCTION__ " This method does not support packet fragmentation, but the data size is too big to fit in one packet (packet: %u, maximum: %u).", sizeof(sanitizing_string::value_type)*reply_utf8.length(), size_max));
|
throw invalid_argument(string_printf(__FUNCTION__ " This method does not support packet fragmentation, but the data size is too big to fit in one packet (packet: %u, maximum: %u).", sizeof(sanitizing_string::value_type)*response_utf8.length(), size_max));
|
||||||
|
|
||||||
packet.assign(reply_utf8.begin(), reply_utf8.end());
|
packet.assign(response_utf8.begin(), response_utf8.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -29,14 +29,24 @@ class wxGTCResponsePanel;
|
|||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// GTC credential entry panel
|
/// GTC challenge/response credential entry panel
|
||||||
///
|
///
|
||||||
typedef wxIdentityCredentialsPanel<eap::credentials_identity, wxIdentityCredentialsPanelBase> wxGTCCredentialsPanel;
|
typedef wxIdentityCredentialsPanel<eap::credentials_identity, wxIdentityCredentialsPanelBase> wxGTCResponseCredentialsPanel;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// GTC credential configuration panel
|
/// GTC challenge/response credential configuration panel
|
||||||
///
|
///
|
||||||
typedef wxEAPCredentialsConfigPanel<eap::credentials_identity, wxGTCCredentialsPanel> wxGTCCredentialsConfigPanel;
|
typedef wxEAPCredentialsConfigPanel<eap::credentials_identity, wxGTCResponseCredentialsPanel> wxGTCResponseCredentialsConfigPanel;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GTC password credential entry panel
|
||||||
|
///
|
||||||
|
typedef wxPasswordCredentialsPanel<eap::credentials_pass, wxPasswordCredentialsPanelBase> wxGTCPasswordCredentialsPanel;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GTC password credential configuration panel
|
||||||
|
///
|
||||||
|
typedef wxEAPCredentialsConfigPanel<eap::credentials_pass, wxGTCPasswordCredentialsPanel> wxGTCPasswordCredentialsConfigPanel;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
@@ -44,11 +54,6 @@ typedef wxEAPCredentialsConfigPanel<eap::credentials_identity, wxGTCCredentialsP
|
|||||||
|
|
||||||
#include "../res/wxGTC_UI.h"
|
#include "../res/wxGTC_UI.h"
|
||||||
|
|
||||||
#include <wx/panel.h>
|
|
||||||
#include <wx/stattext.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +63,7 @@ typedef wxEAPCredentialsConfigPanel<eap::credentials_identity, wxGTCCredentialsP
|
|||||||
///
|
///
|
||||||
/// GTC configuration panel
|
/// GTC configuration panel
|
||||||
///
|
///
|
||||||
class wxGTCConfigPanel : public wxPanel
|
class wxGTCConfigPanel : public wxGTCConfigPanelBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
@@ -66,18 +71,23 @@ public:
|
|||||||
///
|
///
|
||||||
wxGTCConfigPanel(const eap::config_provider &prov, eap::config_method_eapgtc &cfg, wxWindow* parent);
|
wxGTCConfigPanel(const eap::config_provider &prov, eap::config_method_eapgtc &cfg, wxWindow* parent);
|
||||||
|
|
||||||
///
|
|
||||||
/// Destructs the configuration panel
|
|
||||||
///
|
|
||||||
virtual ~wxGTCConfigPanel();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// \cond internal
|
/// \cond internal
|
||||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
virtual bool TransferDataToWindow();
|
||||||
|
virtual bool TransferDataFromWindow();
|
||||||
|
virtual void OnUpdateUI(wxUpdateUIEvent& event);
|
||||||
/// \endcond
|
/// \endcond
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxGTCCredentialsConfigPanel *m_credentials; ///< Credentials configuration panel
|
const eap::config_provider &m_prov; ///< EAP provider
|
||||||
|
eap::config_method_eapgtc &m_cfg; ///< EAP-GTC configuration
|
||||||
|
|
||||||
|
wxGTCResponseCredentialsConfigPanel *m_credentials_resp; ///< Challenge/response credentials configuration panel
|
||||||
|
wxGTCPasswordCredentialsConfigPanel *m_credentials_pass; ///< Password credentials configuration panel
|
||||||
|
|
||||||
|
// Temporary configurations to hold data until applied
|
||||||
|
eap::config_method_eapgtc m_cfg_resp; ///< Method configuration for challenge/response mode
|
||||||
|
eap::config_method_eapgtc m_cfg_pass; ///< Method configuration for password mode
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -90,6 +100,14 @@ public:
|
|||||||
///
|
///
|
||||||
/// Constructs a credential dialog
|
/// 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);
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -61,3 +61,32 @@ wxGTCResponsePanelBase::wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id,
|
|||||||
wxGTCResponsePanelBase::~wxGTCResponsePanelBase()
|
wxGTCResponsePanelBase::~wxGTCResponsePanelBase()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxGTCConfigPanelBase::wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||||
|
{
|
||||||
|
wxBoxSizer* sb_vertical;
|
||||||
|
sb_vertical = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_auth_mode_label = new wxStaticText( this, wxID_ANY, _("EAP-GTC authentication &mode:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_auth_mode_label->Wrap( -1 );
|
||||||
|
sb_vertical->Add( m_auth_mode_label, 0, wxBOTTOM, 5 );
|
||||||
|
|
||||||
|
m_auth_mode = new wxChoicebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT );
|
||||||
|
m_auth_mode->SetToolTip( _("Select EAP-GTC authentication mode from the list") );
|
||||||
|
|
||||||
|
sb_vertical->Add( m_auth_mode, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
this->SetSizer( sb_vertical );
|
||||||
|
this->Layout();
|
||||||
|
|
||||||
|
// Connect Events
|
||||||
|
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxGTCConfigPanelBase::OnUpdateUI ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGTCConfigPanelBase::~wxGTCConfigPanelBase()
|
||||||
|
{
|
||||||
|
// Disconnect Events
|
||||||
|
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxGTCConfigPanelBase::OnUpdateUI ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -466,5 +466,230 @@
|
|||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="Panel" expanded="1">
|
||||||
|
<property name="aui_managed">0</property>
|
||||||
|
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="event_handler">impl_virtual</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">wxGTCConfigPanelBase</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="size">500,-1</property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
<event name="OnAuiFindManager"></event>
|
||||||
|
<event name="OnAuiPaneButton"></event>
|
||||||
|
<event name="OnAuiPaneClose"></event>
|
||||||
|
<event name="OnAuiPaneMaximize"></event>
|
||||||
|
<event name="OnAuiPaneRestore"></event>
|
||||||
|
<event name="OnAuiRender"></event>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnInitDialog"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI">OnUpdateUI</event>
|
||||||
|
<object class="wxBoxSizer" expanded="1">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">sb_vertical</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxBOTTOM</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">EAP-GTC authentication &mode:</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_auth_mode_label</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">1</property>
|
||||||
|
<object class="wxChoicebook" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_auth_mode</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style">wxCHB_DEFAULT</property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip">Select EAP-GTC authentication mode from the list</property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnChoicebookPageChanged"></event>
|
||||||
|
<event name="OnChoicebookPageChanging"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</wxFormBuilder_Project>
|
</wxFormBuilder_Project>
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/statbox.h>
|
#include <wx/statbox.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
#include <wx/choicebk.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -50,4 +51,26 @@ class wxGTCResponsePanelBase : public wxPanel
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// Class wxGTCConfigPanelBase
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class wxGTCConfigPanelBase : public wxPanel
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxStaticText* m_auth_mode_label;
|
||||||
|
wxChoicebook* m_auth_mode;
|
||||||
|
|
||||||
|
// Virtual event handlers, overide them in your derived class
|
||||||
|
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL );
|
||||||
|
~wxGTCConfigPanelBase();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif //__WXGTC_UI_H__
|
#endif //__WXGTC_UI_H__
|
||||||
|
@@ -25,36 +25,86 @@
|
|||||||
// wxGTCConfigPanel
|
// wxGTCConfigPanel
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxGTCConfigPanel::wxGTCConfigPanel(const eap::config_provider &prov, eap::config_method_eapgtc &cfg, wxWindow* parent) : wxPanel(parent)
|
wxGTCConfigPanel::wxGTCConfigPanel(const eap::config_provider &prov, eap::config_method_eapgtc &cfg, wxWindow* parent) :
|
||||||
|
m_prov (prov ),
|
||||||
|
m_cfg (cfg ),
|
||||||
|
m_cfg_resp(cfg.m_module, cfg.m_level),
|
||||||
|
m_cfg_pass(cfg.m_module, cfg.m_level),
|
||||||
|
wxGTCConfigPanelBase(parent)
|
||||||
{
|
{
|
||||||
wxBoxSizer* sb_content;
|
// Initialize Password authentication mode properly. Challenge/Response mode does not require initialization, since it is initialized so by default.
|
||||||
sb_content = new wxBoxSizer( wxVERTICAL );
|
m_cfg_pass.m_cred.reset(new eap::credentials_pass(m_cfg.m_module));
|
||||||
|
|
||||||
m_credentials = new wxGTCCredentialsConfigPanel(prov, cfg, this, _("GTC User ID"));
|
m_credentials_resp = new wxGTCResponseCredentialsConfigPanel(m_prov, m_cfg_resp, m_auth_mode);
|
||||||
sb_content->Add(m_credentials, 0, wxEXPAND, 5);
|
m_auth_mode->AddPage(m_credentials_resp, _("Challenge/Response"));
|
||||||
|
m_credentials_pass = new wxGTCPasswordCredentialsConfigPanel(m_prov, m_cfg_pass, m_auth_mode);
|
||||||
this->SetSizer(sb_content);
|
m_auth_mode->AddPage(m_credentials_pass, _("Password"));
|
||||||
this->Layout();
|
|
||||||
|
|
||||||
// Connect Events
|
|
||||||
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxGTCConfigPanel::OnInitDialog));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
wxGTCConfigPanel::~wxGTCConfigPanel()
|
|
||||||
{
|
|
||||||
// Disconnect Events
|
|
||||||
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxGTCConfigPanel::OnInitDialog));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// \cond internal
|
/// \cond internal
|
||||||
void wxGTCConfigPanel::OnInitDialog(wxInitDialogEvent& event)
|
|
||||||
|
bool wxGTCConfigPanel::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
// Forward the event to child panels.
|
eap::credentials_identity *cred_resp;
|
||||||
if (m_credentials)
|
eap::credentials_pass *cred_pass;
|
||||||
m_credentials->GetEventHandler()->ProcessEvent(event);
|
|
||||||
|
if ((cred_resp = dynamic_cast<eap::credentials_identity*>(m_cfg.m_cred.get())) != NULL) {
|
||||||
|
m_cfg_resp = m_cfg;
|
||||||
|
m_auth_mode->SetSelection(0); // 0=Challenge/Response
|
||||||
|
} else if ((cred_pass = dynamic_cast<eap::credentials_pass*>(m_cfg.m_cred.get())) != NULL) {
|
||||||
|
m_cfg_pass = m_cfg;
|
||||||
|
m_auth_mode->SetSelection(1); // 1=Password
|
||||||
|
} else
|
||||||
|
wxFAIL_MSG(wxT("Unsupported authentication mode."));
|
||||||
|
|
||||||
|
return wxGTCConfigPanelBase::TransferDataToWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool wxGTCConfigPanel::TransferDataFromWindow()
|
||||||
|
{
|
||||||
|
wxCHECK(wxGTCConfigPanelBase::TransferDataFromWindow(), false);
|
||||||
|
|
||||||
|
if (!m_prov.m_read_only) {
|
||||||
|
// This is not a provider-locked configuration. Save the data.
|
||||||
|
switch (m_auth_mode->GetSelection()) {
|
||||||
|
case 0: // 0=Challenge/Response
|
||||||
|
m_cfg = m_cfg_resp;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // 1=Password
|
||||||
|
m_cfg = m_cfg_pass;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG(wxT("Unsupported authentication mode."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxGTCConfigPanel::OnUpdateUI(wxUpdateUIEvent& event)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(event);
|
||||||
|
|
||||||
|
if (m_prov.m_read_only) {
|
||||||
|
// This is provider-locked configuration. Disable controls.
|
||||||
|
m_auth_mode_label ->Enable(false);
|
||||||
|
m_auth_mode ->Enable(false);
|
||||||
|
m_credentials_resp->Enable(false);
|
||||||
|
m_credentials_pass->Enable(false);
|
||||||
|
} else {
|
||||||
|
// This is not a provider-locked configuration. Enable controls.
|
||||||
|
m_auth_mode_label ->Enable(true);
|
||||||
|
m_auth_mode ->Enable(true);
|
||||||
|
m_credentials_resp->Enable(true);
|
||||||
|
m_credentials_pass ->Enable(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// \endcond
|
/// \endcond
|
||||||
|
|
||||||
|
|
||||||
|
@@ -55,7 +55,6 @@ wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindow
|
|||||||
sb_root_ca_btn->Add( m_root_ca_add_file, 0, wxRIGHT|wxLEFT, 5 );
|
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 = 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") );
|
m_root_ca_remove->SetToolTip( _("Removes selected certificate authorities from the list") );
|
||||||
|
|
||||||
sb_root_ca_btn->Add( m_root_ca_remove, 0, wxLEFT, 5 );
|
sb_root_ca_btn->Add( m_root_ca_remove, 0, wxLEFT, 5 );
|
||||||
|
@@ -659,7 +659,7 @@
|
|||||||
<property name="dock">Dock</property>
|
<property name="dock">Dock</property>
|
||||||
<property name="dock_fixed">0</property>
|
<property name="dock_fixed">0</property>
|
||||||
<property name="docking">Left</property>
|
<property name="docking">Left</property>
|
||||||
<property name="enabled">0</property>
|
<property name="enabled">1</property>
|
||||||
<property name="fg"></property>
|
<property name="fg"></property>
|
||||||
<property name="floatable">1</property>
|
<property name="floatable">1</property>
|
||||||
<property name="font"></property>
|
<property name="font"></property>
|
||||||
|
@@ -44,11 +44,10 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs context
|
/// Constructs context
|
||||||
///
|
///
|
||||||
/// \param[in] mod EAP module to use for global services
|
|
||||||
/// \param[in] cfg Connection configuration
|
/// \param[in] cfg Connection configuration
|
||||||
/// \param[in] cred Connection credentials
|
/// \param[in] cred Connection credentials
|
||||||
///
|
///
|
||||||
ui_context_ttls(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred);
|
ui_context_ttls(_In_ config_connection &cfg, _In_ credentials_connection &cred);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies context
|
/// Copies context
|
||||||
@@ -82,13 +81,6 @@ namespace eap
|
|||||||
///
|
///
|
||||||
ui_context_ttls& operator=(_Inout_ ui_context_ttls &&other);
|
ui_context_ttls& operator=(_Inout_ ui_context_ttls &&other);
|
||||||
|
|
||||||
///
|
|
||||||
/// Clones this object
|
|
||||||
///
|
|
||||||
/// \returns Pointer to cloned object with identical data
|
|
||||||
///
|
|
||||||
virtual config* clone() const;
|
|
||||||
|
|
||||||
/// \name BLOB management
|
/// \name BLOB management
|
||||||
/// @{
|
/// @{
|
||||||
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
||||||
|
@@ -259,7 +259,7 @@ EAP_SESSION_HANDLE eap::peer_ttls::begin_session(
|
|||||||
case eap_type_gtc : meth_inner.reset(
|
case eap_type_gtc : meth_inner.reset(
|
||||||
new method_eapmsg (*this, cred_inner->get_identity().c_str(),
|
new method_eapmsg (*this, cred_inner->get_identity().c_str(),
|
||||||
new method_eap (*this, eap_type_gtc,
|
new method_eap (*this, eap_type_gtc,
|
||||||
new method_gtc (*this, dynamic_cast<config_method_eapgtc&>(*cfg_inner), dynamic_cast<credentials_identity&>(*cred_inner))))); break;
|
new method_gtc (*this, dynamic_cast<config_method_eapgtc&>(*cfg_inner), dynamic_cast<credentials&>(*cred_inner))))); break;
|
||||||
default: throw invalid_argument(__FUNCTION__ " Unsupported inner authentication method.");
|
default: throw invalid_argument(__FUNCTION__ " Unsupported inner authentication method.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ void eap::peer_ttls::get_ui_context(
|
|||||||
auto s = static_cast<session*>(hSession);
|
auto s = static_cast<session*>(hSession);
|
||||||
|
|
||||||
// Get context data from method.
|
// Get context data from method.
|
||||||
ui_context_ttls ctx(*this, s->m_cfg, s->m_cred);
|
ui_context_ttls ctx(s->m_cfg, s->m_cred);
|
||||||
s->m_method->get_ui_context(ctx.m_data);
|
s->m_method->get_ui_context(ctx.m_data);
|
||||||
|
|
||||||
// Pack context data.
|
// Pack context data.
|
||||||
|
@@ -28,14 +28,15 @@ using namespace winstd;
|
|||||||
// eap::ui_context_ttls
|
// eap::ui_context_ttls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::ui_context_ttls::ui_context_ttls(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred) :
|
eap::ui_context_ttls::ui_context_ttls(_In_ config_connection &cfg, _In_ credentials_connection &cred) :
|
||||||
ui_context(mod, cfg, cred)
|
ui_context(cfg, cred)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eap::ui_context_ttls::ui_context_ttls(_In_ const ui_context_ttls &other) :
|
eap::ui_context_ttls::ui_context_ttls(_In_ const ui_context_ttls &other) :
|
||||||
ui_context(other)
|
m_data (other.m_data),
|
||||||
|
ui_context(other )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,12 +70,6 @@ eap::ui_context_ttls& eap::ui_context_ttls::operator=(_Inout_ ui_context_ttls &&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eap::config* eap::ui_context_ttls::clone() const
|
|
||||||
{
|
|
||||||
return new ui_context_ttls(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void eap::ui_context_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
void eap::ui_context_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
||||||
{
|
{
|
||||||
ui_context::operator<<(cursor);
|
ui_context::operator<<(cursor);
|
||||||
|
@@ -43,7 +43,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
static wxCriticalSection s_lock; ///< Initialization lock
|
static wxCriticalSection s_lock; ///< Initialization lock
|
||||||
static unsigned long s_init_ref_count; ///< Initialization reference counter
|
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.
|
// Initialize application.
|
||||||
wxInitializerPeer init(m_instance);
|
wxInitializerPeer init(m_instance);
|
||||||
|
|
||||||
{
|
wxWindow *parent;
|
||||||
|
if (hwndParent) {
|
||||||
// Create wxWidget-approved parent window.
|
// Create wxWidget-approved parent window.
|
||||||
wxWindow parent;
|
parent = new wxWindow;
|
||||||
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
|
parent->SetHWND((WXHWND)hwndParent);
|
||||||
parent.AdoptAttributesFromHWND();
|
parent->AdoptAttributesFromHWND();
|
||||||
wxTopLevelWindows.Append(&parent);
|
wxTopLevelWindows.Append(parent);
|
||||||
|
} else
|
||||||
|
parent = NULL;
|
||||||
|
|
||||||
// Create and launch configuration dialog.
|
// Create and launch configuration dialog.
|
||||||
wxEAPConfigDialog<wxTTLSConfigWindow> dlg(cfg, &parent);
|
wxEAPConfigDialog<wxTTLSConfigWindow> dlg(cfg, parent);
|
||||||
result = dlg.ShowModal();
|
if (!parent) {
|
||||||
|
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
|
||||||
|
::FlashWindowEx(&fwi);
|
||||||
|
}
|
||||||
|
result = dlg.ShowModal();
|
||||||
|
|
||||||
wxTopLevelWindows.DeleteObject(&parent);
|
if (parent) {
|
||||||
parent.SetHWND((WXHWND)NULL);
|
wxTopLevelWindows.DeleteObject(parent);
|
||||||
|
parent->SetHWND((WXHWND)NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,6 +161,9 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
_Out_ DWORD *pdwUserDataOutSize,
|
_Out_ DWORD *pdwUserDataOutSize,
|
||||||
_Out_ LPWSTR *ppwszIdentity)
|
_Out_ LPWSTR *ppwszIdentity)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
//::Sleep(10000);
|
||||||
|
#endif
|
||||||
assert(ppwszIdentity);
|
assert(ppwszIdentity);
|
||||||
|
|
||||||
// Unpack configuration.
|
// Unpack configuration.
|
||||||
@@ -178,193 +189,220 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
// Initialize application.
|
// Initialize application.
|
||||||
wxInitializerPeer init(m_instance);
|
wxInitializerPeer init(m_instance);
|
||||||
|
|
||||||
{
|
wxWindow *parent;
|
||||||
|
if (hwndParent) {
|
||||||
// Create wxWidget-approved parent window.
|
// Create wxWidget-approved parent window.
|
||||||
wxWindow parent;
|
parent = new wxWindow;
|
||||||
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
|
parent->SetHWND((WXHWND)hwndParent);
|
||||||
parent.AdoptAttributesFromHWND();
|
parent->AdoptAttributesFromHWND();
|
||||||
wxTopLevelWindows.Append(&parent);
|
wxTopLevelWindows.Append(parent);
|
||||||
|
} else
|
||||||
|
parent = NULL;
|
||||||
|
|
||||||
if (cfg.m_providers.size() > 1) {
|
if (cfg.m_providers.size() > 1) {
|
||||||
// Multiple identity providers: User has to select one first.
|
// 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);
|
||||||
|
}
|
||||||
|
} else if (!cfg.m_providers.empty()) {
|
||||||
|
// Single identity provider. No need to ask user to select one.
|
||||||
|
result = wxID_OK;
|
||||||
|
cfg_prov = &cfg.m_providers.front();
|
||||||
|
} else {
|
||||||
|
// No identity provider. Bail out.
|
||||||
|
result = wxID_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfg_prov) {
|
||||||
|
// The identity provider is selected.
|
||||||
|
cfg_method = dynamic_cast<config_method_ttls*>(cfg_prov->m_methods.front().get());
|
||||||
|
assert(cfg_method);
|
||||||
|
|
||||||
|
// Configure output credentials.
|
||||||
|
cred_out.m_namespace = cfg_prov->m_namespace;
|
||||||
|
cred_out.m_id = cfg_prov->m_id;
|
||||||
|
auto cred = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
||||||
|
cred_out.m_cred.reset(cred);
|
||||||
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
|
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (dwFlags & EAP_FLAG_GUEST_ACCESS) {
|
||||||
|
// Disable credential saving for guests.
|
||||||
|
cfg_method-> m_allow_save = false;
|
||||||
|
cfg_method->m_inner->m_allow_save = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine outer credentials.
|
||||||
|
wstring target_name(std::move(cfg_prov->get_id()));
|
||||||
|
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
||||||
|
dwFlags,
|
||||||
|
NULL,
|
||||||
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
|
has_cached ? cred_in.m_cred.get() : NULL,
|
||||||
|
#else
|
||||||
|
NULL,
|
||||||
|
#endif
|
||||||
|
*cfg_method,
|
||||||
|
cfg_method->m_allow_save ? target_name.c_str() : NULL);
|
||||||
|
if (src_outer == eap::credentials::source_unknown ||
|
||||||
|
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);
|
||||||
|
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);
|
||||||
|
panel->SetRemember(src_outer == eap::credentials::source_storage);
|
||||||
|
dlg.AddContent(panel);
|
||||||
|
|
||||||
|
// Update dialog layout.
|
||||||
|
dlg.Layout();
|
||||||
|
dlg.GetSizer()->Fit(&dlg);
|
||||||
|
|
||||||
// Centre and display dialog.
|
// Centre and display dialog.
|
||||||
dlg.Centre(wxBOTH);
|
dlg.Centre(wxBOTH);
|
||||||
|
if (!parent) {
|
||||||
|
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
|
||||||
|
::FlashWindowEx(&fwi);
|
||||||
|
}
|
||||||
if ((result = dlg.ShowModal()) == wxID_OK) {
|
if ((result = dlg.ShowModal()) == wxID_OK) {
|
||||||
cfg_prov = dlg.GetSelection();
|
// Write credentials to credential manager.
|
||||||
assert(cfg_prov);
|
if (panel->GetRemember()) {
|
||||||
|
try {
|
||||||
|
cred->credentials_tls::store(target_name.c_str(), 0);
|
||||||
|
} catch (winstd::win_runtime_error &err) {
|
||||||
|
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||||
|
} catch (...) {
|
||||||
|
wxLogError(_("Writing credentials failed."));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!cfg.m_providers.empty()) {
|
} else
|
||||||
// Single identity provider. No need to ask user to select one.
|
|
||||||
result = wxID_OK;
|
result = wxID_OK;
|
||||||
cfg_prov = &cfg.m_providers.front();
|
|
||||||
} else {
|
|
||||||
// No identity provider. Bail out.
|
|
||||||
result = wxID_CANCEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cfg_prov) {
|
if (result == wxID_OK) {
|
||||||
// The identity provider is selected.
|
// Combine inner credentials.
|
||||||
cfg_method = dynamic_cast<config_method_ttls*>(cfg_prov->m_methods.front().get());
|
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
||||||
assert(cfg_method);
|
|
||||||
|
|
||||||
// Configure output credentials.
|
|
||||||
cred_out.m_namespace = cfg_prov->m_namespace;
|
|
||||||
cred_out.m_id = cfg_prov->m_id;
|
|
||||||
auto cred = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
|
||||||
cred_out.m_cred.reset(cred);
|
|
||||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
|
||||||
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (dwFlags & EAP_FLAG_GUEST_ACCESS) {
|
|
||||||
// Disable credential saving for guests.
|
|
||||||
cfg_method-> m_allow_save = false;
|
|
||||||
cfg_method->m_inner->m_allow_save = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Combine outer credentials.
|
|
||||||
wstring target_name(std::move(cfg_prov->get_id()));
|
|
||||||
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
|
||||||
dwFlags,
|
dwFlags,
|
||||||
NULL,
|
NULL,
|
||||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
has_cached ? cred_in.m_cred.get() : NULL,
|
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
||||||
#else
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
#endif
|
||||||
*cfg_method,
|
*cfg_method->m_inner,
|
||||||
cfg_method->m_allow_save ? target_name.c_str() : NULL);
|
cfg_method->m_inner->m_allow_save ? target_name.c_str() : NULL);
|
||||||
if (src_outer == eap::credentials::source_unknown ||
|
if (src_inner == eap::credentials::source_unknown ||
|
||||||
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)
|
src_inner != eap::credentials::source_config && 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)
|
||||||
{
|
{
|
||||||
// Build dialog to prompt for outer credentials.
|
// Prompt for inner credentials.
|
||||||
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);
|
|
||||||
panel->SetRemember(src_outer == eap::credentials::source_storage);
|
|
||||||
dlg.AddContent(panel);
|
|
||||||
|
|
||||||
// Update dialog layout.
|
|
||||||
dlg.Layout();
|
|
||||||
dlg.GetSizer()->Fit(&dlg);
|
|
||||||
|
|
||||||
// Centre and display dialog.
|
|
||||||
dlg.Centre(wxBOTH);
|
|
||||||
if ((result = dlg.ShowModal()) == wxID_OK) {
|
|
||||||
// Write credentials to credential manager.
|
|
||||||
if (panel->GetRemember()) {
|
|
||||||
try {
|
|
||||||
cred->credentials_tls::store(target_name.c_str(), 0);
|
|
||||||
} catch (winstd::win_runtime_error &err) {
|
|
||||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
|
||||||
} catch (...) {
|
|
||||||
wxLogError(_("Writing credentials failed."));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
result = wxID_OK;
|
|
||||||
|
|
||||||
if (result == wxID_OK) {
|
|
||||||
// Combine inner credentials.
|
|
||||||
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
|
||||||
dwFlags,
|
|
||||||
NULL,
|
|
||||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
|
||||||
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
|
||||||
#else
|
|
||||||
NULL,
|
|
||||||
#endif
|
|
||||||
*cfg_method->m_inner,
|
|
||||||
cfg_method->m_inner->m_allow_save ? target_name.c_str() : NULL);
|
|
||||||
if (src_inner == eap::credentials::source_unknown ||
|
|
||||||
src_inner != eap::credentials::source_config && 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)
|
|
||||||
{
|
|
||||||
// Prompt for inner credentials.
|
|
||||||
#if EAP_INNER_EAPHOST
|
#if EAP_INNER_EAPHOST
|
||||||
auto cfg_inner_eaphost = dynamic_cast<config_method_eaphost*>(cfg_method->m_inner.get());
|
auto cfg_inner_eaphost = dynamic_cast<config_method_eaphost*>(cfg_method->m_inner.get());
|
||||||
if (!cfg_inner_eaphost)
|
if (!cfg_inner_eaphost)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// Native inner methods. Build dialog to prompt for inner credentials.
|
// 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)
|
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));
|
dlg.AddContent(new wxEAPCredentialWarningPanel(*cfg_prov, cfg_method->m_inner->m_last_status, &dlg));
|
||||||
wxEAPCredentialsPanelBase *panel = NULL;
|
wxEAPCredentialsPanelBase *panel = NULL;
|
||||||
switch (cfg_method->m_inner->get_method_id()) {
|
switch (cfg_method->m_inner->get_method_id()) {
|
||||||
case eap_type_legacy_pap : panel = new wxPAPCredentialsPanel (*cfg_prov, *dynamic_cast<const eap::config_method_pap *>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
case eap_type_legacy_pap : panel = new wxPAPCredentialsPanel (*cfg_prov, *dynamic_cast<const eap::config_method_pap *>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
||||||
case eap_type_legacy_mschapv2: panel = new wxMSCHAPv2CredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_mschapv2 *>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
case eap_type_legacy_mschapv2: panel = new wxMSCHAPv2CredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_mschapv2 *>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
||||||
case eap_type_mschapv2 : panel = new wxMSCHAPv2CredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_eapmschapv2*>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
case eap_type_mschapv2 : panel = new wxMSCHAPv2CredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_eapmschapv2*>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_pass *>(cred->m_inner.get()), &dlg, false); break;
|
||||||
case eap_type_gtc : panel = new wxGTCCredentialsPanel (*cfg_prov, *dynamic_cast<const eap::config_method_eapgtc *>(cfg_method->m_inner.get()), *dynamic_cast<eap::credentials_identity*>(cred->m_inner.get()), &dlg, false); break;
|
case eap_type_gtc : {
|
||||||
default : wxLogError("Unsupported inner authentication method.");
|
// EAP-GTC credential prompt differes for "Challenge/Response" and "Password" authentication modes.
|
||||||
|
eap::credentials_identity *cred_resp;
|
||||||
|
eap::credentials_pass *cred_pass;
|
||||||
|
if ((cred_resp = dynamic_cast<eap::credentials_identity*>(cred->m_inner.get())) != NULL)
|
||||||
|
panel = new wxGTCResponseCredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_eapgtc*>(cfg_method->m_inner.get()), *cred_resp, &dlg, false);
|
||||||
|
else if ((cred_pass = dynamic_cast<eap::credentials_pass*>(cred->m_inner.get())) != NULL)
|
||||||
|
panel = new wxGTCPasswordCredentialsPanel(*cfg_prov, *dynamic_cast<const eap::config_method_eapgtc*>(cfg_method->m_inner.get()), *cred_pass, &dlg, false);
|
||||||
|
else
|
||||||
|
wxLogError("Unsupported authentication mode.");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
panel->SetRemember(src_inner == eap::credentials::source_storage);
|
default : wxLogError("Unsupported inner authentication method.");
|
||||||
dlg.AddContent(panel);
|
}
|
||||||
|
panel->SetRemember(src_inner == eap::credentials::source_storage);
|
||||||
|
dlg.AddContent(panel);
|
||||||
|
|
||||||
// Update dialog layout.
|
// Update dialog layout.
|
||||||
dlg.Layout();
|
dlg.Layout();
|
||||||
dlg.GetSizer()->Fit(&dlg);
|
dlg.GetSizer()->Fit(&dlg);
|
||||||
|
|
||||||
// Centre and display dialog.
|
// Centre and display dialog.
|
||||||
dlg.Centre(wxBOTH);
|
dlg.Centre(wxBOTH);
|
||||||
if ((result = dlg.ShowModal()) == wxID_OK) {
|
if (!parent) {
|
||||||
// Write credentials to credential manager.
|
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
|
||||||
if (panel->GetRemember()) {
|
::FlashWindowEx(&fwi);
|
||||||
try {
|
}
|
||||||
cred->m_inner->store(target_name.c_str(), 1);
|
if ((result = dlg.ShowModal()) == wxID_OK) {
|
||||||
} catch (winstd::win_runtime_error &err) {
|
// Write credentials to credential manager.
|
||||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
if (panel->GetRemember()) {
|
||||||
} catch (...) {
|
try {
|
||||||
wxLogError(_("Writing credentials failed."));
|
cred->m_inner->store(target_name.c_str(), 1);
|
||||||
}
|
} catch (winstd::win_runtime_error &err) {
|
||||||
|
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||||
|
} catch (...) {
|
||||||
|
wxLogError(_("Writing credentials failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#if EAP_INNER_EAPHOST
|
#if EAP_INNER_EAPHOST
|
||||||
else {
|
else {
|
||||||
// EapHost inner method
|
// EapHost inner method
|
||||||
auto cred_inner = dynamic_cast<eap::credentials_eaphost*>(cred->m_inner.get());
|
auto cred_inner = dynamic_cast<eap::credentials_eaphost*>(cred->m_inner.get());
|
||||||
DWORD cred_data_size = 0;
|
DWORD cred_data_size = 0;
|
||||||
winstd::eap_blob cred_data;
|
winstd::eap_blob cred_data;
|
||||||
unique_ptr<WCHAR[], EapHostPeerFreeMemory_delete> identity;
|
unique_ptr<WCHAR[], EapHostPeerFreeMemory_delete> identity;
|
||||||
winstd::eap_error error;
|
winstd::eap_error error;
|
||||||
DWORD dwResult = EapHostPeerInvokeIdentityUI(
|
DWORD dwResult = EapHostPeerInvokeIdentityUI(
|
||||||
0,
|
0,
|
||||||
cfg_inner_eaphost->get_type(),
|
cfg_inner_eaphost->get_type(),
|
||||||
dwFlags,
|
dwFlags,
|
||||||
hwndParent,
|
hwndParent,
|
||||||
(DWORD)cfg_inner_eaphost->m_cfg_blob.size(), cfg_inner_eaphost->m_cfg_blob.data(),
|
(DWORD)cfg_inner_eaphost->m_cfg_blob.size(), cfg_inner_eaphost->m_cfg_blob.data(),
|
||||||
(DWORD)cred_inner->m_cred_blob.size(), cred_inner->m_cred_blob.data(),
|
(DWORD)cred_inner->m_cred_blob.size(), cred_inner->m_cred_blob.data(),
|
||||||
&cred_data_size, &cred_data._Myptr,
|
&cred_data_size, &cred_data._Myptr,
|
||||||
&identity._Myptr,
|
&identity._Myptr,
|
||||||
&error._Myptr,
|
&error._Myptr,
|
||||||
NULL);
|
NULL);
|
||||||
result = dwResult == ERROR_SUCCESS ? wxID_OK : wxID_CANCEL;
|
result = dwResult == ERROR_SUCCESS ? wxID_OK : wxID_CANCEL;
|
||||||
if (dwResult == ERROR_SUCCESS) {
|
if (dwResult == ERROR_SUCCESS) {
|
||||||
// Inner EAP method provided credentials.
|
// Inner EAP method provided credentials.
|
||||||
cred_inner->m_identity = identity.get();
|
cred_inner->m_identity = identity.get();
|
||||||
cred_inner->m_cred_blob.assign(cred_data.get(), cred_data.get() + cred_data_size);
|
cred_inner->m_cred_blob.assign(cred_data.get(), cred_data.get() + cred_data_size);
|
||||||
SecureZeroMemory(cred_data.get(), cred_data_size);
|
SecureZeroMemory(cred_data.get(), cred_data_size);
|
||||||
|
|
||||||
// TODO: If we ever choose to store EapHost credentials to Windows Credential Manager, add a "Save credentials? Yes/No" prompt here and write them to Credential Manager.
|
// TODO: If we ever choose to store EapHost credentials to Windows Credential Manager, add a "Save credentials? Yes/No" prompt here and write them to Credential Manager.
|
||||||
} else if (dwResult == ERROR_CANCELLED) {
|
} else if (dwResult == ERROR_CANCELLED) {
|
||||||
// Not really an error.
|
// Not really an error.
|
||||||
} else if (error)
|
} else if (error)
|
||||||
wxLogError(_("Invoking EAP identity UI failed (error %u, %s, %s)."), error->dwWinError, error->pRootCauseString, error->pRepairString);
|
wxLogError(_("Invoking EAP identity UI failed (error %u, %s, %s)."), error->dwWinError, error->pRootCauseString, error->pRepairString);
|
||||||
else
|
else
|
||||||
wxLogError(_("Invoking EAP identity UI failed (error %u)."), dwResult);
|
wxLogError(_("Invoking EAP identity UI failed (error %u)."), dwResult);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
result = wxID_OK;
|
result = wxID_OK;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxTopLevelWindows.DeleteObject(&parent);
|
if (parent) {
|
||||||
parent.SetHWND((WXHWND)NULL);
|
wxTopLevelWindows.DeleteObject(parent);
|
||||||
|
parent->SetHWND((WXHWND)NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +431,7 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
|
|||||||
// Unpack context data.
|
// Unpack context data.
|
||||||
config_connection cfg(*this);
|
config_connection cfg(*this);
|
||||||
credentials_connection cred(*this, cfg);
|
credentials_connection cred(*this, cfg);
|
||||||
ui_context_ttls ctx(*this, cfg, cred);
|
ui_context_ttls ctx(cfg, cred);
|
||||||
unpack(ctx, pUIContextData, dwUIContextDataSize);
|
unpack(ctx, pUIContextData, dwUIContextDataSize);
|
||||||
|
|
||||||
// Look-up the provider.
|
// Look-up the provider.
|
||||||
@@ -423,39 +461,47 @@ void eap::peer_ttls_ui::invoke_interactive_ui(
|
|||||||
// Initialize application.
|
// Initialize application.
|
||||||
wxInitializerPeer init(m_instance);
|
wxInitializerPeer init(m_instance);
|
||||||
|
|
||||||
{
|
wxWindow *parent;
|
||||||
|
if (hwndParent) {
|
||||||
// Create wxWidget-approved parent window.
|
// Create wxWidget-approved parent window.
|
||||||
wxWindow parent;
|
parent = new wxWindow;
|
||||||
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
|
parent->SetHWND((WXHWND)hwndParent);
|
||||||
parent.AdoptAttributesFromHWND();
|
parent->AdoptAttributesFromHWND();
|
||||||
wxTopLevelWindows.Append(&parent);
|
wxTopLevelWindows.Append(parent);
|
||||||
|
} else
|
||||||
|
parent = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
sanitizing_wstring
|
sanitizing_wstring
|
||||||
challenge(reinterpret_cast<sanitizing_wstring::const_pointer>(ctx.m_data.data()), ctx.m_data.size()/sizeof(sanitizing_wstring::value_type)),
|
challenge(reinterpret_cast<sanitizing_wstring::const_pointer>(ctx.m_data.data()), ctx.m_data.size()/sizeof(sanitizing_wstring::value_type)),
|
||||||
response;
|
response;
|
||||||
|
|
||||||
// Build dialog to prompt for 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);
|
auto panel = new wxGTCResponsePanel(response, challenge.c_str(), &dlg);
|
||||||
dlg.AddContent(panel);
|
dlg.AddContent(panel);
|
||||||
|
|
||||||
// Update dialog layout.
|
// Update dialog layout.
|
||||||
dlg.Layout();
|
dlg.Layout();
|
||||||
dlg.GetSizer()->Fit(&dlg);
|
dlg.GetSizer()->Fit(&dlg);
|
||||||
|
|
||||||
// Centre and display dialog.
|
// Centre and display dialog.
|
||||||
dlg.Centre(wxBOTH);
|
dlg.Centre(wxBOTH);
|
||||||
if ((result = dlg.ShowModal()) == wxID_OK) {
|
if (!parent) {
|
||||||
// Save response.
|
FLASHWINFO fwi = { sizeof(FLASHWINFO), dlg.GetHWND(), FLASHW_ALL | FLASHW_TIMERNOFG };
|
||||||
ctx.m_data.assign(
|
::FlashWindowEx(&fwi);
|
||||||
reinterpret_cast<sanitizing_blob::const_pointer>(response.data() ),
|
|
||||||
reinterpret_cast<sanitizing_blob::const_pointer>(response.data() + response.length()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ((result = dlg.ShowModal()) == wxID_OK) {
|
||||||
|
// Save response.
|
||||||
|
ctx.m_data.assign(
|
||||||
|
reinterpret_cast<sanitizing_blob::const_pointer>(response.data() ),
|
||||||
|
reinterpret_cast<sanitizing_blob::const_pointer>(response.data() + response.length()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxTopLevelWindows.DeleteObject(&parent);
|
if (parent) {
|
||||||
parent.SetHWND((WXHWND)NULL);
|
wxTopLevelWindows.DeleteObject(parent);
|
||||||
|
parent->SetHWND((WXHWND)NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,9 +558,10 @@ wxInitializerPeer::wxInitializerPeer(_In_ HINSTANCE instance)
|
|||||||
|
|
||||||
// Do our wxWidgets configuration and localization initialization.
|
// Do our wxWidgets configuration and localization initialization.
|
||||||
wxInitializeConfig();
|
wxInitializeConfig();
|
||||||
if (wxInitializeLocale(s_locale)) {
|
s_locale = new wxLocale;
|
||||||
s_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
|
if (wxInitializeLocale(*s_locale)) {
|
||||||
s_locale.AddCatalog(wxT("EAPTTLSUI"));
|
s_locale->AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
|
||||||
|
s_locale->AddCatalog(wxT("EAPTTLSUI"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,9 +573,14 @@ wxInitializerPeer::~wxInitializerPeer()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wxEntryCleanup();
|
wxEntryCleanup();
|
||||||
|
|
||||||
|
if (s_locale) {
|
||||||
|
delete s_locale;
|
||||||
|
s_locale = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxCriticalSection wxInitializerPeer::s_lock;
|
wxCriticalSection wxInitializerPeer::s_lock;
|
||||||
unsigned long wxInitializerPeer::s_init_ref_count = 0;
|
unsigned long wxInitializerPeer::s_init_ref_count = 0;
|
||||||
wxLocale wxInitializerPeer::s_locale;
|
wxLocale *wxInitializerPeer::s_locale = NULL;
|
||||||
|
Submodule lib/WinStd updated: 5ffcb79306...b09610fd5f
Submodule lib/wxExtend updated: eb33a877d1...5ff1a95df2
Reference in New Issue
Block a user