Compare commits

..

288 Commits
ver1.0 ... 1.2g

Author SHA1 Message Date
bbd5aa1490 Enable function level linking to allow LTCG
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-09-04 13:11:49 +02:00
6fb5cb88d2 Address code analysis warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-09-04 13:11:48 +02:00
a459823beb Make ui_canceller cover more code
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-22 18:38:03 +02:00
9058dc75d9 Change GEANTLink-dist repo local path
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-22 15:31:08 +02:00
ab3ffc63f7 Cancel previous credential prompt if EapHost wants a new one
(fixes #27)

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 16:02:32 +02:00
24a02e5adf Simplify UI flow
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 15:34:49 +02:00
b2d939011f Tolerate already registered monitor master and slave window classes
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 15:08:16 +02:00
2ce0c5d259 Optimize std::wstring (un)packing
The string is now converted to and from UTF-8 directly into or from
memory pointed by cursor. Extra buffer allocation and copy has been
dropped.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 13:22:57 +02:00
f3cc5b6064 Fix typo
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 08:56:01 +02:00
8a093c645e Make (un)packing of std C++ string explicit
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 08:55:32 +02:00
35fd9fbbac Move eap::monitor_ui to Module.h/cpp
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-14 08:50:02 +02:00
dfd26f214d Upgrade eap::monitor_ui's HWND to volatile
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-13 14:28:21 +02:00
009cd36fe2 Move parent HWND management to wxInitializerPeer
While reducing copy & pasted code, this also protects wxTopLevelWindows
list with a lock.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-13 12:47:27 +02:00
592d53d8bc Log failure status reason of last authentication failure
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-12 14:12:25 +02:00
e10923c7c2 Update translation templates
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-12 14:10:42 +02:00
d66ad98a49 Update documentation
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-12 13:18:51 +02:00
2e8bd4403f Fix typo 2019-06-14 11:51:09 +02:00
40ee89a04a Update translations
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 11:09:02 +02:00
0e69fb175c Upgrade to Visual Studio 2019
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 10:54:41 +02:00
8233992b76 Update documentation
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
f88b966762 Bump wxExtend
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
5a82dc2a25 Unify LPCBYTE
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
638f2cf18d Bump WinStd
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
38a7354ad9 Upgrade to compile with WIN32_LEAN_AND_MEAN
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
672afbb918 Preset version to 1.2g
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-14 09:57:48 +02:00
ec908bbfe9 Update README.md 2018-12-06 08:34:09 +01:00
3396f9cf97 Force SHA-256 digest for timestamp signatures
Comodo timestamp server defaults to SHA-1. To make sure timestamp
signatures are SHA-256, add appropriate signtool.exe flag.
2018-11-06 20:08:44 +01:00
f6ce76d384 Update translations and add Estonian translation 2018-11-06 20:08:08 +01:00
ee7a8ce6d1 Silence the missing shcore.dll warning on Windows 7 2018-11-06 20:06:41 +01:00
a53ceba97e Preset version to 1.2f 2018-11-06 20:06:13 +01:00
4d7538937b Update sub-modules
(fixes #25)
2018-09-30 16:54:53 +02:00
10297c7ab3 Make GUI DPI-aware 2018-09-17 11:43:19 +02:00
c7f1a66a4a Update sub-modules 2018-09-14 17:50:45 +02:00
c2426f26fd Clean-up 2018-09-08 01:10:43 +02:00
6069a25c75 Run MSBuild tasks in parallel 2018-09-07 12:54:43 +02:00
f07eed7882 Pre-set version to 1.2e 2018-09-07 12:53:46 +02:00
401b4cdc28 Set version to 1.2d 2018-09-07 12:43:33 +02:00
1879d00bf9 Add support for ARM64 platform 2018-09-07 10:39:20 +02:00
0602285220 Switch to Visual Studio 2017 2018-09-05 14:56:08 +02:00
1fe80bd0e0 Stop using internal unique_ptr::_Myptr member 2018-09-05 14:40:27 +02:00
b3e5c93f4b Add explicit constructors/operators to sanitizing_blob_(z)f
Otherwise the compiler might generate default ones - and delete them
too.
2018-09-05 14:32:03 +02:00
366e08899b Review implicit narrowing conversions 2018-09-05 14:29:49 +02:00
d5142aaf15 Distinguish or merge variables with same names
...to resolve C4457 warnings.
2018-09-05 14:27:59 +02:00
0b3e340dbe Update sub-modules 2018-09-05 13:22:59 +02:00
b655bd7d0b Register en_US language in nmake register
When "Language" setting is absent in registry, the initialization of
wxWidget localization raises asserts.
2018-09-05 13:16:59 +02:00
daeca67bee Force disable incremental linking
Incremental linking and reference optimization are mutually exclusive.
While VC2010 defaulted to non-incremental linking, this conflict was not
apparent.
2018-09-05 13:15:48 +02:00
d2b66563e1 Fix incorrect template parameter tolerated by VC2010 2018-09-05 13:13:14 +02:00
0d21610322 Remove MFC dependency 2018-09-05 13:11:14 +02:00
f75e72757e VS10Solution.sln => GEANTLink.sln 2018-09-05 13:06:21 +02:00
2e81aee089 Update MSIBuild sub-module 2018-09-05 13:03:54 +02:00
7a6b760845 Upgrade to wxWidgets 3.1.1 and wxFormBuilder 3.8.1 2018-09-03 13:59:18 +02:00
5fd1c3b60e Switch to SHA-256 signing of final MSI files
This breaks support for Windows Vista.
2018-07-04 11:27:13 +02:00
e2c9914ef9 Import translations from Transifex 2018-07-04 10:02:49 +02:00
34a8f1b155 Update translation template 2018-06-20 15:32:34 +02:00
47f0a41fb6 Update sub-modules 2018-06-20 15:00:53 +02:00
352ad4f9d2 Stop using <> parentheses to avoid XML/HTML markup
Transifex treats strings enclosed in <> as HTML.
2018-06-20 14:59:52 +02:00
fc40c44612 .gitignore output WLANManager.exe properly 2018-06-20 14:58:48 +02:00
9846d29d76 Switch to SHA-256 signing 2018-06-20 14:58:27 +02:00
502f26059d Preset version to 1.2c 2018-06-20 14:58:17 +02:00
d0e363b7c0 Enable Italian GUI 2018-06-20 14:57:07 +02:00
6259a80cf4 Update translations 2018-06-20 14:57:01 +02:00
83f975861c Auto-detect devenv.com path 2018-06-20 14:56:36 +02:00
7593a34ff4 Set version to 1.2b 2017-12-05 10:04:27 +01:00
8aae24d63d Translation update 2017-12-05 10:03:42 +01:00
dd29b58da6 Update wxExtend module 2017-12-05 10:03:33 +01:00
864b8177e5 Update WinStd module 2017-12-05 10:03:19 +01:00
8de444dadf Distribution folder changed 2017-11-20 12:04:11 +01:00
1db7e953e8 Issue with NULL-initialized new profile configuration fixed 2017-07-10 10:48:10 +02:00
8605dcc751 Sub-module update 2017-05-30 12:35:06 +02:00
9210f2a711 Translation update 2017-05-30 12:34:49 +02:00
5d5e14b724 Version set to 1.2a 2017-05-22 09:31:00 +02:00
1d583c39c9 daea1bba62 reverted 2017-05-22 09:14:09 +02:00
9926cd19ee WMI\Autologger records not installed any more, since they caused feature completeness check trouble: MsiUseFeature() reports feature broken, when it is denied access to any component folder or registry key 2017-05-22 09:13:40 +02:00
daea1bba62 MsiUseFeature() returning INSTALLSTATE_BROKEN is tolerated in non-elevated process now 2017-05-22 08:38:39 +02:00
f05f8dab76 Version set to 1.2 2017-05-17 13:10:54 +02:00
ba11abff1d WLANManager.exe now deployed as WLANManager-Win32.exe and WLANManager-x64.exe 2017-05-17 13:09:26 +02:00
22f578b451 Documentation update 2017-05-17 12:53:10 +02:00
7bc76ac54c Supported OS list update 2017-05-17 12:28:14 +02:00
5e35c5769a Documentation update 2017-05-17 12:25:39 +02:00
3f888dd781 Secondary error message pop-up removed 2017-05-17 10:26:41 +02:00
5b065bce3d Update README.md 2017-05-16 13:34:06 +02:00
d8a1fe95aa Sub-module update 2017-05-16 13:31:39 +02:00
f57ee6c0f8 Documentation update 2017-05-16 13:31:24 +02:00
3364719ba1 WLANManager support for multiple wireless interfaces 2017-05-16 13:11:10 +02:00
e46739a510 Indentation fix 2017-03-14 09:36:48 +01:00
adc860fa6e Version set to 1.2-beta2 2017-02-24 11:09:27 +01:00
d4cc3053a6 Clean-up 2017-02-23 12:09:00 +01:00
38c6189d5f AuthMode setting correctly logged now 2017-02-23 11:18:23 +01:00
bf4c4d846e Incorrect CoCreateInstance() result evaluation fixed 2017-02-23 11:05:13 +01:00
5040ebba8e Pop-up window single flash replaced with periodic flashing 2017-02-22 11:48:39 +01:00
4598528765 Debugging-related exception in WlanUIEditProfile() resolved 2017-02-22 11:11:57 +01:00
8fbcf27f6a Locale is dynamic now, since wxLocale does not support re-initialization (when module is reused) 2017-02-22 09:42:18 +01:00
48d46617d2 Pop-ups are no longer children of the GetForegroundWindow() when no parent window is specified. Instead, they are displayed as a standalone app. 2017-02-21 15:13:20 +01:00
e7d5ecb50b Documentation update 2017-02-21 12:01:54 +01:00
6a77f3f7b3 New version of wxExtend 2017-02-20 10:57:53 +01:00
a4673f9fb9 Compilation of debug MSI files fixed 2017-02-20 10:05:03 +01:00
c84a8b5a70 Documentation update 2017-02-13 08:00:07 +01:00
31a3b67cba 64-bit language detection removed from 32-bit MSI resolving ICE80 warning 2017-02-09 13:40:43 +01:00
b44cb66b2a Version set to 1.2-beta1 2017-02-09 13:20:33 +01:00
690a6d54d2 EAP-GTC authentication now split into two modes: Challenge/Response and Password 2017-02-09 13:18:46 +01:00
e7e57abf52 Uninitialized enum higher bytes when reading as unsigned char fixed 2017-02-09 11:38:57 +01:00
bda31a487f Revert "EAP-GTC method renamed to "EAP-GTC (Token Generator)""
This reverts commit 2908bc31a3.
2017-02-09 09:33:39 +01:00
2908bc31a3 EAP-GTC method renamed to "EAP-GTC (Token Generator)" 2017-02-09 08:06:32 +01:00
66dd2bf283 eap::config split to eap::config and eap::packable 2017-02-07 09:33:29 +01:00
527d4271b1 Version set to 1.2-beta 2017-02-06 08:18:09 +01:00
36f6d04906 Translation update 2017-02-06 08:08:07 +01:00
e8758e9c41 Translation update 2017-02-02 18:17:07 +01:00
058ec398e6 __DANGEROUS__LOG_CONFIDENTIAL_DATA is now 0/1 #defined 2017-02-02 13:57:44 +01:00
5b79f5d849 EAP_INNER_EAPHOST is now 0/1 #defined 2017-02-02 13:57:16 +01:00
6f049d2692 EAP_USE_NATIVE_CREDENTIAL_CACHE is now 0/1 #defined 2017-02-02 13:25:24 +01:00
964bf4032a Doxygen settings updated 2017-02-02 12:39:51 +01:00
87e2296dde Documentation update 2017-02-02 12:17:52 +01:00
6284b6c29e EapHost support in invoke_interactive_ui() added 2017-02-02 11:36:12 +01:00
260b78025c EapHost credential prompt result evaluation fixed 2017-02-02 11:35:41 +01:00
6b81ea51d3 EapHost conditional compilation directive fixed 2017-02-02 11:26:15 +01:00
a07eb48174 EAP-GTC credential prompt fixed 2017-02-02 10:41:50 +01:00
0ec0e3579e EAP-GTC event logging and clean-up 2017-02-02 10:22:43 +01:00
a78901cb63 EAP-GTC challenge/response prompt now functional 2017-02-01 14:36:53 +01:00
27ae8baf3a eap::ui_context_ttls introduced 2017-02-01 14:35:33 +01:00
dd3da2f41a EAP-GTC response panel and dialog finished 2017-02-01 14:33:12 +01:00
6f3aa650b6 Clean-up 2017-02-01 14:32:00 +01:00
191e4abd9c eap::ui_context class for inter-process exchange introduced 2017-02-01 14:23:08 +01:00
386d852859 Clean-up 2017-02-01 13:11:27 +01:00
7977d04281 EapHost peer initialization conditional now 2017-02-01 11:02:41 +01:00
b632f0202f get_ui_context() upgraded 2017-02-01 10:52:57 +01:00
57372b8f95 Simple BLOB encryption/decryption added & comment updates 2017-02-01 10:23:07 +01:00
172cd18c16 Missing namespace added 2017-02-01 09:54:17 +01:00
cfc241d3a6 Initial version of GTC Challenge/Response panel added 2017-01-31 14:58:08 +01:00
4c1d4b0580 Identity and password credential panel icons distinguished 2017-01-31 14:42:36 +01:00
d508a6c398 EAP-GTC implementation continues... 2017-01-31 13:54:55 +01:00
f9083dc300 eap::credentials reverted back to abstract class (25934dd8c7 undone), and eap::credentials_identity introduced, since identity-only credentials must fail when <UserName> absent 2017-01-31 13:54:27 +01:00
0b358acba7 Clean-up 2017-01-31 13:41:08 +01:00
cbe831f9f6 EAP errors now correctly displayed in Event Viewer 2017-01-31 12:36:24 +01:00
d7795ef054 Translation update 2017-01-31 11:12:05 +01:00
9b41c73e9d Incorrect RFC quote removed 2017-01-31 11:03:06 +01:00
e8d231d360 EAP-GTC implementation continues... 2017-01-31 10:40:11 +01:00
f6522b8fa7 wxPasswordCredentialsPanel<> split to wxIdentityCredentialsPanel<> and wxPasswordCredentialsPanel<> to provide support for identity-only credentials (i.e. EAP-GTC). 2017-01-31 10:36:53 +01:00
25934dd8c7 eap::credentials no longer pure virtual to allow identity-only credentials (i.e. EAP-GTC). 2017-01-31 10:33:15 +01:00
4b4578fd59 Both event channels are registered using Makefile disabled now, to prevent Events.dll getting constantly locked by Event Log service. 2017-01-31 10:30:29 +01:00
4ec366b23b "User ID" and "Password" labels vertically centered 2017-01-31 10:04:56 +01:00
4b40c4d217 EAP-GTC work continues... 2017-01-30 14:49:27 +01:00
a2a87ddc4c Additional clarification of UI context handling 2017-01-30 14:49:09 +01:00
bd73ea7914 EAP-GTC implementation started 2017-01-30 13:42:51 +01:00
5fada1b6a9 Comment fixed 2017-01-30 12:41:53 +01:00
5f28fc873c EAP types look-up extended 2017-01-30 12:14:19 +01:00
2cb9453209 Version set to 1.2-alpha 2017-01-30 09:09:11 +01:00
78325c98c7 Documentation update 2016-12-13 11:28:29 +01:00
aa3f44260e Event reporting extended to support event channel in Windows Event Viewer 2016-12-09 13:29:07 +01:00
8f054a1f97 Event source in registry changed to match the one in manifest 2016-12-08 08:47:59 +01:00
f4a6e542f0 Translations updated 2016-12-07 13:56:05 +01:00
fb9e6c4e5a Missing credential identity tooltip reintroduced 2016-12-07 13:27:30 +01:00
e317439910 Some extra diagnostic output added when configuration XML contains unknown/unsupported method
# Conflicts:
#	lib/TTLS/src/Config.cpp
2016-12-07 13:23:01 +01:00
f7dcdc2dce Identity read-only text box in credential selection configuration panel has been replaced by static text not to confuse users they can edit it there 2016-12-07 13:18:31 +01:00
fb376b29df Version set to 1.1-beta2 2016-12-05 13:26:17 +01:00
d82e22d188 Post-festum CRL checking introduced 2016-12-05 13:00:39 +01:00
303350dec0 eap::peer_ttls::end_session() fixed to call method's end_session() method 2016-12-05 12:42:35 +01:00
dd144efa5f New authentication status introduced: server compromised 2016-12-05 12:39:04 +01:00
cb253450a0 Distribution folder changed 2016-11-29 13:01:26 +01:00
168aed3000 Charset issue in version resource fixed 2016-11-18 09:12:35 +01:00
2f5742eb9b Version set to 1.1-beta1 2016-11-18 06:50:34 +01:00
79ff14ddd3 Translation update 2016-11-18 06:24:32 +01:00
b4988187c0 Digital signing of CAB files introduced 2016-11-11 12:44:01 +01:00
97f497bc04 ...3.msi and ...3.mst files renamed to remove ".3" versioning in the name, to simplify their deployment 2016-11-11 12:41:26 +01:00
368de2e865 ...3.msi files are finalized now (marked as final, digitally signed, read-only), as they can be used for GPO deployment 2016-11-11 11:50:16 +01:00
2c842bd2bb Makefile sub-target CleanSetup introduced 2016-11-11 11:42:37 +01:00
e10d14681f en_US MSI files prepared using MSILocal.mak now for more uniform building 2016-11-11 11:38:24 +01:00
444ae3d68d POT files updated to contain 1.1 and 1.0 texts 2016-11-08 11:56:38 +01:00
f72de7b8af Distribution folder changed 2016-11-08 11:36:38 +01:00
22a62ea6e4 Sub-module update 2016-11-08 11:36:16 +01:00
4d4bbe66e7 Version set to 1.1-beta 2016-11-07 14:34:19 +01:00
e8d2e33aac WideCharToMultiByte() and MultiByteToWideChar() optimization 2016-11-07 13:44:40 +01:00
9efb75d66f Documentation update 2016-11-07 12:59:50 +01:00
c053fd75e3 POT update 2016-11-07 12:40:51 +01:00
4ae048fd9f Auditing of CryptProtectData() enabled 2016-11-07 11:06:20 +01:00
3b6d2b2c14 Password and certificate output to log is no longer conditioned by _DEBUG 2016-11-07 10:48:13 +01:00
3a653be368 POT update 2016-11-04 14:13:15 +01:00
10aa7ad3f1 MSI localized files contain and install own resources only now 2016-11-04 14:03:33 +01:00
6ccf96c338 Non-ready localizations deactivated 2016-11-04 14:00:30 +01:00
9ef95a8d64 EventMonitor Doxygen documentation update 2016-11-04 12:53:44 +01:00
6166dd3887 Reported events are more consistent now 2016-11-04 11:51:39 +01:00
d08b70c284 Last result status handling improved 2016-11-04 11:50:58 +01:00
7750ebdb66 MSCHAPv2 server challenge issue fixed 2016-11-04 11:49:01 +01:00
c908e8ecfb EAPMsg branch is mainstream now 2016-11-04 10:06:28 +01:00
1fc2b7ff66 Redundant std::string to const char* conversion in exception constructors cleaned 2016-11-04 09:26:27 +01:00
eea136619c method_pap >> method_pap_diameter 2016-11-04 09:18:16 +01:00
88651e4ffe EAP-MSCHAPv2 support finished 2016-11-04 09:16:43 +01:00
fa3e7c0e6d Issue with passing wrong EAP type packet to tunneled method introduced in 70ce94b84e fixed 2016-11-03 11:22:05 +01:00
a8e1ac7455 Separate configuration for EAP-MSCHAPv2 introduced 2016-11-03 11:13:12 +01:00
48ba0b3664 Typo in documentation fixed 2016-11-03 11:11:54 +01:00
e7e484c814 Support for EapHost based inner methods has been (temporarily) disabled 2016-11-03 10:23:30 +01:00
b87e30bc9d Some final adjustments to EapHost inner method code before I put it to rest because of RasMan MSCHAPv2 heap corruption :( 2016-11-03 10:11:31 +01:00
60aa513375 Aesthetic modifications 2016-11-03 09:33:25 +01:00
a450d02485 Maximum inner method packet length now precisely calculated in begin_session() methods too 2016-11-03 07:55:33 +01:00
70ce94b84e Support for Legacy Nak introduced 2016-11-02 11:36:43 +01:00
fba3619747 eap::method_eapmsg initial testing and issue resolving 2016-11-02 11:04:48 +01:00
d234e55ae4 - Doxygen documentation updated
- Some minor issues stumbled upon fixed
- WIN1250 >> UTF-8
2016-11-02 01:25:38 +01:00
0387d7d593 Orphaned PAP.cpp files removed 2016-11-01 06:37:37 +01:00
b1a0669c40 EventMonitor's wxFormBuilder resources moved to res sub-folder 2016-11-01 05:56:10 +01:00
52a428bb5e Various ownTLS leftover clean-up 2016-11-01 05:33:55 +01:00
655cbe70d1 EapHostPeerInvokeIdentityUI() call fixed 2016-10-31 17:17:21 +01:00
c31e019cef eap::metod thorough redesign:
- Support for method stacking introduced
- EAP-TLS method has been discontinued
- ownTLS has been discontinued
2016-10-31 16:58:53 +01:00
b054dcdc7a eap::diameter_avp_append() set of functions introduced 2016-10-31 16:28:38 +01:00
0d8f243d31 eap::module::make_error() extended to support EAP_ERROR duplication 2016-10-31 16:23:42 +01:00
96d5b95b6f Doxygen documentation update 2016-10-31 16:22:45 +01:00
af56825d39 Code clean-up 2016-10-28 13:50:30 +02:00
f5a40f7ca8 Doxygen update 2016-10-28 13:47:59 +02:00
6f30239ada method_eaphost is no longer method_noneap child but correctly a method child 2016-10-27 14:13:02 +02:00
55f160bce3 Code clean-up 2016-10-27 13:59:08 +02:00
654c965851 Support for various peer action request extended 2016-10-27 10:00:18 +02:00
fc008bcfb4 Unable to set blank certificate credentials issue fixed 2016-10-25 14:13:12 +02:00
ddd83a74e5 eap::credentials_eaphost now complete 2016-10-25 13:39:54 +02:00
d87b3d37e5 Discrete output of credentials to event log centralized 2016-10-25 13:37:39 +02:00
04af17121c Redundant eap::credentials_eaphost::get_identity() removed 2016-10-25 13:34:21 +02:00
aa18aed868 Zero-length event property data retrieval fixed 2016-10-25 13:33:13 +02:00
7d1668e2e0 Configuration value logging replaced with array variant instead of varadic event_provider::write() method for performance reasons 2016-10-25 13:04:12 +02:00
1d302954e3 event_data::blank redefined to prevent confusion with NULL values causing premature varadic argument termination leading to incomplete event data 2016-10-25 13:01:56 +02:00
dd55dfd24d eap::config_method_eaphost::get_method_str() finished 2016-10-25 11:06:11 +02:00
65ea47eb4e EAPMsg >> EapHost 2016-10-25 08:51:13 +02:00
abf54ad342 Doxygen documentation update 2016-10-25 08:51:04 +02:00
2041accecb EAP-Message integration continues... 2016-10-24 15:08:25 +02:00
e7e1a6735d pEapOutput Prefast specifier for process_request_packet() methods changed 2016-10-24 14:55:31 +02:00
2c91b6ca8c pEapOutput Prefast specifier for set_response_attributes() methods changed 2016-10-24 14:42:56 +02:00
45ce38916b eap_error_runtime introduced 2016-10-24 14:13:27 +02:00
131e19df88 new wxExtend library version 2016-10-24 14:12:24 +02:00
0d73e2f7a2 Incorrect pEapOutput in method::set_ui_context() methods fixed 2016-10-24 14:11:15 +02:00
a1f9a7bab9 ppResult >> pResult 2016-10-24 13:33:01 +02:00
6f90cfaf99 Sub-module update 2016-10-18 14:29:16 +02:00
2cf134db1e Incorrect string template fixed 2016-10-17 16:39:23 +02:00
7557bf784a Excessive c_str() removed 2016-10-17 16:37:27 +02:00
68c2c05b41 wxEAPGetProviderName() output fixed 2016-10-17 16:15:26 +02:00
de2506bcc4 Unified credential TTLS prompt replaced with separate prompts for identity provider, outer credentials and inner credentials
EapHost peers provide credential dialogs only and cannot be integrated into unified credential prompt as a panel, requiring additional clicking and pop-ups for user to enter credentials.
2016-10-17 16:05:36 +02:00
ee94756655 Missing type-cast preventing correct CA certificate file import fixed
(broken in 559ffc5ead)
2016-10-17 14:04:21 +02:00
af2d0fde1f Missing credentials BLOB sanitizing added 2016-10-17 13:18:54 +02:00
31f4ec4b93 Bulgarian translation included in final MSI 2016-10-17 10:32:07 +02:00
ec238001cd Merge branch 'master' of https://github.com/Amebis/GEANTLink 2016-10-17 10:31:57 +02:00
f42c7f8bb5 Localization update 2016-10-17 10:31:13 +02:00
bafbdec9d3 User interaction and EAP response attributes management delegated to eap::method 2016-10-14 10:34:14 +02:00
3f75ef83bb Non-saving inner method configuration issue fixed 2016-10-14 10:29:14 +02:00
6d4802a06f Sub-module update 2016-10-14 10:11:36 +02:00
2e38f79a6e Localization and compilation separated, as satisfied Localization target skipped building 2016-10-11 11:32:22 +02:00
6b7a1966e3 Norwegian Bokmål translations added to MSI 2016-10-10 17:40:58 +02:00
3606a8d25d Catalan translations added to MSI 2016-10-10 17:40:57 +02:00
6be4fddcd7 Translation updated 2016-10-10 17:40:57 +02:00
7a26128c7b "auto" simplified 2016-10-10 15:00:10 +02:00
f9697dfcee Loading EAPMsg credentials from Windows Credential Manager temporarily commented 2016-10-10 14:54:22 +02:00
e40ee1c34b Missing EapHost peer initialization added 2016-10-10 14:31:32 +02:00
e94e3bdd60 credentials::combine() methods updated with support for EAPMsg:
- Additional parameters
- Additional result code
- User impersonation now mounted inside of credentials::combine() when required
2016-10-10 14:31:23 +02:00
c660e2b3e6 config_method_with_cred::make_credentials() method moved to parent class config_method for seamless EAPMsg method support 2016-10-10 13:20:08 +02:00
864105186b Serbian translation added to MSI
(Except from MSI setup, UI is completely translated to Serbian now)
2016-10-10 10:19:31 +02:00
028742d7e6 Translations update 2016-10-10 10:19:31 +02:00
5d891c9581 Sub-module update 2016-10-07 15:38:32 +02:00
e4758faba3 Host name and FQDN validators moved to wxExtend; Incorrect FeatureComponent mappings of EventMonitor localization components fixed 2016-10-07 15:28:47 +02:00
9aacbb2fef Sub-module update 2016-10-07 12:38:04 +02:00
5c966f35a8 wxInitializeLocale moved to wxExtend 2016-10-05 12:11:17 +02:00
a2830d2aee EAPMsg profile configuration XML load/save support added 2016-10-04 12:35:32 +02:00
ce05418d8e Both XML selection namespaces (eap-metadata and eaphostconfig) are configured now 2016-10-04 12:33:43 +02:00
583fc19da7 config_method_ttls::make_config_method() method modified to support EAPMsg 2016-10-04 12:12:46 +02:00
597095b536 Support for packing and unpacking of config_method_eapmsg added 2016-10-04 11:23:12 +02:00
5dad353d98 winstd::eap_runtime_error exception introduced 2016-10-04 11:21:40 +02:00
dab9e69dd3 Inner EAP method support progress continues... 2016-10-04 10:32:11 +02:00
2bc6d97ab0 m_cred >> m_cred_blob 2016-10-04 10:30:37 +02:00
2f49934a92 Some more C casting replaced with C++ dynamic casting 2016-10-04 10:20:01 +02:00
e8eec11618 EAP-TTLS inner method no longer needs to have support for configured credentials 2016-10-04 10:13:45 +02:00
03d6823241 Some more C casting replaced with C++ dynamic casting 2016-10-04 09:16:14 +02:00
5a36eb0d23 Documentation update 2016-10-04 09:04:09 +02:00
7d13222838 Inner EAP method support progress continues... 2016-10-03 15:48:54 +02:00
c53ed21d55 Code clean-up 2016-10-03 14:54:02 +02:00
10c03ccedb 1.5.2 False positives from security audit resolved 2016-10-03 14:54:02 +02:00
01245d15d9 ID 8. A typo in the comment from security audit resolved 2016-10-03 14:54:02 +02:00
ff4e8c6885 ID 7. Commented out parts of the code from security audit partially resolved 2016-10-03 14:54:02 +02:00
111ede456e ID 5. Unused variables from security audit partially fixed 2016-10-03 14:54:01 +02:00
f0af016efe ID 4. Possibility of method_tls class initialization list optimization from security audit fixed 2016-10-03 14:54:01 +02:00
559ffc5ead ID 3. C style pointer casting from security audit fixed 2016-10-03 14:53:50 +02:00
28408fcea7 ID 2. Missing functionality from security audit report partially fixed 2016-10-03 14:52:57 +02:00
7924612419 ID 1. Variables shadowing from security audit report fixed 2016-10-03 14:52:44 +02:00
c1a483a0bd Version set to 1.0-beta7 2016-10-03 14:52:12 +02:00
b34aee8493 Translation update 2016-10-03 14:52:01 +02:00
a1455078e9 Explicit server certificate check introduced 2016-10-03 14:51:45 +02:00
a834fbcb7c Inner EAP method support progress continues... 2016-09-30 15:22:12 +02:00
13d84c3c4d Various events are propagated to parent classes now 2016-09-30 11:00:23 +02:00
1d4a77b96b Remove CA button enable/disable logic fixed after CA list box switched to single selection in c371187edc commit 2016-09-30 11:00:14 +02:00
7a379a1a87 OnInitDialog events are propagated to parent classes now 2016-09-30 11:00:02 +02:00
7d986b82d8 OnUpdateUI events are propagated to parent classes now 2016-09-30 09:58:00 +02:00
2bc43869b0 Revert "Switching inner authentication method re-layouts configuration dialog now"
This reverts commit 67003bd478.
2016-09-29 15:33:37 +02:00
caf80e07f9 Switching inner authentication method re-layouts configuration dialog now 2016-09-29 14:48:12 +02:00
0d1bcbf9c4 Localization and compilation separated, as satisfied Localization target skipped building 2016-09-29 14:47:58 +02:00
9ea80712d9 EAPMsg integration 2016-09-29 14:39:39 +02:00
613117775d Initial versions of EAPMsg libraries 2016-09-29 14:07:52 +02:00
198 changed files with 13451 additions and 7864 deletions

View File

@@ -30,26 +30,26 @@
<ProjectGuid>{2D3CE079-7EB1-4F47-B79E-F0310671ECCB}</ProjectGuid> <ProjectGuid>{2D3CE079-7EB1-4F47-B79E-F0310671ECCB}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>CredWrite</RootNamespace> <RootNamespace>CredWrite</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -57,21 +57,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -156,7 +156,7 @@
<ProjectReference Include="..\lib\TLS\build\TLS.vcxproj"> <ProjectReference Include="..\lib\TLS\build\TLS.vcxproj">
<Project>{4d40cb8a-812e-4f12-b23a-31af743878e8}</Project> <Project>{4d40cb8a-812e-4f12-b23a-31af743878e8}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -116,7 +116,8 @@ static int CredWrite()
} }
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) _Use_decl_annotations_
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{ {
UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine); UNREFERENCED_PARAMETER(lpCmdLine);

View File

@@ -1,7 +1,9 @@
# CredWrite # CredWrite
Imports given credentials to Windows Credential Manager for GÉANTLink use Imports given credentials to Windows Credential Manager for GÉANTLink use
## Usage ## Usage
``` ```
CredWrite <username> <password> [<realm> [level]] CredWrite <username> <password> [<realm> [level]]
``` ```
@@ -13,8 +15,15 @@ CredWrite <username> <password> [<realm> [level]]
The credentials are stored to Windows Credential Manager in invoking user's roaming profile. The credentials are stored to Windows Credential Manager in invoking user's roaming profile.
Return codes: ### Return codes
- -1 = Invalid parameters - -1 = Invalid parameters
- 0 = Success - 0 = Success
- 1 = Error parsing command line - 1 = Error parsing command line
- 2 = Error encrypting password or writing credentials - 2 = Error encrypting password or writing credentials
### Example
```
CredWrite dXNlckBjb250b3NvLmNvbQ== cGFzc3dvcmQxMjM= urn:RFC4282:realm:contoso.com 1
```

View File

@@ -29,6 +29,7 @@
#include <Windows.h> #include <Windows.h>
#include <eaptypes.h> // Must include after <Windows.h> #include <eaptypes.h> // Must include after <Windows.h>
#include <shellapi.h>
#include <tchar.h> #include <tchar.h>
#include <memory> #include <memory>

View File

@@ -794,6 +794,7 @@ EXCLUDE = \
EventMonitor\res \ EventMonitor\res \
lib\EAPBase_UI\res \ lib\EAPBase_UI\res \
lib\EapHost_UI\res \ lib\EapHost_UI\res \
lib\GTC_UI\res \
lib\TLS_UI\res \ lib\TLS_UI\res \
lib\TTLS_UI\res \ lib\TTLS_UI\res \
lib\WinStd \ lib\WinStd \

View File

@@ -29,26 +29,26 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{331B6077-E3E2-4867-B93E-9D3F57280DE7}</ProjectGuid> <ProjectGuid>{331B6077-E3E2-4867-B93E-9D3F57280DE7}</ProjectGuid>
<RootNamespace>EAPTTLS</RootNamespace> <RootNamespace>EAPTTLS</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -56,21 +56,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -141,9 +141,15 @@
<ProjectReference Include="..\..\lib\EAPBase\build\EAPBase.vcxproj"> <ProjectReference Include="..\..\lib\EAPBase\build\EAPBase.vcxproj">
<Project>{ad6816a0-9600-4e01-8c49-39d03d1e791f}</Project> <Project>{ad6816a0-9600-4e01-8c49-39d03d1e791f}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\EapHost\build\EapHost.vcxproj">
<Project>{b385ec2b-c3f4-48bb-9bac-8b996de7f754}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj"> <ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project> <Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\GTC\build\GTC.vcxproj">
<Project>{114a70bb-8698-4a0c-8c90-58f22edd8129}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj"> <ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj">
<Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project> <Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project>
</ProjectReference> </ProjectReference>
@@ -156,7 +162,7 @@
<ProjectReference Include="..\..\lib\TTLS\build\TTLS.vcxproj"> <ProjectReference Include="..\..\lib\TTLS\build\TTLS.vcxproj">
<Project>{ee0ef0d9-a475-4038-8637-5754724f65b0}</Project> <Project>{ee0ef0d9-a475-4038-8637-5754724f65b0}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -29,26 +29,26 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{DD7A97CA-F18E-43B7-95C4-D06E6A291624}</ProjectGuid> <ProjectGuid>{DD7A97CA-F18E-43B7-95C4-D06E6A291624}</ProjectGuid>
<RootNamespace>EAPTTLSUI</RootNamespace> <RootNamespace>EAPTTLSUI</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -56,21 +56,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -144,9 +144,21 @@
<ProjectReference Include="..\..\lib\EAPBase_UI\build\EAPBase_UI.vcxproj"> <ProjectReference Include="..\..\lib\EAPBase_UI\build\EAPBase_UI.vcxproj">
<Project>{d4b54856-be1f-4937-a8f7-495125be76be}</Project> <Project>{d4b54856-be1f-4937-a8f7-495125be76be}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\EapHost\build\EapHost.vcxproj">
<Project>{b385ec2b-c3f4-48bb-9bac-8b996de7f754}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\EapHost_UI\build\EapHost_UI.vcxproj">
<Project>{13d2d8b5-f6aa-459d-b5f7-29b95dd9d583}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj"> <ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project> <Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\GTC\build\GTC.vcxproj">
<Project>{114a70bb-8698-4a0c-8c90-58f22edd8129}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\GTC_UI\build\GTC_UI.vcxproj">
<Project>{34680813-3a52-46fb-b5a8-1e4bbf770855}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj"> <ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj">
<Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project> <Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project>
</ProjectReference> </ProjectReference>
@@ -171,10 +183,10 @@
<ProjectReference Include="..\..\lib\TTLS_UI\build\TTLS_UI.vcxproj"> <ProjectReference Include="..\..\lib\TTLS_UI\build\TTLS_UI.vcxproj">
<Project>{42f0f0f4-c928-4860-a4e4-94991c2c3d90}</Project> <Project>{42f0f0f4-c928-4860-a4e4-94991c2c3d90}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\lib\wxExtend\build\wxExtendLib-15.0.vcxproj"> <ProjectReference Include="..\..\lib\wxExtend\build\wxExtendLib-16.0.vcxproj">
<Project>{d3e29951-d9f5-486d-a167-20ae8e90b1fa}</Project> <Project>{d3e29951-d9f5-486d-a167-20ae8e90b1fa}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

File diff suppressed because it is too large Load Diff

View File

@@ -903,7 +903,7 @@ msgstr "Използвай &празна външна самоличност"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Пропусни моето потребителско име и използвай само @mydomain.org" msgstr "Пропусни моето потребителско име и използвай само @mydomain.org"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -1,6 +1,7 @@
# Translators: # Translators:
# eduki <ecercos@xtec.cat>, 2017
# Simon Rozman <simon@rozman.si>, 2018 # Simon Rozman <simon@rozman.si>, 2018
# eduki <ecercos@xtec.cat>, 2018
# jmontane, 2019
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -8,7 +9,7 @@ msgstr ""
"Project-Id-Version: EAPMethods\n" "Project-Id-Version: EAPMethods\n"
"POT-Creation-Date: 2018-06-20 15:30+0200\n" "POT-Creation-Date: 2018-06-20 15:30+0200\n"
"PO-Revision-Date: 2016-08-25 06:18+0000\n" "PO-Revision-Date: 2016-08-25 06:18+0000\n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n" "Last-Translator: jmontane, 2019\n"
"Language-Team: Catalan (Spain) (https://www.transifex.com/eduroam_devel/teams/11799/ca_ES/)\n" "Language-Team: Catalan (Spain) (https://www.transifex.com/eduroam_devel/teams/11799/ca_ES/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -116,13 +117,13 @@ msgstr "Ha fallat l'esborrat de credencials (error %u)."
#: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:854 #: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:854
#, c-format #, c-format
msgid "(error %u)" msgid "(error %u)"
msgstr "" msgstr "(error %u)"
#: master/lib/EAPBase_UI/include/EAP_UI.h:859 #: master/lib/EAPBase_UI/include/EAP_UI.h:859
#: ver1.0/lib/EAPBase_UI/include/EAP_UI.h:792 #: ver1.0/lib/EAPBase_UI/include/EAP_UI.h:792
#: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:858 #: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:858
msgid "(error)" msgid "(error)"
msgstr "" msgstr "(error)"
#: master/lib/EAPBase_UI/include/EAP_UI.h:870 #: master/lib/EAPBase_UI/include/EAP_UI.h:870
#: master/lib/EAPBase_UI/include/EAP_UI.h:879 #: master/lib/EAPBase_UI/include/EAP_UI.h:879
@@ -143,7 +144,7 @@ msgstr "(buit)"
#: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:869 #: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:869
#: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:878 #: ver1.1/lib/EAPBase_UI/include/EAP_UI.h:878
msgid "(blank ID)" msgid "(blank ID)"
msgstr "" msgstr "(ID buit)"
#: master/lib/EAPBase_UI/include/EAP_UI.h:919 #: master/lib/EAPBase_UI/include/EAP_UI.h:919
#: ver1.0/lib/EAPBase_UI/include/EAP_UI.h:854 #: ver1.0/lib/EAPBase_UI/include/EAP_UI.h:854
@@ -173,7 +174,7 @@ msgstr "+"
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:38 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:38
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:38 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:38
msgid "Adds new provider" msgid "Adds new provider"
msgstr "Afegir nou proveidor" msgstr "Afegeix un proveïdor nou"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:42 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:42
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:42 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:42
@@ -185,7 +186,7 @@ msgstr "-"
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:43 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:43
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:43 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:43
msgid "Removes selected provider" msgid "Removes selected provider"
msgstr "Esborrar proveidor seleccionat" msgstr "Esborra el proveïdor seleccionat"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:47 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:47
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:47 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:47
@@ -242,7 +243,7 @@ msgstr ""
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:272 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:272
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:272 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:272
msgid "&Clear Credentials" msgid "&Clear Credentials"
msgstr "&Esborrar Credencials" msgstr "&Esborra les credencials"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:273 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:273
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:273 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:273
@@ -261,7 +262,7 @@ msgstr ""
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:277 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:277
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:316 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:316
msgid "&Set Credentials..." msgid "&Set Credentials..."
msgstr "&Desar Credencials..." msgstr "&Desa les credencials..."
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:278 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:278
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:317 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:317
@@ -304,7 +305,7 @@ msgstr "ID d'usuari i contrasenya"
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:369 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:369
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:369 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:369
msgid "Please provide your user ID and password." msgid "Please provide your user ID and password."
msgstr "Sisplau introduiu el vostre ID d'usuari i contrasenya" msgstr "Introduïu el vostre ID d'usuari i contrasenya"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:379 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:379
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:443 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:443
@@ -319,7 +320,7 @@ msgstr "ID d'usuari:"
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:384 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:384
msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)" msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)"
msgstr "" msgstr ""
"Introduiu el vostre identificador aquí (identificador@domini.org, " "Introduïu el vostre identificador aquí (identificador@domini.org, "
"DOMINI\\identificador, etc.)" "DOMINI\\identificador, etc.)"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:388 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:388
@@ -332,7 +333,7 @@ msgstr "Contrasenya:"
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:393 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:393
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:393 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:393
msgid "Enter your password here" msgid "Enter your password here"
msgstr "Introduiu la vostra contrasenya aquí" msgstr "Introduïu la vostra contrasenya aquí"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:423 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:423
msgid "User ID" msgid "User ID"
@@ -340,7 +341,7 @@ msgstr "ID d'usuari"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:433 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:433
msgid "Please provide your user ID." msgid "Please provide your user ID."
msgstr "Sisplau introduïu el vostre ID." msgstr "Introduïu el vostre ID."
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:473 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:473
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:424 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:424
@@ -377,7 +378,7 @@ msgstr ""
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:451 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:451
#: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:451 #: ver1.1/lib/EAPBase_UI/res/wxEAP_UI.cpp:451
msgid "(Keep it short, please)" msgid "(Keep it short, please)"
msgstr "(Sigueu breus, sisplau)" msgstr "(Sigueu breu)"
#: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:510 #: master/lib/EAPBase_UI/res/wxEAP_UI.cpp:510
#: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:461 #: ver1.0/lib/EAPBase_UI/res/wxEAP_UI.cpp:461
@@ -618,8 +619,7 @@ msgstr ""
#: ver1.0/lib/EAPBase_UI/src/EAP_UI.cpp:283 #: ver1.0/lib/EAPBase_UI/src/EAP_UI.cpp:283
#: ver1.1/lib/EAPBase_UI/src/EAP_UI.cpp:251 #: ver1.1/lib/EAPBase_UI/src/EAP_UI.cpp:251
msgid "Please, reconsider necessity to enter your credentials." msgid "Please, reconsider necessity to enter your credentials."
msgstr "" msgstr "Reconsidereu la necessitat d'introduir les vostres credencials."
"Sisplau, reconsidereu la necessitat d'introduir les vostres credencials."
#: master/lib/EapHost_UI/res/wxEapHost_UI.cpp:17 #: master/lib/EapHost_UI/res/wxEapHost_UI.cpp:17
#: ver1.1/lib/EapHost_UI/res/wxEapHost_UI.cpp:17 #: ver1.1/lib/EapHost_UI/res/wxEapHost_UI.cpp:17
@@ -667,11 +667,11 @@ msgstr "Repte GTC"
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:26 #: master/lib/GTC_UI/res/wxGTC_UI.cpp:26
msgid "Please provide your response." msgid "Please provide your response."
msgstr "Faciliteu sisplau la vostra resposta." msgstr "Indiqueu la vostra resposta."
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:38 #: master/lib/GTC_UI/res/wxGTC_UI.cpp:38
msgid "Server challenge" msgid "Server challenge"
msgstr "Repte del Servidor" msgstr "Repte del servidor"
#: master/lib/GTC_UI/res/wxGTC_UI.cpp:43 #: master/lib/GTC_UI/res/wxGTC_UI.cpp:43
msgid "Enter your response here" msgid "Enter your response here"
@@ -752,7 +752,7 @@ msgstr ""
#: master/lib/TLS_UI/res/wxTLS_UI.cpp:52 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:52 #: master/lib/TLS_UI/res/wxTLS_UI.cpp:52 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:52
#: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:52 #: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:52
msgid "Add CA from File..." msgid "Add CA from File..."
msgstr "Afegir CA des d'un fitxer..." msgstr "Afegeix CA des d'un fitxer..."
#: master/lib/TLS_UI/res/wxTLS_UI.cpp:53 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:53 #: master/lib/TLS_UI/res/wxTLS_UI.cpp:53 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:53
#: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:53 #: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:53
@@ -762,7 +762,7 @@ msgstr "Afegeix una nova autoritat de certificació des de d'un arxiu"
#: master/lib/TLS_UI/res/wxTLS_UI.cpp:57 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:57 #: master/lib/TLS_UI/res/wxTLS_UI.cpp:57 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:57
#: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:57 #: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:57
msgid "&Remove CA" msgid "&Remove CA"
msgstr "&Eliminar CA" msgstr "&Elimina CA"
#: master/lib/TLS_UI/res/wxTLS_UI.cpp:58 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:58 #: master/lib/TLS_UI/res/wxTLS_UI.cpp:58 ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:58
#: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:58 #: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:58
@@ -810,7 +810,7 @@ msgstr "Certificat de client per a l'autenticació"
#: ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:142 #: ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:142
#: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:142 #: ver1.1/lib/TLS_UI/res/wxTLS_UI.cpp:142
msgid "Custom &identity:" msgid "Custom &identity:"
msgstr "Personalitzar la &identitat:" msgstr "Personalitza la &identitat:"
#: master/lib/TLS_UI/res/wxTLS_UI.cpp:147 #: master/lib/TLS_UI/res/wxTLS_UI.cpp:147
#: ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:147 #: ver1.0/lib/TLS_UI/res/wxTLS_UI.cpp:147
@@ -825,7 +825,7 @@ msgstr ""
#: master/lib/TLS_UI/src/TLS_UI.cpp:252 ver1.0/lib/TLS_UI/src/TLS_UI.cpp:246 #: master/lib/TLS_UI/src/TLS_UI.cpp:252 ver1.0/lib/TLS_UI/src/TLS_UI.cpp:246
#: ver1.1/lib/TLS_UI/src/TLS_UI.cpp:252 #: ver1.1/lib/TLS_UI/src/TLS_UI.cpp:252
msgid "Add Certificate" msgid "Add Certificate"
msgstr "Afegir Certificat" msgstr "Afegeix un certificat"
#: master/lib/TLS_UI/src/TLS_UI.cpp:253 ver1.0/lib/TLS_UI/src/TLS_UI.cpp:247 #: master/lib/TLS_UI/src/TLS_UI.cpp:253 ver1.0/lib/TLS_UI/src/TLS_UI.cpp:247
#: ver1.1/lib/TLS_UI/src/TLS_UI.cpp:253 #: ver1.1/lib/TLS_UI/src/TLS_UI.cpp:253
@@ -892,7 +892,7 @@ msgstr "Utilitza una identitat externa &buida"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Omet el meu identificador i utilitza només @elmeudomini.org" msgstr "Omet el meu identificador i utilitza només @elmeudomini.org"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -847,7 +847,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -897,7 +897,7 @@ msgstr "Leeren N&utzernamen verwenden"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
"Im unverschlüsselten Teil den Nutzernamen weglassen und nur den @domain Teil" "Im unverschlüsselten Teil den Nutzernamen weglassen und nur den @domain Teil"
" senden" " senden"

View File

@@ -907,7 +907,7 @@ msgstr "Χρησιμοποιήστε &κενή εξωτερική ταυτότη
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
"Παραλείψτε το όνομα χρήστη μου και χρησιμοποιήστε μόνο το @mydomain.org" "Παραλείψτε το όνομα χρήστη μου και χρησιμοποιήστε μόνο το @mydomain.org"

View File

@@ -901,7 +901,7 @@ msgstr "Usar una identidad externa &vacía"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Omitir mi nombre de usuario y usar @midominio.org sólo" msgstr "Omitir mi nombre de usuario y usar @midominio.org sólo"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -1,7 +1,7 @@
# Translators: # Translators:
# Simon Rozman <simon@rozman.si>, 2018 # Simon Rozman <simon@rozman.si>, 2018
# Indrek Rokk <indrek.rokk@eenet.ee>, 2018 # Indrek Rokk <indrek.rokk@eenet.ee>, 2018
# Anne M <anne@eenet.ee>, 2018 # Anne M <anne@eenet.ee>, 2019
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: EAPMethods\n" "Project-Id-Version: EAPMethods\n"
"POT-Creation-Date: 2018-06-20 15:30+0200\n" "POT-Creation-Date: 2018-06-20 15:30+0200\n"
"PO-Revision-Date: 2016-08-25 06:18+0000\n" "PO-Revision-Date: 2016-08-25 06:18+0000\n"
"Last-Translator: Anne M <anne@eenet.ee>, 2018\n" "Last-Translator: Anne M <anne@eenet.ee>, 2019\n"
"Language-Team: Estonian (https://www.transifex.com/eduroam_devel/teams/11799/et/)\n" "Language-Team: Estonian (https://www.transifex.com/eduroam_devel/teams/11799/et/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -94,7 +94,7 @@ msgstr "%s kasutajakonto andmed"
#, c-format #, c-format
msgid "Error writing credentials to Credential Manager: %hs (error %u)" msgid "Error writing credentials to Credential Manager: %hs (error %u)"
msgstr "" msgstr ""
"Viga kasutajakonto andmete kirjustamisel kasutajakonto halduris (Credential " "Viga kasutajakonto andmete kirjutamisel kasutajakonto halduris (Credential "
"Manager): %hs (viga %u)" "Manager): %hs (viga %u)"
#: master/lib/EAPBase_UI/include/EAP_UI.h:796 #: master/lib/EAPBase_UI/include/EAP_UI.h:796
@@ -888,7 +888,7 @@ msgstr "Kasuta t&ühja välist identiteeti"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Jäta mu kasutajanimi ära ja kasuta ainult @minudomeeni" msgstr "Jäta mu kasutajanimi ära ja kasuta ainult @minudomeeni"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -883,7 +883,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
"Koristi samo @mojadomena.hr (ovo nije podržano za korisnike iz sustava " "Koristi samo @mojadomena.hr (ovo nije podržano za korisnike iz sustava "
"AAI@EduHr)" "AAI@EduHr)"

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -895,7 +895,7 @@ msgstr "Usa una identità esterna &vuota"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Ometti il mio nome utente e usa solo @mydomain.org" msgstr "Ometti il mio nome utente e usa solo @mydomain.org"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -847,7 +847,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -882,7 +882,7 @@ msgstr "Naudoti &tuščią išorinę tapatybę"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Praleisti mano naudotojo vardą ir naudoti tik @domenas.lt" msgstr "Praleisti mano naudotojo vardą ir naudoti tik @domenas.lt"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -885,7 +885,7 @@ msgstr "Bruk &tom ytre identitet"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Utelat mitt brukernavn og bruk kun @mydomian.org" msgstr "Utelat mitt brukernavn og bruk kun @mydomian.org"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -894,7 +894,7 @@ msgstr "Użyj &pustego identyfikatora zewnętrznego"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Pomiń mój identyfikator i użyj tylko @mydomain.org" msgstr "Pomiń mój identyfikator i użyj tylko @mydomain.org"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -847,7 +847,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -882,7 +882,7 @@ msgstr "Uporabi prazno zunanjo id&entiteto"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Izpusti moje uporabniško ime in uporabi samo @mojadomena.si" msgstr "Izpusti moje uporabniško ime in uporabi samo @mojadomena.si"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -896,7 +896,7 @@ msgstr "Koristi &empty spoljni identitet"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "Izostavi korisničko ime i koristi samo @mojdomen.ac.rs" msgstr "Izostavi korisničko ime i koristi samo @mojdomen.ac.rs"
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -848,7 +848,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

View File

@@ -846,7 +846,7 @@ msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.0/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
#: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41 #: ver1.1/lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only" msgid "Omit my user name and use @mydomain.org only"
msgstr "" msgstr ""
#: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48 #: master/lib/TTLS_UI/res/wxTTLS_UI.cpp:48

File diff suppressed because it is too large Load Diff

View File

@@ -76,7 +76,8 @@ BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID l
/// ///
/// \sa [EapPeerFreeMemory function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363606.aspx) /// \sa [EapPeerFreeMemory function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363606.aspx)
/// ///
VOID WINAPI EapPeerFreeMemory(_In_ void *pUIContextData) _Use_decl_annotations_
VOID WINAPI EapPeerFreeMemory(void *pUIContextData)
{ {
event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__)); event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__));
@@ -90,7 +91,8 @@ VOID WINAPI EapPeerFreeMemory(_In_ void *pUIContextData)
/// ///
/// \sa [EapPeerFreeErrorMemory function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363605.aspx) /// \sa [EapPeerFreeErrorMemory function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363605.aspx)
/// ///
VOID WINAPI EapPeerFreeErrorMemory(_In_ EAP_ERROR *ppEapError) _Use_decl_annotations_
VOID WINAPI EapPeerFreeErrorMemory(EAP_ERROR *ppEapError)
{ {
event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__)); event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__));
@@ -104,13 +106,14 @@ VOID WINAPI EapPeerFreeErrorMemory(_In_ EAP_ERROR *ppEapError)
/// ///
/// \sa [EapPeerConfigXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363602.aspx) /// \sa [EapPeerConfigXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363602.aspx)
/// ///
_Use_decl_annotations_
DWORD WINAPI EapPeerConfigXml2Blob( DWORD WINAPI EapPeerConfigXml2Blob(
_In_ DWORD dwFlags, DWORD dwFlags,
_In_ EAP_METHOD_TYPE eapMethodType, EAP_METHOD_TYPE eapMethodType,
_In_ IXMLDOMDocument2 *pConfigDoc, IXMLDOMDocument2 *pConfigDoc,
_Out_ BYTE **pConnectionDataOut, BYTE **pConnectionDataOut,
_Out_ DWORD *pdwConnectionDataOutSize, DWORD *pdwConnectionDataOutSize,
_Out_ EAP_ERROR **ppEapError) EAP_ERROR **ppEapError)
{ {
DWORD dwResult = ERROR_SUCCESS; DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult)); event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
@@ -118,42 +121,35 @@ DWORD WINAPI EapPeerConfigXml2Blob(
//Sleep(10000); //Sleep(10000);
#endif #endif
// Initialize output parameters.
if (pConnectionDataOut)
*pConnectionDataOut = NULL;
if (pdwConnectionDataOutSize)
*pdwConnectionDataOutSize = 0;
if (ppEapError)
*ppEapError = NULL;
// Parameter check // Parameter check
if (!ppEapError) if (eapMethodType.eapType.type != EAPMETHOD_TYPE || eapMethodType.dwAuthorId != 67532)
return dwResult = ERROR_NOT_SUPPORTED;
if (!pConfigDoc || !pConnectionDataOut || !pdwConnectionDataOutSize)
return dwResult = ERROR_INVALID_PARAMETER; return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError); // Configure XML selection namespaces used.
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
if (eapMethodType.eapType.type != EAPMETHOD_TYPE) // <Config>
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Input EAP type (%d) does not match the supported EAP type (%d)."), (int)eapMethodType.eapType.type, (int)EAPMETHOD_TYPE).c_str())); com_obj<IXMLDOMElement> pXmlElConfig;
else if (eapMethodType.dwAuthorId != 67532) if (FAILED(eapxml::select_element(pConfigDoc, bstr(L"//eaphostconfig:Config"), pXmlElConfig)))
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)eapMethodType.dwAuthorId, (int)67532).c_str())); return dwResult = g_peer.log_error(ppEapError, ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" Error reading <Config> element."));
else if (!pConfigDoc)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConfigDoc is NULL.")));
else if (!pConnectionDataOut)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionDataOut is NULL.")));
else if (!pdwConnectionDataOutSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwConnectionDataOutSize is NULL.")));
else {
// Configure XML selection namespaces used.
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
// <Config> // Load configuration.
com_obj<IXMLDOMElement> pXmlElConfig; try {
if (FAILED(eapxml::select_element(pConfigDoc, bstr(L"//eaphostconfig:Config"), pXmlElConfig))) { g_peer.config_xml2blob(dwFlags, pXmlElConfig, pConnectionDataOut, pdwConnectionDataOutSize);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" Error reading <Config> element."))); } catch (std::exception &err) {
return dwResult; dwResult = g_peer.log_error(ppEapError, err);
} } catch (...) {
dwResult = ERROR_INVALID_DATA;
// Load configuration.
try {
g_peer.config_xml2blob(dwFlags, pXmlElConfig, pConnectionDataOut, pdwConnectionDataOutSize);
} catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(err));
dwResult = (*ppEapError)->dwWinError;
} catch (...) {
dwResult = ERROR_INVALID_DATA;
}
} }
return dwResult; return dwResult;
@@ -167,13 +163,14 @@ DWORD WINAPI EapPeerConfigXml2Blob(
/// ///
/// \sa [EapPeerConfigBlob2Xml function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363601.aspx) /// \sa [EapPeerConfigBlob2Xml function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363601.aspx)
/// ///
_Use_decl_annotations_
DWORD WINAPI EapPeerConfigBlob2Xml( DWORD WINAPI EapPeerConfigBlob2Xml(
_In_ DWORD dwFlags, DWORD dwFlags,
_In_ EAP_METHOD_TYPE eapMethodType, EAP_METHOD_TYPE eapMethodType,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, const BYTE *pConnectionData,
_In_ DWORD dwConnectionDataSize, DWORD dwConnectionDataSize,
_Out_ IXMLDOMDocument2 **ppConfigDoc, IXMLDOMDocument2 **ppConfigDoc,
_Out_ EAP_ERROR **ppEapError) EAP_ERROR **ppEapError)
{ {
DWORD dwResult = ERROR_SUCCESS; DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult)); event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
@@ -181,67 +178,54 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
//Sleep(10000); //Sleep(10000);
#endif #endif
// Initialize output parameters.
if (ppConfigDoc)
*ppConfigDoc = NULL;
if (ppEapError)
*ppEapError = NULL;
// Parameter check // Parameter check
if (!ppEapError) if (eapMethodType.eapType.type != EAPMETHOD_TYPE || eapMethodType.dwAuthorId != 67532)
return dwResult = ERROR_NOT_SUPPORTED;
if (!pConnectionData && dwConnectionDataSize || !ppConfigDoc)
return dwResult = ERROR_INVALID_PARAMETER; return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError); HRESULT hr;
if (eapMethodType.eapType.type != EAPMETHOD_TYPE) // Create configuration XML document.
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Input EAP type (%d) does not match the supported EAP type (%d)."), (int)eapMethodType.eapType.type, (int)EAPMETHOD_TYPE).c_str())); com_obj<IXMLDOMDocument2> pConfigDoc;
else if (eapMethodType.dwAuthorId != 67532) if (FAILED(hr = pConfigDoc.create(CLSID_DOMDocument60, NULL, CLSCTX_INPROC_SERVER)))
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)eapMethodType.dwAuthorId, (int)67532).c_str())); return dwResult = g_peer.log_error(ppEapError, HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error creating XML document."));
else if (!pConnectionData && dwConnectionDataSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionData is NULL.")));
else if (!ppConfigDoc)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConfigDoc is NULL.")));
else {
HRESULT hr;
// Create configuration XML document. pConfigDoc->put_async(VARIANT_FALSE);
com_obj<IXMLDOMDocument2> pConfigDoc;
if (FAILED(hr = pConfigDoc.create(CLSID_DOMDocument60, NULL, CLSCTX_INPROC_SERVER))) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error creating XML document.")));
return dwResult;
}
pConfigDoc->put_async(VARIANT_FALSE); // Load empty XML configuration.
VARIANT_BOOL isSuccess = VARIANT_FALSE;
if (FAILED((hr = pConfigDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"></Config>", &isSuccess))))
return dwResult = g_peer.log_error(ppEapError, HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error loading XML document template."));
if (!isSuccess)
return dwResult = g_peer.log_error(ppEapError, ERROR_XML_PARSE_ERROR, _T(__FUNCTION__) _T(" Loading XML template failed."));
// Load empty XML configuration. // Configure XML selection namespaces used.
VARIANT_BOOL isSuccess = VARIANT_FALSE; pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
if (FAILED((hr = pConfigDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"></Config>", &isSuccess)))) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error loading XML document template.")));
return dwResult;
}
if (!isSuccess) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_XML_PARSE_ERROR, _T(__FUNCTION__) _T(" Loading XML template failed.")));
return dwResult;
}
// Configure XML selection namespaces used. // Select <Config> node.
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\"")); com_obj<IXMLDOMNode> pXmlElConfig;
if (FAILED(eapxml::select_node(pConfigDoc, bstr(L"eaphostconfig:Config"), pXmlElConfig)))
return dwResult = g_peer.log_error(ppEapError, ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <Config> element."));
// Select <Config> node. // Save configuration.
com_obj<IXMLDOMNode> pXmlElConfig; pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
if (FAILED(eapxml::select_node(pConfigDoc, bstr(L"eaphostconfig:Config"), pXmlElConfig))) { try {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <Config> element."))); g_peer.config_blob2xml(dwFlags, pConnectionData, dwConnectionDataSize, pConfigDoc, pXmlElConfig);
return dwResult; } catch (std::exception &err) {
} dwResult = g_peer.log_error(ppEapError, err);
} catch (...) {
// Save configuration. return dwResult = ERROR_INVALID_DATA;
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
try {
g_peer.config_blob2xml(dwFlags, pConnectionData, dwConnectionDataSize, pConfigDoc, pXmlElConfig);
} catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(err));
return dwResult = (*ppEapError)->dwWinError;
} catch (...) {
return dwResult = ERROR_INVALID_DATA;
}
*ppConfigDoc = pConfigDoc.detach();
} }
*ppConfigDoc = pConfigDoc.detach();
return dwResult; return dwResult;
} }
@@ -251,15 +235,16 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
/// ///
/// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx) /// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx)
/// ///
//_Use_decl_annotations_
DWORD WINAPI EapPeerInvokeConfigUI( DWORD WINAPI EapPeerInvokeConfigUI(
_In_ const EAP_METHOD_TYPE *pEapType, const EAP_METHOD_TYPE *pEapType,
_In_ HWND hwndParent, HWND hwndParent,
_In_ DWORD dwFlags, DWORD dwFlags,
_In_ DWORD dwConnectionDataInSize, DWORD dwConnectionDataInSize,
_In_count_(dwConnectionDataInSize) const BYTE *pConnectionDataIn, const BYTE *pConnectionDataIn,
_Out_ DWORD *pdwConnectionDataOutSize, DWORD *pdwConnectionDataOutSize,
_Out_ BYTE **ppConnectionDataOut, BYTE **ppConnectionDataOut,
_Out_ EAP_ERROR **ppEapError) EAP_ERROR **ppEapError)
{ {
UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(dwFlags);
DWORD dwResult = ERROR_SUCCESS; DWORD dwResult = ERROR_SUCCESS;
@@ -269,33 +254,26 @@ DWORD WINAPI EapPeerInvokeConfigUI(
//Sleep(10000); //Sleep(10000);
#endif #endif
// Initialize output parameters.
if (pdwConnectionDataOutSize)
*pdwConnectionDataOutSize = 0;
if (ppConnectionDataOut)
*ppConnectionDataOut = NULL;
if (ppEapError)
*ppEapError = NULL;
// Parameter check // Parameter check
if (!ppEapError) if (!pEapType || !pConnectionDataIn && dwConnectionDataInSize || !pdwConnectionDataOutSize || !ppConnectionDataOut)
return dwResult = ERROR_INVALID_PARAMETER; return dwResult = ERROR_INVALID_PARAMETER;
if (pEapType->eapType.type != EAPMETHOD_TYPE || pEapType->dwAuthorId != 67532)
return dwResult = ERROR_NOT_SUPPORTED;
assert(!*ppEapError); try {
g_peer.invoke_config_ui(hwndParent, pConnectionDataIn, dwConnectionDataInSize, ppConnectionDataOut, pdwConnectionDataOutSize);
if (!pEapType) } catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL."))); dwResult = g_peer.log_error(ppEapError, err);
else if (pEapType->eapType.type != EAPMETHOD_TYPE) } catch (...) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Input EAP type (%d) does not match the supported EAP type (%d)."), (int)pEapType->eapType.type, (int)EAPMETHOD_TYPE).c_str())); dwResult = ERROR_INVALID_DATA;
else if (pEapType->dwAuthorId != 67532)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str()));
else if (!pConnectionDataIn && dwConnectionDataInSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionDataIn is NULL.")));
else if (!pdwConnectionDataOutSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwConnectionDataOutSize is NULL.")));
else if (!ppConnectionDataOut)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL.")));
else {
try {
g_peer.invoke_config_ui(hwndParent, pConnectionDataIn, dwConnectionDataInSize, ppConnectionDataOut, pdwConnectionDataOutSize);
} catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(err));
dwResult = (*ppEapError)->dwWinError;
} catch (...) {
dwResult = ERROR_INVALID_DATA;
}
} }
return dwResult; return dwResult;
@@ -307,18 +285,19 @@ DWORD WINAPI EapPeerInvokeConfigUI(
/// ///
/// \sa [EapPeerInvokeIdentityUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363615.aspx) /// \sa [EapPeerInvokeIdentityUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363615.aspx)
/// ///
//_Use_decl_annotations_
DWORD WINAPI EapPeerInvokeIdentityUI( DWORD WINAPI EapPeerInvokeIdentityUI(
_In_ const EAP_METHOD_TYPE *pEapType, const EAP_METHOD_TYPE *pEapType,
_In_ DWORD dwFlags, DWORD dwFlags,
_In_ HWND hwndParent, HWND hwndParent,
_In_ DWORD dwConnectionDataSize, DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, const BYTE *pConnectionData,
_In_ DWORD dwUserDataSize, DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData, const BYTE *pUserData,
_Out_ DWORD *pdwUserDataOutSize, DWORD *pdwUserDataOutSize,
_Out_ BYTE **ppUserDataOut, BYTE **ppUserDataOut,
_Out_ LPWSTR *ppwszIdentity, LPWSTR *ppwszIdentity,
_Out_ EAP_ERROR **ppEapError) EAP_ERROR **ppEapError)
{ {
DWORD dwResult = ERROR_SUCCESS; DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult)); event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
@@ -327,37 +306,28 @@ DWORD WINAPI EapPeerInvokeIdentityUI(
//Sleep(10000); //Sleep(10000);
#endif #endif
// Initialize output parameters.
if (pdwUserDataOutSize)
*pdwUserDataOutSize = 0;
if (ppUserDataOut)
*ppUserDataOut = NULL;
if (ppwszIdentity)
*ppwszIdentity = NULL;
if (ppEapError)
*ppEapError = NULL;
// Parameter check // Parameter check
if (!ppEapError) if (!pEapType || !pConnectionData && dwConnectionDataSize || !pUserData && dwUserDataSize || !pdwUserDataOutSize || !ppUserDataOut || !ppwszIdentity)
dwResult = ERROR_INVALID_PARAMETER; return dwResult = ERROR_INVALID_PARAMETER;
if (pEapType->eapType.type != EAPMETHOD_TYPE || pEapType->dwAuthorId != 67532)
return dwResult = ERROR_NOT_SUPPORTED;
assert(!*ppEapError); try {
g_peer.invoke_identity_ui(hwndParent, dwFlags, pConnectionData, dwConnectionDataSize, pUserData, dwUserDataSize, ppUserDataOut, pdwUserDataOutSize, ppwszIdentity);
if (!pEapType) } catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL."))); dwResult = g_peer.log_error(ppEapError, err);
else if (pEapType->eapType.type != EAPMETHOD_TYPE) } catch (...) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Input EAP type (%d) does not match the supported EAP type (%d)."), (int)pEapType->eapType.type, (int)EAPMETHOD_TYPE).c_str())); dwResult = ERROR_INVALID_DATA;
else if (pEapType->dwAuthorId != 67532)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str()));
else if (!pConnectionData && dwConnectionDataSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionData is NULL.")));
else if (!pUserData && dwUserDataSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pUserData is NULL.")));
else if (!pdwUserDataOutSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwUserDataOutSize is NULL.")));
else if (!ppUserDataOut)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppUserDataOut is NULL.")));
else if (!ppwszIdentity)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
else {
try {
g_peer.invoke_identity_ui(hwndParent, dwFlags, pConnectionData, dwConnectionDataSize, pUserData, dwUserDataSize, ppUserDataOut, pdwUserDataOutSize, ppwszIdentity);
} catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(err));
dwResult = (*ppEapError)->dwWinError;
} catch (...) {
dwResult = ERROR_INVALID_DATA;
}
} }
return dwResult; return dwResult;
@@ -369,14 +339,15 @@ DWORD WINAPI EapPeerInvokeIdentityUI(
/// ///
/// \sa [EapPeerInvokeInteractiveUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363616.aspx) /// \sa [EapPeerInvokeInteractiveUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363616.aspx)
/// ///
//_Use_decl_annotations_
DWORD WINAPI EapPeerInvokeInteractiveUI( DWORD WINAPI EapPeerInvokeInteractiveUI(
_In_ const EAP_METHOD_TYPE *pEapType, const EAP_METHOD_TYPE *pEapType,
_In_ HWND hwndParent, HWND hwndParent,
_In_ DWORD dwUIContextDataSize, DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, const BYTE *pUIContextData,
_Out_ DWORD *pdwDataFromInteractiveUISize, DWORD *pdwDataFromInteractiveUISize,
_Out_ BYTE **ppDataFromInteractiveUI, BYTE **ppDataFromInteractiveUI,
_Out_ EAP_ERROR **ppEapError) EAP_ERROR **ppEapError)
{ {
DWORD dwResult = ERROR_SUCCESS; DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult)); event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
@@ -385,33 +356,26 @@ DWORD WINAPI EapPeerInvokeInteractiveUI(
//Sleep(10000); //Sleep(10000);
#endif #endif
// Initialize output parameters.
if (pdwDataFromInteractiveUISize)
*pdwDataFromInteractiveUISize = 0;
if (ppDataFromInteractiveUI)
*ppDataFromInteractiveUI = NULL;
if (ppEapError)
*ppEapError = NULL;
// Parameter check // Parameter check
if (!ppEapError) if (!pEapType || !pUIContextData && dwUIContextDataSize || !pdwDataFromInteractiveUISize || !ppDataFromInteractiveUI)
return dwResult = ERROR_INVALID_PARAMETER; return dwResult = ERROR_INVALID_PARAMETER;
if (pEapType->eapType.type != EAPMETHOD_TYPE || pEapType->dwAuthorId != 67532)
return dwResult = ERROR_NOT_SUPPORTED;
assert(!*ppEapError); try {
g_peer.invoke_interactive_ui(hwndParent, pUIContextData, dwUIContextDataSize, ppDataFromInteractiveUI, pdwDataFromInteractiveUISize);
if (!pEapType) } catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL."))); dwResult = g_peer.log_error(ppEapError, err);
else if (pEapType->eapType.type != EAPMETHOD_TYPE) } catch (...) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Input EAP type (%d) does not match the supported EAP type (%d)."), (int)pEapType->eapType.type, (int)EAPMETHOD_TYPE).c_str())); dwResult = ERROR_INVALID_DATA;
else if (pEapType->dwAuthorId != 67532)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str()));
else if (!pUIContextData && dwUIContextDataSize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pUIContextData is NULL.")));
else if (!pdwDataFromInteractiveUISize)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwDataFromInteractiveUISize is NULL.")));
else if (!ppDataFromInteractiveUI)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppDataFromInteractiveUI is NULL.")));
else {
try {
g_peer.invoke_interactive_ui(hwndParent, pUIContextData, dwUIContextDataSize, ppDataFromInteractiveUI, pdwDataFromInteractiveUISize);
} catch (std::exception &err) {
g_peer.log_error(*ppEapError = g_peer.make_error(err));
dwResult = (*ppEapError)->dwWinError;
} catch (...) {
dwResult = ERROR_INVALID_DATA;
}
} }
return dwResult; return dwResult;

View File

@@ -28,6 +28,7 @@
// wxEventMonitorApp // wxEventMonitorApp
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#pragma warning(suppress: 28251)
wxIMPLEMENT_APP(wxEventMonitorApp); wxIMPLEMENT_APP(wxEventMonitorApp);

View File

@@ -132,11 +132,8 @@ VOID WINAPI wxEventTraceProcessorThread::EventRecordCallback(_In_ PEVENT_RECORD
wxASSERT_MSG(pEvent->UserContext, wxT("thread is NULL")); wxASSERT_MSG(pEvent->UserContext, wxT("thread is NULL"));
wxEventTraceProcessorThread *_this = ((wxEventTraceProcessorThread*)pEvent->UserContext); wxEventTraceProcessorThread *_this = ((wxEventTraceProcessorThread*)pEvent->UserContext);
if (!_this || _this->TestDestroy())
if (_this->TestDestroy()) {
// Event processing is pending destruction.
return; return;
}
_this->m_parent->QueueEvent(new wxETWEvent(wxEVT_ETW_EVENT, *pEvent)); _this->m_parent->QueueEvent(new wxETWEvent(wxEVT_ETW_EVENT, *pEvent));
} }
@@ -178,7 +175,7 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
m_col_format_width[0] = 26; m_col_format_width[0] = 26;
m_col_format_width[1] = 5; m_col_format_width[1] = 5;
m_col_format_width[2] = 5; m_col_format_width[2] = 5;
m_col_format_width[3] = std::max<int>(std::max<int>(_countof("EapHost"), _countof("Schannel")), _countof(PRODUCT_NAME_STR)) - 1; m_col_format_width[3] = std::max<size_t>(std::max<size_t>(_countof("EapHost"), _countof("Schannel")), _countof(PRODUCT_NAME_STR)) - 1;
m_col_format_width[4] = 0; m_col_format_width[4] = 0;
// Prepare all possible item attributes. // Prepare all possible item attributes.
@@ -219,7 +216,11 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
properties->Wnode.BufferSize = ulSize; properties->Wnode.BufferSize = ulSize;
properties->Wnode.Flags = WNODE_FLAG_TRACED_GUID; properties->Wnode.Flags = WNODE_FLAG_TRACED_GUID;
properties->Wnode.ClientContext = 1; //QPC clock resolution properties->Wnode.ClientContext = 1; //QPC clock resolution
CoCreateGuid(&(properties->Wnode.Guid)); HRESULT hr = CoCreateGuid(&(properties->Wnode.Guid));
if (FAILED(hr)) {
wxLogError(winstd::tstring_printf(wxT("error 0x%08x generating GUID"), hr).c_str());
continue;
}
properties->LogFileMode = /*EVENT_TRACE_FILE_MODE_SEQUENTIAL |*/ EVENT_TRACE_REAL_TIME_MODE; properties->LogFileMode = /*EVENT_TRACE_FILE_MODE_SEQUENTIAL |*/ EVENT_TRACE_REAL_TIME_MODE;
properties->MaximumFileSize = 1; // 1 MB properties->MaximumFileSize = 1; // 1 MB
properties->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES); properties->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES);
@@ -776,13 +777,13 @@ static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ ULONG ulDat
((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_VALUEMAP ) && (pMapInfo->Flag & ~EVENTMAP_INFO_FLAG_WBEM_VALUEMAP) != EVENTMAP_INFO_FLAG_WBEM_FLAG)) ((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_VALUEMAP ) && (pMapInfo->Flag & ~EVENTMAP_INFO_FLAG_WBEM_VALUEMAP) != EVENTMAP_INFO_FLAG_WBEM_FLAG))
{ {
if ((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_NO_MAP) == EVENTMAP_INFO_FLAG_WBEM_NO_MAP) if ((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_NO_MAP) == EVENTMAP_INFO_FLAG_WBEM_NO_MAP)
return tstring_printf(_T("%ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[ulData].OutputOffset); return tstring_printf(_T("%ls"), (LPCWSTR)((PBYTE)pMapInfo + pMapInfo->MapEntryArray[ulData].OutputOffset));
else { else {
for (ULONG i = 0; ; i++) { for (ULONG i = 0; ; i++) {
if (i >= pMapInfo->EntryCount) if (i >= pMapInfo->EntryCount)
return tstring_printf(_T("%lu"), ulData); return tstring_printf(_T("%lu"), ulData);
else if (pMapInfo->MapEntryArray[i].Value == ulData) else if (pMapInfo->MapEntryArray[i].Value == ulData)
return tstring_printf(_T("%ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[i].OutputOffset); return tstring_printf(_T("%ls"), (LPCWSTR)((PBYTE)pMapInfo + pMapInfo->MapEntryArray[i].OutputOffset));
} }
} }
} else if ( } else if (
@@ -817,7 +818,7 @@ static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(
case TDH_INTYPE_UNICODESTRING: case TDH_INTYPE_UNICODESTRING:
case TDH_INTYPE_NONNULLTERMINATEDSTRING: case TDH_INTYPE_NONNULLTERMINATEDSTRING:
case TDH_INTYPE_UNICODECHAR: case TDH_INTYPE_UNICODECHAR:
return tstring_printf(_T("%.*ls"), nDataSize/sizeof(WCHAR), pData); return tstring_printf(_T("%.*ls"), (unsigned int)(nDataSize/sizeof(WCHAR)), (LPCWSTR)pData);
case TDH_INTYPE_ANSISTRING: case TDH_INTYPE_ANSISTRING:
case TDH_INTYPE_NONNULLTERMINATEDANSISTRING: case TDH_INTYPE_NONNULLTERMINATEDANSISTRING:
@@ -918,6 +919,7 @@ static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(
case TDH_INTYPE_BINARY: case TDH_INTYPE_BINARY:
switch (OutType) { switch (OutType) {
case TDH_OUTTYPE_IPV6: { case TDH_OUTTYPE_IPV6: {
#pragma warning(suppress: 6387) // ntdll.dll *must* exist.
auto RtlIpv6AddressToString = (LPTSTR(NTAPI*)(const IN6_ADDR*, LPTSTR))GetProcAddress(GetModuleHandle(_T("ntdll.dll")), auto RtlIpv6AddressToString = (LPTSTR(NTAPI*)(const IN6_ADDR*, LPTSTR))GetProcAddress(GetModuleHandle(_T("ntdll.dll")),
#ifdef _UNICODE #ifdef _UNICODE
"RtlIpv6AddressToStringW" "RtlIpv6AddressToStringW"
@@ -945,8 +947,12 @@ static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(
case TDH_INTYPE_GUID: { case TDH_INTYPE_GUID: {
assert(nDataSize >= sizeof(GUID)); assert(nDataSize >= sizeof(GUID));
WCHAR szGuid[39]; WCHAR szGuid[39];
StringFromGUID2(*(GUID*)pData, szGuid, _countof(szGuid)); if (StringFromGUID2(*(GUID*)pData, szGuid, _countof(szGuid)))
return tstring_printf(_T("%ls"), szGuid); return tstring_printf(_T("%ls"), szGuid);
else {
assert(0);
return _T("(GUID)");
}
} }
case TDH_INTYPE_POINTER: case TDH_INTYPE_POINTER:
@@ -995,7 +1001,7 @@ static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(
// 32-bit computer and 16 bytes on a 64-bit computer. // 32-bit computer and 16 bytes on a 64-bit computer.
// Doubling the pointer size handles both cases. // Doubling the pointer size handles both cases.
assert(nDataSize >= (SIZE_T)nPtrSize * 2); assert(nDataSize >= (SIZE_T)nPtrSize * 2);
return (PULONG)pData > 0 ? DataToString(TDH_INTYPE_SID, OutType, pData + nPtrSize * 2, nDataSize - nPtrSize * 2, pMapInfo, nPtrSize) : _T("(WBEM SID)"); return (PULONG)pData > 0 ? DataToString(TDH_INTYPE_SID, OutType, pData + (SIZE_T)nPtrSize * 2, nDataSize - (SIZE_T)nPtrSize * 2, pMapInfo, nPtrSize) : _T("(WBEM SID)");
case TDH_INTYPE_SID: { case TDH_INTYPE_SID: {
assert(nDataSize >= sizeof(SID)); assert(nDataSize >= sizeof(SID));
@@ -1027,7 +1033,7 @@ static ULONG GetArraySize(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, ULONG i
ULONG ulResult; ULONG ulResult;
// Get array count property. // Get array count property.
PROPERTY_DATA_DESCRIPTOR data_desc = { (ULONGLONG)(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[pInfo->EventPropertyInfoArray[i].countPropertyIndex].NameOffset), ULONG_MAX }; PROPERTY_DATA_DESCRIPTOR data_desc = { (ULONGLONG)pInfo + pInfo->EventPropertyInfoArray[pInfo->EventPropertyInfoArray[i].countPropertyIndex].NameOffset, ULONG_MAX };
vector<unsigned char> count; vector<unsigned char> count;
if ((ulResult = TdhGetProperty(pEvent, 0, NULL, 1, &data_desc, count)) != ERROR_SUCCESS) if ((ulResult = TdhGetProperty(pEvent, 0, NULL, 1, &data_desc, count)) != ERROR_SUCCESS)
return ulResult; return ulResult;
@@ -1067,7 +1073,7 @@ static tstring PropertyToString(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, U
if (out_nonfirst) out += _T(", "); else out_nonfirst = true; if (out_nonfirst) out += _T(", "); else out_nonfirst = true;
out += _T('('); out += _T('(');
for (USHORT j = pInfo->EventPropertyInfoArray[ulPropIndex].structType.StructStartIndex, usLastMember = pInfo->EventPropertyInfoArray[ulPropIndex].structType.StructStartIndex + pInfo->EventPropertyInfoArray[ulPropIndex].structType.NumOfStructMembers; j < usLastMember; j++) { for (USHORT j = pInfo->EventPropertyInfoArray[ulPropIndex].structType.StructStartIndex, usLastMember = pInfo->EventPropertyInfoArray[ulPropIndex].structType.StructStartIndex + pInfo->EventPropertyInfoArray[ulPropIndex].structType.NumOfStructMembers; j < usLastMember; j++) {
out += tstring_printf(_T("%ls: "), reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[j].NameOffset); out += tstring_printf(_T("%ls: "), (LPCWSTR)(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[j].NameOffset));
out += PropertyToString(pEvent, pInfo, j, reinterpret_cast<LPWSTR>(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset), k, nPtrSize); out += PropertyToString(pEvent, pInfo, j, reinterpret_cast<LPWSTR>(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset), k, nPtrSize);
} }
out += _T(')'); out += _T(')');
@@ -1086,12 +1092,12 @@ static tstring PropertyToString(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, U
// The first descriptor in the array identifies the name of the structure and the second // The first descriptor in the array identifies the name of the structure and the second
// descriptor defines the member of the structure whose data you want to retrieve. // descriptor defines the member of the structure whose data you want to retrieve.
PROPERTY_DATA_DESCRIPTOR data_desc[2] = { PROPERTY_DATA_DESCRIPTOR data_desc[2] = {
{ (ULONGLONG)pStructureName , ulStructIndex }, { (ULONGLONG)pStructureName , ulStructIndex },
{ (ULONGLONG)(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset), k } { (ULONGLONG)pInfo + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset, k }
}; };
ulResult = TdhGetProperty(pEvent, 0, NULL, _countof(data_desc), data_desc, data); ulResult = TdhGetProperty(pEvent, 0, NULL, _countof(data_desc), data_desc, data);
} else { } else {
PROPERTY_DATA_DESCRIPTOR data_desc = { (ULONGLONG)(reinterpret_cast<LPBYTE>(pInfo) + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset), k }; PROPERTY_DATA_DESCRIPTOR data_desc = { (ULONGLONG)pInfo + pInfo->EventPropertyInfoArray[ulPropIndex].NameOffset, k };
ulResult = TdhGetProperty(pEvent, 0, NULL, 1, &data_desc, data); ulResult = TdhGetProperty(pEvent, 0, NULL, 1, &data_desc, data);
} }
if (ulResult == ERROR_EVT_INVALID_EVENT_DATA) { if (ulResult == ERROR_EVT_INVALID_EVENT_DATA) {

View File

@@ -150,7 +150,7 @@ protected:
private: private:
/// \cond internal /// \cond internal
static VOID WINAPI EventRecordCallback(PEVENT_RECORD pEvent); static VOID WINAPI EventRecordCallback(_In_ PEVENT_RECORD pEvent);
/// \endcond /// \endcond
protected: protected:

View File

@@ -30,26 +30,26 @@
<ProjectGuid>{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}</ProjectGuid> <ProjectGuid>{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>EventMonitor</RootNamespace> <RootNamespace>EventMonitor</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -57,21 +57,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -156,10 +156,10 @@
<ProjectReference Include="..\lib\Events\build\Events.vcxproj"> <ProjectReference Include="..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project> <Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib-15.0.vcxproj"> <ProjectReference Include="..\lib\wxExtend\build\wxExtendLib-16.0.vcxproj">
<Project>{d3e29951-d9f5-486d-a167-20ae8e90b1fa}</Project> <Project>{d3e29951-d9f5-486d-a167-20ae8e90b1fa}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -34,6 +34,9 @@ class wxPersistentEventMonitorFrame;
#include <WinStd/Win.h> #include <WinStd/Win.h>
#pragma warning(push)
#pragma warning(disable: 26444)
/// \addtogroup EventMonitor /// \addtogroup EventMonitor
/// @{ /// @{
@@ -173,3 +176,5 @@ inline wxPersistentObject *wxCreatePersistentObject(wxEventMonitorFrame *wnd)
} }
/// @} /// @}
#pragma warning(pop)

View File

@@ -2,22 +2,21 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: EventMonitor\n" "Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2016-09-19 11:14+0200\n" "POT-Creation-Date: 2019-08-12 14:04+0200\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"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n" "X-Generator: Poedit 2.2.3\n"
"X-Poedit-Basepath: ..\n" "X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n" "X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-0: .\n"
#: App.cpp:61 Frame.h:67 MSIBuild/en_US.Win32.Release.Feature-2.idtx:4 #: App.cpp:61 Frame.h:75 MSIBuild/en_US.ARM64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4 #: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
msgid "Event Monitor" msgid "Event Monitor"
msgstr "" msgstr ""
@@ -27,41 +26,41 @@ msgstr ""
msgid "Error opening event trace (error %u)." msgid "Error opening event trace (error %u)."
msgstr "" msgstr ""
#: ETWLog.cpp:167 #: ETWLog.cpp:171
msgid "Time" msgid "Time"
msgstr "" msgstr ""
#: ETWLog.cpp:168 #: ETWLog.cpp:172
msgid "PID" msgid "PID"
msgstr "" msgstr ""
#: ETWLog.cpp:169 #: ETWLog.cpp:173
msgid "TID" msgid "TID"
msgstr "" msgstr ""
#: ETWLog.cpp:170 #: ETWLog.cpp:174
msgid "Source" msgid "Source"
msgstr "" msgstr ""
#: ETWLog.cpp:171 #: ETWLog.cpp:175
msgid "Event" msgid "Event"
msgstr "" msgstr ""
#: ETWLog.cpp:228 #: ETWLog.cpp:232
msgid "Access denied creating event session: you need administrative privileges (Run As Administrator) or be a member of Performance Log Users group to start event tracing session." msgid "Access denied creating event session: you need administrative privileges (Run As Administrator) or be a member of Performance Log Users group to start event tracing session."
msgstr "" msgstr ""
#: ETWLog.cpp:231
#, c-format
msgid "The %s event session already exists."
msgstr ""
#: ETWLog.cpp:235 #: ETWLog.cpp:235
#, c-format #, c-format
msgid "The %s event session already exists."
msgstr ""
#: ETWLog.cpp:239
#, c-format
msgid "Error creating event session (error %u)." msgid "Error creating event session (error %u)."
msgstr "" msgstr ""
#: ETWLog.cpp:251 ETWLog.cpp:267 ETWLog.cpp:281 #: ETWLog.cpp:255 ETWLog.cpp:271 ETWLog.cpp:285
#, c-format #, c-format
msgid "Error enabling %s event provider (error %u)." msgid "Error enabling %s event provider (error %u)."
msgstr "" msgstr ""
@@ -205,6 +204,8 @@ msgstr ""
msgid "Trace Log" msgid "Trace Log"
msgstr "" msgstr ""
#: MSIBuild/en_US.ARM64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.ARM64.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4 #: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4 #: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4 #: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
@@ -212,6 +213,7 @@ msgstr ""
msgid "Real-time display of internal events" msgid "Real-time display of internal events"
msgstr "" msgstr ""
#: MSIBuild/en_US.ARM64.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4 #: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4 #: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "EVENTM~1|GÉANTLink Event Monitor" msgid "EVENTM~1|GÉANTLink Event Monitor"

View File

@@ -1,6 +1,6 @@
# Translators: # Translators:
# Eric Hoch <eric.hoch@hhu.de>, 2016
# eduroam_devel <stefan.winter@restena.lu>, 2016 # eduroam_devel <stefan.winter@restena.lu>, 2016
# Eric Hoch <eric.hoch@hhu.de>, 2016
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: EventMonitor\n" "Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2017-02-02 18:14+0100\n" "POT-Creation-Date: 2017-02-02 18:14+0100\n"
"PO-Revision-Date: 2016-08-27 11:21+0000\n" "PO-Revision-Date: 2016-08-27 11:21+0000\n"
"Last-Translator: eduroam_devel <stefan.winter@restena.lu>, 2016\n" "Last-Translator: Eric Hoch <eric.hoch@hhu.de>, 2016\n"
"Language-Team: German (https://www.transifex.com/eduroam_devel/teams/11799/de/)\n" "Language-Team: German (https://www.transifex.com/eduroam_devel/teams/11799/de/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@@ -1,6 +1,6 @@
# Translators: # Translators:
# Zenon Mousmoulas <zenon@mousmoulas.gr>, 2016
# Vicky Kons <vickyk@admin.grnet.gr>, 2016 # Vicky Kons <vickyk@admin.grnet.gr>, 2016
# Zenon Mousmoulas <zenon@mousmoulas.gr>, 2016
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: EventMonitor\n" "Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2017-02-02 18:14+0100\n" "POT-Creation-Date: 2017-02-02 18:14+0100\n"
"PO-Revision-Date: 2016-08-27 11:21+0000\n" "PO-Revision-Date: 2016-08-27 11:21+0000\n"
"Last-Translator: Vicky Kons <vickyk@admin.grnet.gr>, 2016\n" "Last-Translator: Zenon Mousmoulas <zenon@mousmoulas.gr>, 2016\n"
"Language-Team: Greek (https://www.transifex.com/eduroam_devel/teams/11799/el/)\n" "Language-Team: Greek (https://www.transifex.com/eduroam_devel/teams/11799/el/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@@ -1,6 +1,6 @@
# Translators: # Translators:
# Indrek Rokk <indrek.rokk@eenet.ee>, 2018 # Indrek Rokk <indrek.rokk@eenet.ee>, 2018
# Anne M <anne@eenet.ee>, 2018 # Anne M <anne@eenet.ee>, 2019
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: EventMonitor\n" "Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2017-02-02 18:14+0100\n" "POT-Creation-Date: 2017-02-02 18:14+0100\n"
"PO-Revision-Date: 2016-08-27 11:21+0000\n" "PO-Revision-Date: 2016-08-27 11:21+0000\n"
"Last-Translator: Anne M <anne@eenet.ee>, 2018\n" "Last-Translator: Anne M <anne@eenet.ee>, 2019\n"
"Language-Team: Estonian (https://www.transifex.com/eduroam_devel/teams/11799/et/)\n" "Language-Team: Estonian (https://www.transifex.com/eduroam_devel/teams/11799/et/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -79,10 +79,9 @@ msgid ""
"(Run As Administrator) or be a member of Performance Log Users group to " "(Run As Administrator) or be a member of Performance Log Users group to "
"start event tracing session." "start event tracing session."
msgstr "" msgstr ""
"Puudub pääsuluba sündmuse seansi: sündmuse jälitusseansi alustamiseks on Sul" "Puudub pääsuluba: sündmuse jälitusseansi loomiseks vajad "
" vaja administraatoriõigusi (käivita administraatorina, inglise keeles Run " "administraatoriõigusi (Run As Administrator) või kuulumist soorituste logi "
"As Administrator) või kuulumist soorituste logi (Performance Log) kasutajate" "kasutajagruppi (Performance Log Users)"
" gruppi"
#: master/EventMonitor/ETWLog.cpp:235 ver1.0/EventMonitor/ETWLog.cpp:235 #: master/EventMonitor/ETWLog.cpp:235 ver1.0/EventMonitor/ETWLog.cpp:235
#: ver1.1/EventMonitor/ETWLog.cpp:235 #: ver1.1/EventMonitor/ETWLog.cpp:235

View File

@@ -15,7 +15,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPTTLS", "EAPMethods\EAPTT
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{E66A3FE1-4EE4-401F-8EAD-BE518B230393}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{E66A3FE1-4EE4-401F-8EAD-BE518B230393}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-15.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-16.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7B5EC9B7-208C-426A-941D-DAF9271BD4A4}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7B5EC9B7-208C-426A-941D-DAF9271BD4A4}"
EndProject EndProject
@@ -45,7 +45,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MsiUseFeature", "MsiUseFeat
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventMonitor", "EventMonitor\EventMonitor.vcxproj", "{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventMonitor", "EventMonitor\EventMonitor.vcxproj", "{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib-15.0.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib-16.0.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WLANManager", "WLANManager\WLANManager.vcxproj", "{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WLANManager", "WLANManager\WLANManager.vcxproj", "{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}"
EndProject EndProject
@@ -53,6 +53,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2", "lib\MSCHAPv2\bu
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2_UI", "lib\MSCHAPv2_UI\build\MSCHAPv2_UI.vcxproj", "{7AF5B922-7C17-428A-97E0-09E3B41A684D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2_UI", "lib\MSCHAPv2_UI\build\MSCHAPv2_UI.vcxproj", "{7AF5B922-7C17-428A-97E0-09E3B41A684D}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EapHost", "lib\EapHost\build\EapHost.vcxproj", "{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EapHost_UI", "lib\EapHost_UI\build\EapHost_UI.vcxproj", "{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTC", "lib\GTC\build\GTC.vcxproj", "{114A70BB-8698-4A0C-8C90-58F22EDD8129}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTC_UI", "lib\GTC_UI\build\GTC_UI.vcxproj", "{34680813-3A52-46FB-B5A8-1E4BBF770855}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64 Debug|ARM64 = Debug|ARM64
@@ -291,6 +299,54 @@ Global
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x64.Build.0 = Release|x64 {7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x64.Build.0 = Release|x64
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x86.ActiveCfg = Release|Win32 {7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x86.ActiveCfg = Release|Win32
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x86.Build.0 = Release|Win32 {7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x86.Build.0 = Release|Win32
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|ARM64.Build.0 = Debug|ARM64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x64.ActiveCfg = Debug|x64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x64.Build.0 = Debug|x64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x86.ActiveCfg = Debug|Win32
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x86.Build.0 = Debug|Win32
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|ARM64.ActiveCfg = Release|ARM64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|ARM64.Build.0 = Release|ARM64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x64.ActiveCfg = Release|x64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x64.Build.0 = Release|x64
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x86.ActiveCfg = Release|Win32
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x86.Build.0 = Release|Win32
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|ARM64.ActiveCfg = Debug|ARM64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|ARM64.Build.0 = Debug|ARM64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x64.ActiveCfg = Debug|x64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x64.Build.0 = Debug|x64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x86.ActiveCfg = Debug|Win32
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x86.Build.0 = Debug|Win32
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|ARM64.ActiveCfg = Release|ARM64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|ARM64.Build.0 = Release|ARM64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x64.ActiveCfg = Release|x64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x64.Build.0 = Release|x64
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x86.ActiveCfg = Release|Win32
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x86.Build.0 = Release|Win32
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|ARM64.ActiveCfg = Debug|ARM64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|ARM64.Build.0 = Debug|ARM64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|x64.ActiveCfg = Debug|x64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|x64.Build.0 = Debug|x64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|x86.ActiveCfg = Debug|Win32
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Debug|x86.Build.0 = Debug|Win32
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|ARM64.ActiveCfg = Release|ARM64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|ARM64.Build.0 = Release|ARM64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|x64.ActiveCfg = Release|x64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|x64.Build.0 = Release|x64
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|x86.ActiveCfg = Release|Win32
{114A70BB-8698-4A0C-8C90-58F22EDD8129}.Release|x86.Build.0 = Release|Win32
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|ARM64.ActiveCfg = Debug|ARM64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|ARM64.Build.0 = Debug|ARM64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|x64.ActiveCfg = Debug|x64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|x64.Build.0 = Debug|x64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|x86.ActiveCfg = Debug|Win32
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Debug|x86.Build.0 = Debug|Win32
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|ARM64.ActiveCfg = Release|ARM64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|ARM64.Build.0 = Release|ARM64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|x64.ActiveCfg = Release|x64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|x64.Build.0 = Release|x64
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|x86.ActiveCfg = Release|Win32
{34680813-3A52-46FB-B5A8-1E4BBF770855}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -315,8 +371,12 @@ Global
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4} {BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
{86A6D6A0-4B7D-4134-BE81-A5755C77584D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393} {86A6D6A0-4B7D-4134-BE81-A5755C77584D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{7AF5B922-7C17-428A-97E0-09E3B41A684D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393} {7AF5B922-7C17-428A-97E0-09E3B41A684D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{114A70BB-8698-4A0C-8C90-58F22EDD8129} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{34680813-3A52-46FB-B5A8-1E4BBF770855} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DBD7A2C5-08E8-4DC9-9615-9639F3F2D42E} SolutionGuid = {E52A6A8F-2AF5-43C7-8E01-9808E865BCF0}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -2,31 +2,36 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: GÉANTLink MSI\n" "Project-Id-Version: GÉANTLink MSI\n"
"POT-Creation-Date: 2016-09-19 11:20+0200\n" "POT-Creation-Date: 2019-08-12 14:04+0200\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"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n" "X-Generator: Poedit 2.2.3\n"
"X-Poedit-Basepath: ../Main\n" "X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n" "X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-0: Main\n"
#: en_US.Win32.Release.LaunchCondition-2.idtx:4 #: Main/en_US.ARM64.Release.LaunchCondition-2.idtx:4
#: en_US.x64.Release.LaunchCondition-2.idtx:4 #: Main/en_US.Win32.Release.LaunchCondition-2.idtx:4
#: Main/en_US.x64.Release.LaunchCondition-2.idtx:4
msgid "[ProductName] requires Windows Vista or later version of Windows." msgid "[ProductName] requires Windows Vista or later version of Windows."
msgstr "" msgstr ""
#: en_US.Win32.Release.Property-2.idtx:4 en_US.Win32.Release.Property-2.idtx:5 #: Main/en_US.ARM64.Release.Property-2.idtx:4
#: en_US.x64.Release.Property-2.idtx:4 en_US.x64.Release.Property-2.idtx:5 #: Main/en_US.ARM64.Release.Property-2.idtx:5
#: Main/en_US.Win32.Release.Property-2.idtx:4
#: Main/en_US.Win32.Release.Property-2.idtx:5
#: Main/en_US.x64.Release.Property-2.idtx:4
#: Main/en_US.x64.Release.Property-2.idtx:5
msgid "http://www.geant.org/" msgid "http://www.geant.org/"
msgstr "" msgstr ""
#: en_US.Win32.Release.Property-2.idtx:6 en_US.x64.Release.Property-2.idtx:6 #: Main/en_US.ARM64.Release.Property-2.idtx:6
#: Main/en_US.Win32.Release.Property-2.idtx:6
#: Main/en_US.x64.Release.Property-2.idtx:6
msgid "https://github.com/Amebis/GEANTLink/releases" msgid "https://github.com/Amebis/GEANTLink/releases"
msgstr "" msgstr ""

BIN
Makefile

Binary file not shown.

View File

@@ -76,7 +76,8 @@ static int MsiUseFeature()
} }
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) _Use_decl_annotations_
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{ {
UNREFERENCED_PARAMETER(hInstance); UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(hPrevInstance);

View File

@@ -30,26 +30,26 @@
<ProjectGuid>{679D03C5-CD70-4FFA-93F8-A4AB3637509B}</ProjectGuid> <ProjectGuid>{679D03C5-CD70-4FFA-93F8-A4AB3637509B}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>MsiUseFeature</RootNamespace> <RootNamespace>MsiUseFeature</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -57,21 +57,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -147,7 +147,7 @@
<ResourceCompile Include="MsiUseFeature.rc" /> <ResourceCompile Include="MsiUseFeature.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -1,7 +1,9 @@
# MsiUseFeature # MsiUseFeature
Checks the installation state of the given feature of GÉANTLink product Checks the installation state of the given feature of GÉANTLink product
## Usage ## Usage
``` ```
MsiUseFeature <feature name> [language] MsiUseFeature <feature name> [language]
``` ```
@@ -11,7 +13,8 @@ MsiUseFeature <feature name> [language]
Note: The MSI product code changes on every release. Therefore, `MsiUseFeature` utility with identical version should be used. Note: The MSI product code changes on every release. Therefore, `MsiUseFeature` utility with identical version should be used.
Return codes: ### Return codes
- -1 = Invalid parameters - -1 = Invalid parameters
- 0 = Success - 0 = Success
- 1 = The product is not installed, or feature state is unknown - 1 = The product is not installed, or feature state is unknown

View File

@@ -27,6 +27,7 @@
#include <Windows.h> #include <Windows.h>
#include <Msi.h> #include <Msi.h>
#include <shellapi.h>
#include <tchar.h> #include <tchar.h>
#include <memory> #include <memory>

View File

@@ -3,37 +3,48 @@
Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X clients 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 - Integrates into Windows seamlessly
- Wired and wireless network support - 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-GTC: Challenge/Response and Password authentication modes
- 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, regardless of their connection: wired or wireless - 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
- Configurable list of accepted server names - Configurable list of accepted server names
- Post-authentication CRL check
### Diagnostics ### Diagnostics
- Reporting to Event Log channels: Operational and Analytic verbosity - Reporting to Event Log channels: Operational and Analytic verbosity
- Real-time event monitoring utility - Real-time event monitoring utility
### User interface ### User interface
- Customizable helpdesk contact information - Customizable helpdesk contact information
- Lockable network profile configuration - Lockable network profile configuration
### Deployment ### Deployment
- Released as multi-lingual x86, x64, and ARM64 MSI packages; Group Policy deployment supported - Released as multi-lingual x86, x64, and ARM64 MSI packages; Group Policy deployment supported
- [MsiUseFeature utility](https://github.com/Amebis/GEANTLink/tree/ver1.0/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/ver1.0/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/ver1.0/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 ### Supported operating systems
- Windows Vista, Windows Server 2008 - Windows Vista, Windows Server 2008
- Windows 7, Windows Server 2008 R2 - Windows 7, Windows Server 2008 R2
- Windows 8 Desktop, Windows Server 2012 - Windows 8 Desktop, Windows Server 2012
@@ -41,44 +52,53 @@ Suite of EAP supplicants for Microsoft Windows - IEEE 802.1X clients for enterpr
- Windows 10 Desktop, Windows Server 2016 - Windows 10 Desktop, Windows Server 2016
## Download ## Download
Binaries are available for download [here](https://github.com/Amebis/GEANTLink/releases). Binaries are available for download [here](https://github.com/Amebis/GEANTLink/releases).
## Building ## Building
### Building Environment Requirements ### Building Environment Requirements
- Microsoft Windows Vista or later - Microsoft Windows Vista or later
- Microsoft Visual Studio 2017 - Microsoft Visual Studio 2019
- _msgfmt.exe_ from [gettext](https://www.gnu.org/software/gettext/); - _msgfmt.exe_ from [gettext](https://www.gnu.org/software/gettext/);
Hint: [Poedit](https://poedit.net/) contains up-to-date binary Win32 compiled gettext-utilities. Install it and add `GettextTools\bin` folder to the system path. Hint: [Poedit](https://poedit.net/) contains up-to-date binary Win32 compiled gettext-utilities. Install it and add `GettextTools\bin` folder to the system path.
- _sed.exe_ and _grep.exe_ - _sed.exe_ and _grep.exe_
Hint: [Git for Windows](https://gitforwindows.org/) contains up-to-date set of GNU utilities.
- _MsiDb.Exe_ and other command line utilities for MSI packaging distributed as a part of Microsoft Windows SDK (installed with Visual Studio). Add SDK's `Bin` folder to the system path. - _MsiDb.Exe_ and other command line utilities for MSI packaging distributed as a part of Microsoft Windows SDK (installed with Visual Studio). Add SDK's `Bin` folder to the system path.
### wxWidgets ### wxWidgets
GÉANTLink is using wxWidgets static libraries. Since upstream wxWidgets libraries don't support ARM64 yet, a clone with ARM64 support was prepared at [GitHub](https://github.com/Amebis/wxWidgets.git). GÉANTLink is using wxWidgets static libraries. Since upstream wxWidgets libraries don't support ARM64 yet, a clone with ARM64 support was prepared at [GitHub](https://github.com/Amebis/wxWidgets.git).
#### Compiling wxWidgets x86 static libraries #### Compiling wxWidgets x86 static libraries
1. Start _x86 Native Tools Command Prompt for VS 2017_
1. Start _x86 Native Tools Command Prompt for VS 2019_
2. Change working folder to `build\msw` 2. Change working folder to `build\msw`
3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141` 3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142`
4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 BUILD=release` 4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142 BUILD=release`
#### Compiling wxWidgets x64 static libraries #### Compiling wxWidgets x64 static libraries
1. Start _x64 Native Tools Command Prompt for VS 2017_
1. Start _x64 Native Tools Command Prompt for VS 2019_
2. Change working folder to `build\msw` 2. Change working folder to `build\msw`
3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=X64` 3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142 TARGET_CPU=X64`
4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=X64 BUILD=release` 4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142 TARGET_CPU=X64 BUILD=release`
#### Compiling wxWidgets ARM64 static libraries #### Compiling wxWidgets ARM64 static libraries
1. Start command prompt 1. Start command prompt
2. Change working folder to `build\msw` 2. Change working folder to `build\msw`
3. Run: `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"` 3. Run: `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"`
3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=ARM64 USE_OPENGL=0` 3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142 TARGET_CPU=ARM64 USE_OPENGL=0`
4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=ARM64 USE_OPENGL=0 BUILD=release` 4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=142 TARGET_CPU=ARM64 USE_OPENGL=0 BUILD=release`
#### Specifying wxWidgets path #### Specifying wxWidgets path
GÉANTLink compilation references wxWidgets libraries using `WXWIN` environment variable. Please set it to wxWidgets folder (i.e. `C:\SDK\wxWidgets`). GÉANTLink compilation references wxWidgets libraries using `WXWIN` environment variable. Please set it to wxWidgets folder (i.e. `C:\SDK\wxWidgets`).
### Digital Signing of Build Outputs ### Digital Signing of Build Outputs
In order to have the build process digitally sign output files, one should provide the following: In order to have the build process digitally sign output files, one should provide the following:
1. A signing certificate installed in the current users certificate store. 1. A signing certificate installed in the current users certificate store.
@@ -91,6 +111,7 @@ Please note that only Release builds are configured for timestamp signing. Debug
### Building ### Building
#### Building in Visual Studio IDE #### Building in Visual Studio IDE
GÉANTLink has some submodules. When cloning Git repository, make sure to use `--recursive` Git switch to clone submodules too. Example: GÉANTLink has some submodules. When cloning Git repository, make sure to use `--recursive` Git switch to clone submodules too. Example:
`git clone --recursive "https://github.com/Amebis/GEANTLink.git" "C:\Projects\GEANTLink"` `git clone --recursive "https://github.com/Amebis/GEANTLink.git" "C:\Projects\GEANTLink"`
@@ -105,6 +126,7 @@ Next, one must configure a network profile actually using GÉANTLink for the aut
GÉANTLink EAP modules are divided into two DLLs: backend (i.e. _EAPTTLS.dll_) and GUI (i.e. _EAPTTLSUI.dll_). GÉANTLink EAP modules are divided into two DLLs: backend (i.e. _EAPTTLS.dll_) and GUI (i.e. _EAPTTLSUI.dll_).
##### Backend DLL ##### Backend DLL
The backend DLL is loaded by _Eap3Host.exe_ process when connecting to the network. One approach to debug the module is to start Visual C++ elevated, open _GEANTLink.sln_, and attach to the running _Eap3Host.exe_ process. The backend DLL is loaded by _Eap3Host.exe_ process when connecting to the network. One approach to debug the module is to start Visual C++ elevated, open _GEANTLink.sln_, and attach to the running _Eap3Host.exe_ process.
On initial connection attempt _Eap3Host.exe_ will load the DLL and will not release it until _EapHost_ service is restarted. To release our DLL (i.e. for rebuild) you have to restart _EapHost_ service manually or run `nmake register` again. On initial connection attempt _Eap3Host.exe_ will load the DLL and will not release it until _EapHost_ service is restarted. To release our DLL (i.e. for rebuild) you have to restart _EapHost_ service manually or run `nmake register` again.
@@ -112,6 +134,7 @@ On initial connection attempt _Eap3Host.exe_ will load the DLL and will not rele
To debug early life of our backend DLL, uncomment `Sleep(10000)` in `DllMain()` of the module, and set breakpoints. This should give you plenty of time to catch emerging _Eap3Host.exe_ process and attach the debugger to it before our DLL starts servicing authentication. To debug early life of our backend DLL, uncomment `Sleep(10000)` in `DllMain()` of the module, and set breakpoints. This should give you plenty of time to catch emerging _Eap3Host.exe_ process and attach the debugger to it before our DLL starts servicing authentication.
##### GUI DLL ##### GUI DLL
The GUI DLL is loaded by _DllHost.exe_ process on XML profile configuration import/export and when interactive user interface is required. The GUI DLL is loaded by _DllHost.exe_ process on XML profile configuration import/export and when interactive user interface is required.
A few seconds after desired function call has finished, _DllHost.exe_ terminates and releases the DLL. A few seconds after desired function call has finished, _DllHost.exe_ terminates and releases the DLL.
@@ -119,7 +142,8 @@ A few seconds after desired function call has finished, _DllHost.exe_ terminates
To debug early life of our GUI DLL, uncomment `Sleep(10000)` in `DllMain()` of the module, and set breakpoints. This should give you plenty of time to attach the debugger to _DllHost.exe_ process before our DLL starts. To debug early life of our GUI DLL, uncomment `Sleep(10000)` in `DllMain()` of the module, and set breakpoints. This should give you plenty of time to attach the debugger to _DllHost.exe_ process before our DLL starts.
#### Building in command line #### Building in command line
Open _x64 Native Tools Command Prompt for VS 2017_ for building.
Open _x64 Native Tools Command Prompt for VS 2019_ for building.
Use Microsoft NMAKE to build the project. Use Microsoft NMAKE to build the project.
@@ -134,4 +158,5 @@ Command | Explanation
The `/ls` flag can be appended to the commands above to reduce NMAKEs verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading. The `/ls` flag can be appended to the commands above to reduce NMAKEs verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading.
### Translating into your language ### 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/). GÉANTLink is fully localizable. We kindly invite you to help [translating it on Transifex](https://www.transifex.com/eduroam_devel/geantlink/).

View File

@@ -0,0 +1,7 @@
@echo off
nmake.exe /ls All LANG=en_US CFG=Debug PLAT=Win32
nmake.exe /ls All LANG=en_US CFG=Debug PLAT=x64
nmake.exe /ls All LANG=en_US CFG=Debug PLAT=ARM64
nmake.exe /ls All LANG=en_US CFG=Release PLAT=Win32
nmake.exe /ls All LANG=en_US CFG=Release PLAT=x64
nmake.exe /ls All LANG=en_US CFG=Release PLAT=ARM64

View File

@@ -0,0 +1,7 @@
@echo off
nmake.exe /ls Clean LANG=en_US CFG=Debug PLAT=Win32
nmake.exe /ls Clean LANG=en_US CFG=Debug PLAT=x64
nmake.exe /ls Clean LANG=en_US CFG=Debug PLAT=ARM64
nmake.exe /ls Clean LANG=en_US CFG=Release PLAT=Win32
nmake.exe /ls Clean LANG=en_US CFG=Release PLAT=x64
nmake.exe /ls Clean LANG=en_US CFG=Release PLAT=ARM64

View File

@@ -130,6 +130,7 @@ static int WLANManager()
// Launch WLAN profile config dialog. // Launch WLAN profile config dialog.
WLAN_REASON_CODE wlrc = L2_REASON_CODE_SUCCESS; WLAN_REASON_CODE wlrc = L2_REASON_CODE_SUCCESS;
#pragma warning(suppress: 6387) // TODO: MSDN nor SAL annotation don't indicate NULL HWND are OK with WlanUIEditProfile().
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) {
// WlanUIEditProfile() displays own error dialog on failure. // WlanUIEditProfile() displays own error dialog on failure.
@@ -153,7 +154,8 @@ static int WLANManager()
} }
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) _Use_decl_annotations_
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{ {
UNREFERENCED_PARAMETER(hInstance); UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(hPrevInstance);

View File

@@ -1,14 +1,18 @@
#WLANManager # WLANManager
Invokes standard Windows Wireless Network Properties dialog Invokes standard Windows Wireless Network Properties dialog
##Usage ## Usage
``` ```
WLANManager profile <name> [interface <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
- 0 = Success - 0 = Success
- 1 = Error parsing command line - 1 = Error parsing command line

View File

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

View File

@@ -30,26 +30,26 @@
<ProjectGuid>{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}</ProjectGuid> <ProjectGuid>{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>WLANManager</RootNamespace> <RootNamespace>WLANManager</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -57,21 +57,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -144,7 +144,7 @@
<ResourceCompile Include="WLANManager.rc" /> <ResourceCompile Include="WLANManager.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj"> <ProjectReference Include="..\lib\WinStd\build\WinStd-16.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project> <Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@@ -2,21 +2,21 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WLANManager\n" "Project-Id-Version: WLANManager\n"
"POT-Creation-Date: 2016-09-19 11:22+0200\n" "POT-Creation-Date: 2019-08-12 14:09+0200\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"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n" "X-Generator: Poedit 2.2.3\n"
"X-Poedit-Basepath: ..\n" "X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n" "X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-0: .\n"
#: MSIBuild/en_US.ARM64.Debug.Feature-2.idtx:4
#: MSIBuild/en_US.ARM64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4 #: MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4 #: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Feature-2.idtx:4 #: MSIBuild/en_US.x64.Debug.Feature-2.idtx:4
@@ -24,6 +24,8 @@ msgstr ""
msgid "WLAN Manager" msgid "WLAN Manager"
msgstr "" msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Feature-2.idtx:4
#: MSIBuild/en_US.ARM64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4 #: MSIBuild/en_US.Win32.Debug.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4 #: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Feature-2.idtx:4 #: MSIBuild/en_US.x64.Debug.Feature-2.idtx:4

View File

@@ -29,15 +29,19 @@
<IncludePath>$(WXWIN)\include\msvc;$(WXWIN)\include;$(IncludePath)</IncludePath> <IncludePath>$(WXWIN)\include\msvc;$(WXWIN)\include;$(IncludePath)</IncludePath>
<SourcePath>$(WXWIN)\src\aui;$(WXWIN)\src\cocoa;$(WXWIN)\src\common;$(WXWIN)\src\dfb;$(WXWIN)\src\expat;$(WXWIN)\src\generic;$(WXWIN)\src\gtk;$(WXWIN)\src\gtk1;$(WXWIN)\src\html;$(WXWIN)\src\jpeg;$(WXWIN)\src\motif;$(WXWIN)\src\msdos;$(WXWIN)\src\msw;$(WXWIN)\src\os2;$(WXWIN)\src\osx;$(WXWIN)\src\png;$(WXWIN)\src\propgrid;$(WXWIN)\src\regex;$(WXWIN)\src\ribbon;$(WXWIN)\src\richtext;$(WXWIN)\src\stc;$(WXWIN)\src\tiff;$(WXWIN)\src\univ;$(WXWIN)\src\unix;$(WXWIN)\src\x11;$(WXWIN)\src\xml;$(WXWIN)\src\xrc;$(WXWIN)\src\zlib;$(SourcePath)</SourcePath> <SourcePath>$(WXWIN)\src\aui;$(WXWIN)\src\cocoa;$(WXWIN)\src\common;$(WXWIN)\src\dfb;$(WXWIN)\src\expat;$(WXWIN)\src\generic;$(WXWIN)\src\gtk;$(WXWIN)\src\gtk1;$(WXWIN)\src\html;$(WXWIN)\src\jpeg;$(WXWIN)\src\motif;$(WXWIN)\src\msdos;$(WXWIN)\src\msw;$(WXWIN)\src\os2;$(WXWIN)\src\osx;$(WXWIN)\src\png;$(WXWIN)\src\propgrid;$(WXWIN)\src\regex;$(WXWIN)\src\ribbon;$(WXWIN)\src\richtext;$(WXWIN)\src\stc;$(WXWIN)\src\tiff;$(WXWIN)\src\univ;$(WXWIN)\src\unix;$(WXWIN)\src\x11;$(WXWIN)\src\xml;$(WXWIN)\src\xrc;$(WXWIN)\src\zlib;$(SourcePath)</SourcePath>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CAExcludePath>$(WXWIN);$(CAExcludePath)</CAExcludePath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;ISOLATION_AWARE_ENABLED=1;SECURITY_WIN32;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;EAP_TLS=1;wxMSVC_VERSION=$(PlatformToolsetVersion);%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WIN32_WINNT=0x0600;ISOLATION_AWARE_ENABLED=1;SECURITY_WIN32;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;EAP_TLS=1;wxMSVC_VERSION=$(PlatformToolsetVersion);WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>StdAfx.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>StdAfx.h</PrecompiledHeaderFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<EnablePREfast>true</EnablePREfast>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>

View File

@@ -32,6 +32,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile> </ClCompile>
<Link> <Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -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 0x01002400 #define PRODUCT_VERSION 0x01020b00
// //
// Product version by components // Product version by components
@@ -38,27 +38,27 @@
// separately. // separately.
// //
#define PRODUCT_VERSION_MAJ 1 #define PRODUCT_VERSION_MAJ 1
#define PRODUCT_VERSION_MIN 0 #define PRODUCT_VERSION_MIN 2
#define PRODUCT_VERSION_REV 36 #define PRODUCT_VERSION_REV 11
#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.0i" #define PRODUCT_VERSION_STR "1.2g"
#define PRODUCT_BUILD_YEAR_STR "2018" #define PRODUCT_BUILD_YEAR_STR "2019"
// //
// 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.0.36" #define PRODUCT_VERSION_INST "1.2.11"
// //
// 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 "{9BAA5756-D4F9-4389-818F-FF22A6DB22E8}" #define PRODUCT_VERSION_GUID "{9724DC5C-8574-47AF-9978-04ED7FA83EF4}"
// //
// Product vendor // Product vendor

4
lib/.gitignore vendored
View File

@@ -1,4 +0,0 @@
/EapHost
/EapHost_UI
/GTC
/GTC_UI

View File

@@ -29,26 +29,26 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{AD6816A0-9600-4E01-8C49-39D03D1E791F}</ProjectGuid> <ProjectGuid>{AD6816A0-9600-4E01-8C49-39D03D1E791F}</ProjectGuid>
<RootNamespace>EAPBase</RootNamespace> <RootNamespace>EAPBase</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -56,21 +56,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -127,6 +127,7 @@
<ClInclude Include="..\include\EAPXML.h" /> <ClInclude Include="..\include\EAPXML.h" />
<ClInclude Include="..\include\Method.h" /> <ClInclude Include="..\include\Method.h" />
<ClInclude Include="..\include\Module.h" /> <ClInclude Include="..\include\Module.h" />
<ClInclude Include="..\include\UIContext.h" />
<ClInclude Include="..\src\StdAfx.h" /> <ClInclude Include="..\src\StdAfx.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -143,6 +144,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\UIContext.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Events\build\Events.vcxproj"> <ProjectReference Include="..\..\Events\build\Events.vcxproj">

View File

@@ -32,6 +32,9 @@
<ClInclude Include="..\include\Credentials.h"> <ClInclude Include="..\include\Credentials.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\include\UIContext.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\src\StdAfx.cpp"> <ClCompile Include="..\src\StdAfx.cpp">
@@ -52,5 +55,8 @@
<ClCompile Include="..\src\EAP.cpp"> <ClCompile Include="..\src\EAP.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\UIContext.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -24,57 +24,13 @@
namespace eap namespace eap
{ {
///
/// Base class for configuration storage
///
class config; class config;
///
/// Base class for method configuration storage
///
class config_method; class config_method;
///
/// Base class for method with credentials
///
class config_method_with_cred; class config_method_with_cred;
///
/// Provider configuration storage
///
class config_provider; class config_provider;
///
/// Connection configuration storage
///
class config_connection; class config_connection;
} }
///
/// 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(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"
@@ -96,7 +52,16 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val);
namespace eap namespace eap
{ {
class config ///
/// \defgroup EAPBaseConfig Configuration
/// Configuration management
///
/// @{
///
/// Base class for packable and XML-exportable storage
///
class config : public packable
{ {
public: public:
/// ///
@@ -118,7 +83,7 @@ namespace eap
/// ///
/// \param[in] other Configuration to move from /// \param[in] other Configuration to move from
/// ///
config(_Inout_ config &&other); config(_Inout_ config &&other) noexcept;
/// ///
/// Copies configuration /// Copies configuration
@@ -136,20 +101,20 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
config& operator=(_Inout_ config &&other); config& operator=(_Inout_ config &&other) noexcept;
/// ///
/// Clones this configuration /// Clones this object
/// ///
/// \returns Pointer to cloned configuration /// \returns Pointer to cloned object with identical data
/// ///
virtual config* clone() const = 0; virtual config* clone() const = 0;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
/// ///
/// Save to XML document /// Save data to XML document
/// ///
/// \param[in] pDoc XML document /// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving /// \param[in] pConfigRoot Suggested root element for saving
@@ -165,40 +130,20 @@ namespace eap
/// @} /// @}
/// \name BLOB management
/// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor);
/// @}
public: public:
module &m_module; ///< EAP module module &m_module; ///< EAP module
protected: protected:
static const winstd::bstr namespace_eapmetadata; static const winstd::bstr namespace_eapmetadata; ///< Reusable BSTR containing "urn:ietf:params:xml:ns:yang:ietf-eap-metadata"
}; };
class credentials;
///
/// Base class for method configuration storage
///
class config_method : public config class config_method : public config
{ {
public: public:
@@ -242,7 +187,7 @@ namespace eap
/// ///
/// \param[in] other Configuration to move from /// \param[in] other Configuration to move from
/// ///
config_method(_Inout_ config_method &&other); config_method(_Inout_ config_method &&other) noexcept;
/// ///
/// Copies configuration /// Copies configuration
@@ -260,52 +205,19 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
config_method& operator=(_Inout_ config_method &&other); config_method& operator=(_Inout_ config_method &&other) noexcept;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
/// ///
@@ -320,6 +232,11 @@ namespace eap
/// ///
virtual const wchar_t* get_method_str() const = 0; virtual const wchar_t* get_method_str() const = 0;
///
/// Creates a blank set of credentials suitable for this method
///
virtual credentials* make_credentials() const = 0;
public: public:
const unsigned int m_level; ///< Config level (0=outer, 1=inner, 2=inner-inner...) const unsigned int m_level; ///< Config level (0=outer, 1=inner, 2=inner-inner...)
bool m_allow_save; ///< Are credentials allowed to be saved to Windows Credential Manager? bool m_allow_save; ///< Are credentials allowed to be saved to Windows Credential Manager?
@@ -328,9 +245,9 @@ namespace eap
}; };
class credentials; ///
/// Base class for method with credentials
///
class config_method_with_cred : public config_method class config_method_with_cred : public config_method
{ {
public: public:
@@ -354,7 +271,7 @@ namespace eap
/// ///
/// \param[in] other Configuration to move from /// \param[in] other Configuration to move from
/// ///
config_method_with_cred(_Inout_ config_method_with_cred &&other); config_method_with_cred(_Inout_ config_method_with_cred &&other) noexcept;
/// ///
/// Copies configuration /// Copies configuration
@@ -372,65 +289,30 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
config_method_with_cred& operator=(_Inout_ config_method_with_cred &&other); config_method_with_cred& operator=(_Inout_ config_method_with_cred &&other) noexcept;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
///
/// Creates a blank set of credentials suitable for this method
///
virtual credentials* make_credentials() const = 0;
public: public:
bool m_use_cred; ///< Use configured credentials bool m_use_cred; ///< Use configured credentials
std::unique_ptr<credentials> m_cred; ///< Configured credentials std::unique_ptr<credentials> m_cred; ///< Configured credentials
}; };
///
/// Provider configuration storage
///
class config_provider : public config class config_provider : public config
{ {
public: public:
@@ -453,7 +335,7 @@ namespace eap
/// ///
/// \param[in] other Configuration to move from /// \param[in] other Configuration to move from
/// ///
config_provider(_Inout_ config_provider &&other); config_provider(_Inout_ config_provider &&other) noexcept;
/// ///
/// Copies configuration /// Copies configuration
@@ -471,59 +353,21 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
config_provider& operator=(_Inout_ config_provider &&other); config_provider& operator=(_Inout_ config_provider &&other) noexcept;
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const; virtual config* clone() const;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
/// ///
@@ -556,10 +400,16 @@ namespace eap
}; };
///
/// Connection configuration storage
///
class config_connection : public config class config_connection : public config
{ {
public: public:
typedef std::list<eap::config_provider> provider_list; ///
/// List of configuration providers
///
typedef std::list<config_provider> provider_list;
public: public:
/// ///
@@ -581,7 +431,7 @@ namespace eap
/// ///
/// \param[in] other Configuration to move from /// \param[in] other Configuration to move from
/// ///
config_connection(_Inout_ config_connection &&other); config_connection(_Inout_ config_connection &&other) noexcept;
/// ///
/// Copies configuration /// Copies configuration
@@ -599,99 +449,69 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
config_connection& operator=(_Inout_ config_connection &&other); config_connection& operator=(_Inout_ config_connection &&other) noexcept;
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const; virtual config* clone() const;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
public: public:
std::list<eap::config_provider> m_providers; ///< Provider configurations std::list<config_provider> m_providers; ///< Provider configurations
}; };
/// @}
} }
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config &val) /// \addtogroup EAPBaseStream
{ /// @{
val.operator<<(cursor);
}
inline size_t pksizeof(const eap::config &val)
{
return val.get_pk_size();
}
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val)
{
val.operator>>(cursor);
}
///
/// Packs a method status
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Method status to pack
///
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config_method::status_t &val) inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::config_method::status_t &val)
{ {
cursor << (unsigned char)val; cursor << (unsigned char)val;
} }
///
/// Returns packed size of a method status
///
/// \param[in] val Method status to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t pksizeof(_In_ const eap::config_method::status_t &val) inline size_t pksizeof(_In_ const eap::config_method::status_t &val)
{ {
return pksizeof((unsigned char)val); return pksizeof((unsigned char)val);
} }
///
/// Unpacks a method status
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Method status to unpack to
///
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. 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;
} }
/// @}

View File

@@ -18,23 +18,10 @@
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>. along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <sal.h>
namespace eap namespace eap
{ {
///
/// Base class for method credential storage
///
class credentials; class credentials;
///
/// Password based method credentials
///
class credentials_pass; class credentials_pass;
///
/// Connection credentials
///
class credentials_connection; class credentials_connection;
} }
@@ -58,6 +45,12 @@ namespace eap
namespace eap namespace eap
{ {
/// \addtogroup EAPBaseCred
/// @{
///
/// Base class for method credential storage
///
class credentials : public config class credentials : public config
{ {
public: public:
@@ -68,7 +61,8 @@ namespace eap
source_unknown = -1, ///< Unknown source source_unknown = -1, ///< Unknown source
source_cache = 0, ///< Credentials were obtained from EapHost cache source_cache = 0, ///< Credentials were obtained from EapHost cache
source_config, ///< Credentials were set by method configuration source_config, ///< Credentials were set by method configuration
source_storage ///< Credentials were loaded from Windows Credential Manager source_storage, ///< Credentials were loaded from Windows Credential Manager
source_lower, ///< Credentials were set by lower EAP method
}; };
@@ -92,7 +86,7 @@ namespace eap
/// ///
/// \param[in] other Credentials to move from /// \param[in] other Credentials to move from
/// ///
credentials(_Inout_ credentials &&other); credentials(_Inout_ credentials &&other) noexcept;
/// ///
/// Copies credentials /// Copies credentials
@@ -110,7 +104,7 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
credentials& operator=(_Inout_ credentials &&other); credentials& operator=(_Inout_ credentials &&other) noexcept;
/// ///
/// Resets credentials /// Resets credentials
@@ -126,50 +120,17 @@ namespace eap
/// ///
virtual bool empty() const; virtual bool empty() const;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
/// \name Storage /// \name Storage
@@ -239,12 +200,14 @@ namespace eap
/// Combine credentials in the following order: /// Combine credentials in the following order:
/// ///
/// 1. Cached credentials /// 1. Cached credentials
/// 2. Pre-configured credentials /// 2. Configured credentials (if \p cfg is derived from `config_method_with_cred`)
/// 3. Stored credentials /// 3. Stored credentials
/// ///
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be the same type of credentials as `this`) /// \param[in] dwFlags A combination of [EAP flags](https://msdn.microsoft.com/en-us/library/windows/desktop/bb891975.aspx) that describe the EAP authentication session behavior
/// \param[in] cfg Method configuration (must be the same type of configuration as `this` credentials belong to) /// \param[in] hTokenImpersonateUser Impersonation token for a logged-on user to collect user-related information
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL) /// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be the same type of credentials as `this`)
/// \param[in] cfg Method configuration (must be the same type of configuration as `this` credentials belong to)
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
/// ///
/// \returns /// \returns
/// - \c source_cache Credentials were obtained from EapHost cache /// - \c source_cache Credentials were obtained from EapHost cache
@@ -252,15 +215,112 @@ namespace eap
/// - \c source_storage Credentials were loaded from Windows Credential Manager /// - \c source_storage Credentials were loaded from Windows Credential Manager
/// ///
virtual source_t combine( virtual source_t combine(
_In_ const credentials *cred_cached, _In_ DWORD dwFlags,
_In_ const config_method_with_cred &cfg, _In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_z_ LPCTSTR pszTargetName) = 0; _In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName) = 0;
public: public:
std::wstring m_identity; ///< Identity (username\@domain, certificate name etc.) std::wstring m_identity; ///< Identity (username\@domain, certificate name etc.)
}; };
///
/// Identity-only based method credentials
///
class credentials_identity : public credentials
{
public:
///
/// Constructs credentials
///
/// \param[in] mod EAP module to use for global services
///
credentials_identity(_In_ module &mod);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
credentials_identity(_In_ const credentials_identity &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
credentials_identity(_Inout_ credentials_identity &&other) noexcept;
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
credentials_identity& operator=(_In_ const credentials_identity &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
/// \returns Reference to this object
///
credentials_identity& operator=(_Inout_ credentials_identity &&other) noexcept;
virtual config* clone() const;
/// \name XML management
/// @{
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @}
/// \name Storage
/// @{
virtual void store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const;
virtual void retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level);
///
/// @copydoc eap::credentials::target_suffix()
/// \returns This implementation always returns `_T("pass")`
///
virtual LPCTSTR target_suffix() const;
/// @}
///
/// Combine credentials in the following order:
///
/// 1. Cached credentials
/// 2. Configured credentials (if \p cfg is derived from `config_method_with_cred`)
/// 3. Stored credentials
///
/// \param[in] dwFlags A combination of [EAP flags](https://msdn.microsoft.com/en-us/library/windows/desktop/bb891975.aspx) that describe the EAP authentication session behavior
/// \param[in] hTokenImpersonateUser Impersonation token for a logged-on user to collect user-related information
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL)
/// \param[in] cfg Method configuration (when derived from `config_method_with_cred`, metod attempt to load credentials from \p cfg)
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
///
/// \returns
/// - \c source_cache Credentials were obtained from EapHost cache
/// - \c source_config Credentials were set by method configuration
/// - \c source_storage Credentials were loaded from Windows Credential Manager
///
virtual source_t combine(
_In_ DWORD dwFlags,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName);
};
///
/// Password based method credentials
///
class credentials_pass : public credentials class credentials_pass : public credentials
{ {
public: public:
@@ -294,7 +354,7 @@ namespace eap
/// ///
/// \param[in] other Credentials to move from /// \param[in] other Credentials to move from
/// ///
credentials_pass(_Inout_ credentials_pass &&other); credentials_pass(_Inout_ credentials_pass &&other) noexcept;
/// ///
/// Copies credentials /// Copies credentials
@@ -312,111 +372,49 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
credentials_pass& operator=(_Inout_ credentials_pass &&other); credentials_pass& operator=(_Inout_ credentials_pass &&other) noexcept;
///
/// Clones credentials
///
/// \returns Pointer to cloned credentials
///
virtual config* clone() const; virtual config* clone() const;
///
/// Resets credentials
///
virtual void clear(); virtual void clear();
///
/// Test credentials if blank
///
/// \returns
/// - \c true if blank
/// - \c false otherwise
///
virtual bool empty() const; virtual bool empty() const;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
/// \name Storage /// \name Storage
/// @{ /// @{
///
/// Save credentials to Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to store credentials as
/// \param[in] level Credential level (0=outer, 1=inner, 2=inner-inner...)
///
virtual void store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const; virtual void store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const;
///
/// Retrieve credentials from Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from
/// \param[in] level Credential level (0=outer, 1=inner, 2=inner-inner...)
///
virtual void retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level); virtual void retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level);
/// ///
/// Return target suffix for Windows Credential Manager credential name /// @copydoc eap::credentials::target_suffix()
/// \returns This implementation always returns `_T("pass")`
/// ///
virtual LPCTSTR target_suffix() const; virtual LPCTSTR target_suffix() const;
/// @} /// @}
/// ///
/// Combine credentials in the following order: /// Combine credentials in the following order:
/// ///
/// 1. Cached credentials /// 1. Cached credentials
/// 2. Pre-configured credentials /// 2. Configured credentials (if \p cfg is derived from `config_method_with_cred`)
/// 3. Stored credentials /// 3. Stored credentials
/// ///
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be credentials_pass* type) /// \param[in] dwFlags A combination of [EAP flags](https://msdn.microsoft.com/en-us/library/windows/desktop/bb891975.aspx) that describe the EAP authentication session behavior
/// \param[in] cfg Method configuration (must be config_method_pap type) /// \param[in] hTokenImpersonateUser Impersonation token for a logged-on user to collect user-related information
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL) /// \param[in] cred_cached Cached credentials (optional, can be \c NULL)
/// \param[in] cfg Method configuration (when derived from `config_method_with_cred`, metod attempt to load credentials from \p cfg)
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
/// ///
/// \returns /// \returns
/// - \c source_cache Credentials were obtained from EapHost cache /// - \c source_cache Credentials were obtained from EapHost cache
@@ -424,13 +422,15 @@ namespace eap
/// - \c source_storage Credentials were loaded from Windows Credential Manager /// - \c source_storage Credentials were loaded from Windows Credential Manager
/// ///
virtual source_t combine( virtual source_t combine(
_In_ const credentials *cred_cached, _In_ DWORD dwFlags,
_In_ const config_method_with_cred &cfg, _In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_z_ LPCTSTR pszTargetName); _In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName);
public: public:
winstd::sanitizing_wstring m_password; ///< Password winstd::sanitizing_wstring m_password; ///< Password
enc_alg_t m_enc_alg; ///< Encryption algorithm used for XML password keeping enc_alg_t m_enc_alg; ///< Encryption algorithm used for XML password keeping
private: private:
/// \cond internal /// \cond internal
@@ -439,6 +439,9 @@ namespace eap
}; };
///
/// Connection credentials
///
class credentials_connection : public config class credentials_connection : public config
{ {
public: public:
@@ -462,7 +465,7 @@ namespace eap
/// ///
/// \param[in] other Credentials to move from /// \param[in] other Credentials to move from
/// ///
credentials_connection(_Inout_ credentials_connection &&other); credentials_connection(_Inout_ credentials_connection &&other) noexcept;
/// ///
/// Copies credentials /// Copies credentials
@@ -480,59 +483,21 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
credentials_connection& operator=(_Inout_ credentials_connection &&other); credentials_connection& operator=(_Inout_ credentials_connection &&other) noexcept;
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const; virtual config* clone() const;
/// \name XML configuration management /// \name XML management
/// @{ /// @{
///
/// Save to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving
///
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
///
/// Load from XML document
///
/// \param[in] pConfigRoot Root element for loading
///
virtual void load(_In_ IXMLDOMNode *pConfigRoot); virtual void load(_In_ IXMLDOMNode *pConfigRoot);
/// @} /// @}
/// \name BLOB management /// \name BLOB management
/// @{ /// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const; virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const; virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor); virtual void operator>>(_Inout_ cursor_in &cursor);
/// @} /// @}
/// ///
@@ -566,23 +531,48 @@ namespace eap
std::wstring m_id; ///< Provider ID std::wstring m_id; ///< Provider ID
std::unique_ptr<credentials> m_cred; ///< Credentials std::unique_ptr<credentials> m_cred; ///< Credentials
}; };
/// @}
} }
/// \addtogroup EAPBaseStream
/// @{
///
/// Packs a credential encryption algorithm ID
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Credential encryption algorithm ID to pack
///
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::credentials_pass::enc_alg_t &val) inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::credentials_pass::enc_alg_t &val)
{ {
cursor << (unsigned char)val; cursor << (unsigned char)val;
} }
///
/// Returns packed size of a credential encryption algorithm ID
///
/// \param[in] val Credential encryption algorithm ID to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t pksizeof(_In_ const eap::credentials_pass::enc_alg_t &val) inline size_t pksizeof(_In_ const eap::credentials_pass::enc_alg_t &val)
{ {
return pksizeof((unsigned char)val); return pksizeof((unsigned char)val);
} }
///
/// Unpacks a credential encryption algorithm ID
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Credential encryption algorithm ID to unpack to
///
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. 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;
} }
/// @}

View File

@@ -21,17 +21,44 @@
#define IDR_EAP_KEY_PUBLIC 1 #define IDR_EAP_KEY_PUBLIC 1
#define IDR_EAP_KEY_PRIVATE 2 #define IDR_EAP_KEY_PRIVATE 2
///
/// \defgroup EAPBaseStream Memory Packaging
/// Simple serialization/deserialization of data to/from memory opaque BLOBs
///
/// @{
#ifndef EAP_ENCRYPT_BLOBS #ifndef EAP_ENCRYPT_BLOBS
///
/// Encrypt BLOBs leaving our module
///
#define EAP_ENCRYPT_BLOBS 1 #define EAP_ENCRYPT_BLOBS 1
#endif #endif
/// @}
///
/// \defgroup EAPBaseModule Modules
/// Modules
///
/// @{
#ifndef __DANGEROUS__LOG_CONFIDENTIAL_DATA #ifndef __DANGEROUS__LOG_CONFIDENTIAL_DATA
///
/// Output passwords and other confidential information to event log
///
#define __DANGEROUS__LOG_CONFIDENTIAL_DATA 0 #define __DANGEROUS__LOG_CONFIDENTIAL_DATA 0
#endif #endif
/// @}
///
/// \defgroup EAPBaseCred Credentials
/// Credential management
///
/// @{
#ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE #ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE
///
/// Use EapHost credential cache
///
#define EAP_USE_NATIVE_CREDENTIAL_CACHE 0 #define EAP_USE_NATIVE_CREDENTIAL_CACHE 0
#endif #endif
/// @}
#define _HOST_LOW_ENDIAN #define _HOST_LOW_ENDIAN
@@ -50,15 +77,19 @@
namespace eap namespace eap
{ {
///
/// Output BLOB cursor
///
struct cursor_out; struct cursor_out;
struct cursor_in;
class packable;
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_f;
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_zf;
/// ///
/// Input BLOB cursor /// \defgroup EAPBaseSanitizing Sanitizing memory
/// Secure memory erasing after use
/// ///
struct cursor_in; /// @{
/// ///
/// Sanitizing dynamically allocated BLOB /// Sanitizing dynamically allocated BLOB
@@ -66,17 +97,7 @@ namespace eap
typedef std::vector<unsigned char, winstd::sanitizing_allocator<unsigned char> > sanitizing_blob; typedef std::vector<unsigned char, winstd::sanitizing_allocator<unsigned char> > sanitizing_blob;
/// ///
/// Sanitizing BLOB of fixed size /// Sanitizing BLOB of fixed size (zero initialized in _DEBUG version, non-initialized in release version)
///
template<size_t N> struct sanitizing_blob_f;
///
/// Sanitizing BLOB of fixed size (zero initialized)
///
template<size_t N> struct sanitizing_blob_zf;
///
/// Sanitizing BLOB of fixed size (zero initialized in _DEBUG version)
/// ///
#ifdef _DEBUG #ifdef _DEBUG
#define sanitizing_blob_xf sanitizing_blob_zf #define sanitizing_blob_xf sanitizing_blob_zf
@@ -84,27 +105,55 @@ namespace eap
#define sanitizing_blob_xf sanitizing_blob_f #define sanitizing_blob_xf sanitizing_blob_f
#endif #endif
/// /// @}
/// Diameter AVP flags
/// /// \addtogroup EAPBaseDiameter
/// @{
enum diameter_avp_flags_t; enum diameter_avp_flags_t;
///
/// Diameter AVP header
///
struct diameter_avp_header; struct diameter_avp_header;
///
/// Diameter AVP header with Vendor-ID
///
struct diameter_avp_header_ven; struct diameter_avp_header_ven;
/// ///
/// EAP packet /// Appends Diameter AVP to response packet
/// ///
class packet; /// \param[in ] code AVP code
/// \param[in ] flags AVP flags
/// \param[in ] data AVP data (<16777212B)
/// \param[in ] size Size of \p data in bytes
/// \param[inout] packet Response packet to append data to
///
void diameter_avp_append(
_In_ unsigned int code,
_In_ unsigned char flags,
_In_bytecount_(size) const void *data,
_In_ unsigned int size,
_Inout_ sanitizing_blob &packet);
///
/// Appends Diameter AVP to response packet
///
/// \param[in ] code AVP code
/// \param[in ] vendor_id Vendor-ID
/// \param[in ] flags AVP flags
/// \param[in ] data AVP data (<16777212B)
/// \param[in ] size Size of \p data in bytes
/// \param[inout] packet Response packet to append data to
///
void diameter_avp_append(
_In_ unsigned int code,
_In_ unsigned int vendor_id,
_In_ unsigned char flags,
_In_bytecount_(size) const void *data,
_In_ unsigned int size,
_Inout_ sanitizing_blob &packet);
/// @}
} }
/// \addtogroup EAPBaseStream
/// @{
/// ///
/// Packs a boolean /// Packs a boolean
/// ///
@@ -213,7 +262,7 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ size_t &val);
/// \param[inout] cursor Memory cursor /// \param[inout] cursor Memory cursor
/// \param[in] val String to pack /// \param[in] val String to pack
/// ///
template<class _Elem, class _Traits, class _Ax> inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val); template<class _Traits, class _Ax> inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<char, _Traits, _Ax> &val);
/// ///
/// Returns packed size of a string /// Returns packed size of a string
@@ -222,7 +271,7 @@ template<class _Elem, class _Traits, class _Ax> inline void operator<<(_Inout_ e
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
template<class _Elem, class _Traits, class _Ax> inline size_t pksizeof(const std::basic_string<_Elem, _Traits, _Ax> &val); template<class _Traits, class _Ax> inline size_t pksizeof(_In_ const std::basic_string<char, _Traits, _Ax> &val);
/// ///
/// Unpacks a string /// Unpacks a string
@@ -230,7 +279,7 @@ template<class _Elem, class _Traits, class _Ax> inline size_t pksizeof(const std
/// \param[inout] cursor Memory cursor /// \param[inout] cursor Memory cursor
/// \param[out] val String to unpack to /// \param[out] val String to unpack to
/// ///
template<class _Elem, class _Traits, class _Ax> inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<_Elem, _Traits, _Ax> &val); template<class _Traits, class _Ax> inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<char, _Traits, _Ax> &val);
/// ///
/// Packs a wide string /// Packs a wide string
@@ -247,7 +296,7 @@ template<class _Traits, class _Ax> inline void operator<<(_Inout_ eap::cursor_ou
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
template<class _Traits, class _Ax> inline size_t pksizeof(const std::basic_string<wchar_t, _Traits, _Ax> &val); template<class _Traits, class _Ax> inline size_t pksizeof(_In_ const std::basic_string<wchar_t, _Traits, _Ax> &val);
/// ///
/// Unpacks a wide string /// Unpacks a wide string
@@ -272,7 +321,7 @@ template<class _Ty, class _Ax> inline void operator<<(_Inout_ eap::cursor_out &c
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
template<class _Ty, class _Ax> inline size_t pksizeof(const std::vector<_Ty, _Ax> &val); template<class _Ty, class _Ax> inline size_t pksizeof(_In_ const std::vector<_Ty, _Ax> &val);
/// ///
/// Unpacks a vector /// Unpacks a vector
@@ -297,7 +346,7 @@ template<class _Ty, class _Ax> inline void operator<<(_Inout_ eap::cursor_out &c
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
template<class _Ty, class _Ax> inline size_t pksizeof(const std::list<_Ty, _Ax> &val); template<class _Ty, class _Ax> inline size_t pksizeof(_In_ const std::list<_Ty, _Ax> &val);
/// ///
/// Unpacks a list /// Unpacks a list
@@ -322,16 +371,9 @@ template<class _Ty, class _Dx> inline void operator<<(_Inout_ eap::cursor_out &c
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
template<class _Ty, class _Dx> inline size_t pksizeof(const std::unique_ptr<_Ty, _Dx> &val); template<class _Ty, class _Dx> inline size_t pksizeof(_In_ const std::unique_ptr<_Ty, _Dx> &val);
///// // std::unique_ptr<> is generally not unpackable, since we do not know, how to create a new instance of unique_ptr.
///// Unpacks a std::unique_ptr
/////
///// \note Not generally unpackable, since we do not know, how to create a new instance of unique_ptr.
/////
///// \param[inout] cursor Memory cursor
///// \param[out] val std::unique_ptr to unpack to
/////
//template<class _Ty, class _Dx> inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::unique_ptr<_Ty, _Dx> &val); //template<class _Ty, class _Dx> inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::unique_ptr<_Ty, _Dx> &val);
/// ///
@@ -349,7 +391,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const winstd::cert_
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
inline size_t pksizeof(const winstd::cert_context &val); inline size_t pksizeof(_In_ const winstd::cert_context &val);
/// ///
/// Unpacks a certificate context /// Unpacks a certificate context
@@ -374,7 +416,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const winstd::eap_t
/// ///
/// \returns Size of data when packed (in bytes) /// \returns Size of data when packed (in bytes)
/// ///
inline size_t pksizeof(const winstd::eap_type_t &val); inline size_t pksizeof(_In_ const winstd::eap_type_t &val);
/// ///
/// Unpacks an EAP method type /// Unpacks an EAP method type
@@ -434,6 +476,64 @@ inline size_t pksizeof(_In_ const GUID &val);
/// ///
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ GUID &val); inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ GUID &val);
///
/// Packs a EAP_METHOD_TYPE
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Variable with data to pack
///
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const EAP_METHOD_TYPE &val);
///
/// Returns packed size of a EAP_METHOD_TYPE
///
/// \param[in] val Data to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t pksizeof(_In_ const EAP_METHOD_TYPE &val);
///
/// Unpacks a EAP_METHOD_TYPE
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Variable to receive unpacked value
///
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);
/// @}
///
/// \defgroup EAPBaseConversion Data conversion
/// Data conversion
///
/// @{
#ifndef htonll #ifndef htonll
/// ///
/// Converts an unsigned __int64 from host to TCP/IP network byte order. /// Converts an unsigned __int64 from host to TCP/IP network byte order.
@@ -446,15 +546,15 @@ inline unsigned __int64 htonll(unsigned __int64 val);
#endif #endif
/// ///
/// Converts an 24-bit integer from host to TCP/IP network byte order. /// Converts a 24-bit integer from host to TCP/IP network byte order.
/// ///
/// \param[in ] val A 24-bit unsigned number in host byte order /// \param[in ] val A 24-bit unsigned number in host byte order
/// \param[out] out A 24-bit unsigned number in network byte order /// \param[out] out A 24-bit unsigned number in network byte order
/// ///
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3]); inline void hton24(_In_ unsigned int val, _Out_writes_(3) unsigned char out[3]);
/// ///
/// Converts an 24-bit integer from TCP/IP network to host byte order. /// Converts a 24-bit integer from TCP/IP network to host byte order.
/// ///
/// \param[in] val A 24-bit unsigned number in network byte order /// \param[in] val A 24-bit unsigned number in network byte order
/// ///
@@ -462,13 +562,24 @@ inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3]);
/// ///
inline unsigned int ntoh24(_In_ const unsigned char val[3]); inline unsigned int ntoh24(_In_ const unsigned char val[3]);
/// @}
#pragma once #pragma once
namespace eap namespace eap
{ {
/// \addtogroup EAPBaseStream
/// @{
///
/// Output BLOB cursor
///
struct cursor_out struct cursor_out
{ {
///
/// Pointer to output data type
///
typedef unsigned char *ptr_type; typedef unsigned char *ptr_type;
ptr_type ptr; ///< Pointer to first data unwritten ptr_type ptr; ///< Pointer to first data unwritten
@@ -476,8 +587,14 @@ namespace eap
}; };
///
/// Input BLOB cursor
///
struct cursor_in struct cursor_in
{ {
///
/// Pointer to input data type
///
typedef const unsigned char *ptr_type; typedef const unsigned char *ptr_type;
ptr_type ptr; ///< Pointer to first data unread ptr_type ptr; ///< Pointer to first data unread
@@ -485,17 +602,65 @@ namespace eap
}; };
///
/// 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
/// @{
#pragma pack(push) #pragma pack(push)
#pragma pack(1) #pragma pack(1)
template<size_t N> ///
struct __declspec(novtable) sanitizing_blob_f /// Sanitizing BLOB of fixed size
///
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_f
{ {
unsigned char data[N]; ///< BLOB data unsigned char data[N]; ///< BLOB data
/// ///
/// Constructor /// Constructor
/// ///
/// Note: This constructor does not initialize data. Use sanitizing_blob_zf class when zero-initialization is required.
///
#pragma warning(suppress: 26495)
inline sanitizing_blob_f() inline sanitizing_blob_f()
{ {
} }
@@ -515,7 +680,7 @@ namespace eap
/// ///
/// \param[inout] other BLOB to move from /// \param[inout] other BLOB to move from
/// ///
inline sanitizing_blob_f(_Inout_ sanitizing_blob_f<N> &&other) inline sanitizing_blob_f(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{ {
memcpy(data, other.data, N); memcpy(data, other.data, N);
} }
@@ -525,7 +690,7 @@ namespace eap
/// ///
/// \param[inout] other Zero-initialized BLOB to move from /// \param[inout] other Zero-initialized BLOB to move from
/// ///
inline sanitizing_blob_f(_Inout_ sanitizing_blob_zf<N> &&other) inline sanitizing_blob_f(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{ {
memcpy(data, other.data, N); memcpy(data, other.data, N);
memset(other.data, 0, N); memset(other.data, 0, N);
@@ -560,7 +725,7 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_f<N> &&other) inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{ {
if (this != std::addressof(other)) if (this != std::addressof(other))
memcpy(data, other.data, N); memcpy(data, other.data, N);
@@ -574,7 +739,7 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_zf<N> &&other) inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{ {
if (this != std::addressof(other)) { if (this != std::addressof(other)) {
memcpy(data, other.data, N); memcpy(data, other.data, N);
@@ -636,8 +801,11 @@ namespace eap
} }
}; };
template<size_t N>
struct __declspec(novtable) sanitizing_blob_zf : sanitizing_blob_f<N> ///
/// Sanitizing BLOB of fixed size (zero initialized)
///
template<size_t N> struct WINSTD_NOVTABLE sanitizing_blob_zf : sanitizing_blob_f<N>
{ {
/// ///
/// Constructor /// Constructor
@@ -662,7 +830,7 @@ namespace eap
/// ///
/// \param[inout] other Zero-initialized BLOB to move from /// \param[inout] other Zero-initialized BLOB to move from
/// ///
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_zf<N> &&other) : inline sanitizing_blob_zf(_Inout_ sanitizing_blob_zf<N> &&other) noexcept :
sanitizing_blob_f<N>(std::move(other)) sanitizing_blob_f<N>(std::move(other))
{ {
memset(other.data, 0, N); memset(other.data, 0, N);
@@ -683,7 +851,7 @@ namespace eap
/// ///
/// \param[inout] other BLOB to move from /// \param[inout] other BLOB to move from
/// ///
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_f<N> &&other) : inline sanitizing_blob_zf(_Inout_ sanitizing_blob_f<N> &&other) noexcept :
sanitizing_blob_f<N>(std::move(other)) sanitizing_blob_f<N>(std::move(other))
{ {
} }
@@ -709,7 +877,7 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_zf<N> &&other) inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{ {
if (this != std::addressof(other)) { if (this != std::addressof(other)) {
memcpy(data, other.data, N); memcpy(data, other.data, N);
@@ -739,7 +907,7 @@ namespace eap
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_f<N> &&other) inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{ {
if (this != std::addressof(other)) if (this != std::addressof(other))
memcpy(data, other.data, N); memcpy(data, other.data, N);
@@ -748,7 +916,17 @@ namespace eap
}; };
#pragma pack(pop) #pragma pack(pop)
/// @}
///
/// \defgroup EAPBaseDiameter Diameter
/// Diameter authentication protocol
///
/// @{
///
/// Diameter AVP flags
///
#pragma warning(suppress: 4480) #pragma warning(suppress: 4480)
enum diameter_avp_flags_t : unsigned char { enum diameter_avp_flags_t : unsigned char {
diameter_avp_flag_vendor = 0x80, ///< Vendor-ID present diameter_avp_flag_vendor = 0x80, ///< Vendor-ID present
@@ -760,6 +938,9 @@ namespace eap
#pragma pack(push) #pragma pack(push)
#pragma pack(1) #pragma pack(1)
///
/// Diameter AVP header
///
struct diameter_avp_header struct diameter_avp_header
{ {
unsigned char code[4]; ///< AVP Code unsigned char code[4]; ///< AVP Code
@@ -768,6 +949,9 @@ namespace eap
}; };
///
/// Diameter AVP header with Vendor-ID
///
struct diameter_avp_header_ven : public diameter_avp_header struct diameter_avp_header_ven : public diameter_avp_header
{ {
unsigned char vendor[4]; ///< Vendor-ID unsigned char vendor[4]; ///< Vendor-ID
@@ -775,57 +959,7 @@ namespace eap
#pragma pack(pop) #pragma pack(pop)
/// @}
class packet
{
public:
///
/// Constructs an empty packet
///
packet();
///
/// Copies a packet
///
/// \param[in] other Packet to copy from
///
packet(_In_ const packet &other);
///
/// Moves a packet
///
/// \param[in] other Packet to move from
///
packet(_Inout_ packet &&other);
///
/// Copies a packet
///
/// \param[in] other Packet to copy from
///
/// \returns Reference to this object
///
packet& operator=(_In_ const packet &other);
///
/// Moves a packet
///
/// \param[in] other Packet to move from
///
/// \returns Reference to this object
///
packet& operator=(_Inout_ packet &&other);
///
/// Empty the packet
///
virtual void clear();
public:
EapCode m_code; ///< Packet code
unsigned char m_id; ///< Packet ID
sanitizing_blob m_data; ///< Packet data
};
} }
@@ -931,59 +1065,66 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ size_t &val)
#endif #endif
template<class _Elem, class _Traits, class _Ax> template<class _Traits, class _Ax>
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val) inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<char, _Traits, _Ax> &val)
{ {
size_t count = val.length(); size_t count = val.length();
assert(strlen(val.c_str()) == count); // String should not contain zero terminators. assert(strlen(val.c_str()) == count); // String should not contain zero terminators.
size_t size = sizeof(_Elem)*(count + 1); size_t size = sizeof(char)*(count + 1);
auto ptr_end = cursor.ptr + size; auto ptr_end = cursor.ptr + size;
assert(ptr_end <= cursor.ptr_end); assert(ptr_end <= cursor.ptr_end);
memcpy(cursor.ptr, (const _Elem*)val.c_str(), size); memcpy(cursor.ptr, (const char*)val.c_str(), size);
cursor.ptr = ptr_end; cursor.ptr = ptr_end;
} }
template<class _Elem, class _Traits, class _Ax> template<class _Traits, class _Ax>
inline size_t pksizeof(const std::basic_string<_Elem, _Traits, _Ax> &val) inline size_t pksizeof(_In_ const std::basic_string<char, _Traits, _Ax> &val)
{ {
return sizeof(_Elem)*(val.length() + 1); return sizeof(char)*(val.length() + 1);
} }
template<class _Elem, class _Traits, class _Ax> template<class _Traits, class _Ax>
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<_Elem, _Traits, _Ax> &val) inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<char, _Traits, _Ax> &val)
{ {
size_t count_max = cursor.ptr_end - cursor.ptr; size_t count_max = cursor.ptr_end - cursor.ptr;
size_t count = strnlen((const _Elem*&)cursor.ptr, count_max); size_t count = strnlen((const char*)cursor.ptr, count_max);
assert(count < count_max); // String should be zero terminated. assert(count < count_max); // String should be zero terminated.
val.assign((const _Elem*&)cursor.ptr, count); val.assign((const char*)cursor.ptr, count);
cursor.ptr += sizeof(_Elem)*(count + 1); cursor.ptr += sizeof(char)*(count + 1);
} }
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val) inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val)
{ {
std::string val_utf8; size_t count = val.length();
WideCharToMultiByte(CP_UTF8, 0, val, val_utf8, NULL, NULL); assert(wcslen(val.c_str()) == count); // String should not contain zero terminators.
cursor << val_utf8; size_t size_max = cursor.ptr_end - cursor.ptr;
assert(size_max <= INT_MAX);
size_t size = WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)count, (char*)cursor.ptr, (int)size_max, NULL, NULL);
assert(!count && !size || count && size);
cursor.ptr += size;
cursor << (unsigned char)0;
} }
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
inline size_t pksizeof(const std::basic_string<wchar_t, _Traits, _Ax> &val) inline size_t pksizeof(_In_ const std::basic_string<wchar_t, _Traits, _Ax> &val)
{ {
return sizeof(char)*(WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), NULL, 0, NULL, NULL) + 1); return sizeof(char)*(WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), NULL, 0, NULL, NULL)) + sizeof(char);
} }
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &val) inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &val)
{ {
std::string val_utf8; size_t count_max = cursor.ptr_end - cursor.ptr;
cursor >> val_utf8; size_t count = strnlen((const char*)cursor.ptr, count_max);
MultiByteToWideChar(CP_UTF8, 0, val_utf8, val); assert(count < count_max); // String should be zero terminated.
MultiByteToWideChar(CP_UTF8, 0, (const char*)cursor.ptr, (int)count, val);
cursor.ptr += sizeof(char)*(count + 1);
} }
@@ -1001,7 +1142,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::vector<_
template<class _Ty, class _Ax> template<class _Ty, class _Ax>
inline size_t pksizeof(const std::vector<_Ty, _Ax> &val) inline size_t pksizeof(_In_ const std::vector<_Ty, _Ax> &val)
{ {
// Since we do not know wheter vector elements are primitives or objects, iterate instead of sizeof(). // Since we do not know wheter vector elements are primitives or objects, iterate instead of sizeof().
// For performance critical vectors of flat opaque data types write specialized template instantiation. // For performance critical vectors of flat opaque data types write specialized template instantiation.
@@ -1045,7 +1186,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::list<_Ty
template<class _Ty, class _Ax> template<class _Ty, class _Ax>
inline size_t pksizeof(const std::list<_Ty, _Ax> &val) inline size_t pksizeof(_In_ const std::list<_Ty, _Ax> &val)
{ {
// Since we do not know wheter list elements are primitives or objects, iterate instead of sizeof(). // Since we do not know wheter list elements are primitives or objects, iterate instead of sizeof().
// For performance critical vectors of flat opaque data types write specialized template instantiation. // For performance critical vectors of flat opaque data types write specialized template instantiation.
@@ -1084,7 +1225,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::unique_p
template<class _Ty, class _Dx> template<class _Ty, class _Dx>
inline size_t pksizeof(const std::unique_ptr<_Ty, _Dx> &val) inline size_t pksizeof(_In_ const std::unique_ptr<_Ty, _Dx> &val)
{ {
return return
val ? val ?
@@ -1110,7 +1251,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const winstd::cert_
} }
inline size_t pksizeof(const winstd::cert_context &val) inline size_t pksizeof(_In_ const winstd::cert_context &val)
{ {
return return
val ? val ?
@@ -1129,7 +1270,7 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_contex
cursor >> (unsigned int&)dwCertEncodingType; cursor >> (unsigned int&)dwCertEncodingType;
DWORD dwCertEncodedSize; DWORD dwCertEncodedSize;
assert(sizeof(dwCertEncodingType) == sizeof(unsigned int)); assert(sizeof(dwCertEncodedSize) == sizeof(unsigned int));
cursor >> (unsigned int&)dwCertEncodedSize; cursor >> (unsigned int&)dwCertEncodedSize;
if (dwCertEncodedSize) { if (dwCertEncodedSize) {
@@ -1214,6 +1355,49 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ GUID &val)
} }
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const EAP_METHOD_TYPE &val)
{
auto ptr_end = cursor.ptr + sizeof(EAP_METHOD_TYPE);
assert(ptr_end <= cursor.ptr_end);
memcpy(cursor.ptr, &val, sizeof(EAP_METHOD_TYPE));
cursor.ptr = ptr_end;
}
inline size_t pksizeof(_In_ const EAP_METHOD_TYPE &val)
{
UNREFERENCED_PARAMETER(val);
return sizeof(EAP_METHOD_TYPE);
}
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ EAP_METHOD_TYPE &val)
{
auto ptr_end = cursor.ptr + sizeof(EAP_METHOD_TYPE);
assert(ptr_end <= cursor.ptr_end);
memcpy(&val, cursor.ptr, sizeof(EAP_METHOD_TYPE));
cursor.ptr = ptr_end;
}
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)
@@ -1226,7 +1410,7 @@ inline unsigned __int64 htonll(unsigned __int64 val)
#endif #endif
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3]) inline void hton24(_In_ unsigned int val, _Out_writes_(3) unsigned char out[3])
{ {
assert(val <= 0xffffff); assert(val <= 0xffffff);
out[0] = (val >> 16) & 0xff; out[0] = (val >> 16) & 0xff;

View File

@@ -29,39 +29,531 @@
namespace eapxml namespace eapxml
{ {
///
/// \defgroup EAPBaseXML XML DOM
/// Easy interaction with MSXML
///
/// @{
///
/// Returns owner document object for a given node
///
/// \param[in ] pXmlNode XML node
/// \param[out] ppXmlDoc XML document
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_document(_In_ IXMLDOMNode *pXmlNode, _Out_ winstd::com_obj<IXMLDOMDocument2> &ppXmlDoc); inline HRESULT get_document(_In_ IXMLDOMNode *pXmlNode, _Out_ winstd::com_obj<IXMLDOMDocument2> &ppXmlDoc);
///
/// Selects single child node by name
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrNodeName XML node selection name
/// \param[out] ppXmlNode Child XML node found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT select_node(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ winstd::com_obj<IXMLDOMNode> &ppXmlNode); inline HRESULT select_node(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ winstd::com_obj<IXMLDOMNode> &ppXmlNode);
///
/// Selects child nodes by name
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrNodeName XML node selection name
/// \param[out] ppXmlNodes List of child XML nodes found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT select_nodes(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ winstd::com_obj<IXMLDOMNodeList> &ppXmlNodes); inline HRESULT select_nodes(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ winstd::com_obj<IXMLDOMNodeList> &ppXmlNodes);
///
/// Selects single child element by name
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT select_element(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement); inline HRESULT select_element(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement);
///
/// Creates a new element
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT create_element(_In_ IXMLDOMDocument *pDoc, _In_z_ const BSTR bstrElementName, _In_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement); inline HRESULT create_element(_In_ IXMLDOMDocument *pDoc, _In_z_ const BSTR bstrElementName, _In_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement);
///
/// Creates a new child element if not already present
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementNameSelect XML element selection name
/// \param[in ] bstrElementNameCreate XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[out] ppXmlElement XML element found or created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT create_element(_In_ IXMLDOMDocument *pDoc, IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementNameSelect, _In_z_ const BSTR bstrElementNameCreate, _In_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement); inline HRESULT create_element(_In_ IXMLDOMDocument *pDoc, IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementNameSelect, _In_z_ const BSTR bstrElementNameCreate, _In_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement);
///
/// Tests if node has a parent set
///
/// \param[in] pXmlNode XML node
///
/// \returns
/// - Non zero when \p pXmlNode has a parent set;
/// - Zero otherwise.
///
inline bool has_parent(_In_ IXMLDOMNode *pXmlNode); inline bool has_parent(_In_ IXMLDOMNode *pXmlNode);
///
/// Returns child element text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] pbstrValue XML element text
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ winstd::bstr &pbstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ winstd::bstr &pbstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] sValue XML element text
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Traits, class _Ax> inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); template<class _Traits, class _Ax> inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element text converted to number
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] pdwValue XML element text converted to number
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ DWORD &pdwValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ DWORD &pdwValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element text converted to boolean
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] pbValue XML element text converted to boolean
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ bool &pbValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ bool &pbValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element BLOB encoded as Base64 text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] aValue XML element BLOB
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Ty, class _Ax> inline HRESULT get_element_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); template<class _Ty, class _Ax> inline HRESULT get_element_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element BLOB encoded as hexadecimal text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[out] aValue XML element BLOB
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Ty, class _Ax> inline HRESULT get_element_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); template<class _Ty, class _Ax> inline HRESULT get_element_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element localizable text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[in ] pszLang Desired localization
/// \param[out] pbstrValue XML element text
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ winstd::bstr &pbstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ winstd::bstr &pbstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns child element localizable text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrElementName XML element selection name
/// \param[in ] pszLang Desired localization
/// \param[out] sValue XML element text
/// \param[out] ppXmlElement Child XML element found
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Traits, class _Ax> inline HRESULT get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); template<class _Traits, class _Ax> inline HRESULT get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Creates a new child element
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement); inline HRESULT put_element(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _Out_ winstd::com_obj<IXMLDOMElement> &ppXmlElement);
///
/// Creates a new child element with text
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[in ] bstrValue XML element text
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_z_ const BSTR bstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_z_ const BSTR bstrValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Creates a new child element with text converted from number
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[in ] dwValue XML element number
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ DWORD dwValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ DWORD dwValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Creates a new child element with text converted from boolean
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[in ] bValue XML element boolean
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ bool bValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ bool bValue, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL); ///
/// Creates a new child element with Base64 encoded text from BLOB
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[in ] pValue Pointer to BLOB data
/// \param[in ] nValueLen Size of \p pValue in bytes
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Creates a new child element with hexadecimal encoded text from BLOB
///
/// \param[in ] pDoc Owner XML document
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrElementName XML element name
/// \param[in ] bstrNamespace XML element namespace
/// \param[in ] pValue Pointer to BLOB data
/// \param[in ] nValueLen Size of \p pValue in bytes
/// \param[out] ppXmlElement XML element created
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns attribute text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] pbstrValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ winstd::bstr &pbstrValue); inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ winstd::bstr &pbstrValue);
///
/// Returns attribute text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] sValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Traits, class _Ax> inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue); template<class _Traits, class _Ax> inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue);
///
/// Returns attribute text converted to number
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] pdwValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ DWORD &pdwValue); inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ DWORD &pdwValue);
///
/// Returns attribute text converted to boolean
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] pbValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool &pbValue); inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool &pbValue);
///
/// Returns attribute BLOB converted from Base64 encoded text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] aValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Ty, class _Ax> inline HRESULT get_attrib_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue); template<class _Ty, class _Ax> inline HRESULT get_attrib_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue);
///
/// Returns attribute BLOB converted from hexadecimal encoded text
///
/// \param[in ] pXmlParent Parent XML node
/// \param[in ] bstrAttributeName XML attribute selection name
/// \param[out] aValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
template<class _Ty, class _Ax> inline HRESULT get_attrib_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue); template<class _Ty, class _Ax> inline HRESULT get_attrib_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue);
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_z_ const BSTR bstrValue);
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ DWORD dwValue); ///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ bool bValue); /// Sets node attribute
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen); ///
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen); /// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrAttributeName XML attribute name
/// \param[out] bstrValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_z_ const BSTR bstrValue);
///
/// Sets node attribute converted from number
///
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrAttributeName XML attribute name
/// \param[out] dwValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ DWORD dwValue);
///
/// Sets node attribute converted from boolean
///
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrAttributeName XML attribute name
/// \param[out] bValue XML atribute value
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ bool bValue);
///
/// Sets node attribute to Base64 encoded text from BLOB
///
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrAttributeName XML attribute name
/// \param[in ] pValue Pointer to BLOB data
/// \param[in ] nValueLen Size of \p pValue in bytes
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
///
/// Sets node attribute to hexadecimal encoded text from BLOB
///
/// \param[in ] pCurrentDOMNode Parent XML node
/// \param[in ] bstrAttributeName XML attribute name
/// \param[in ] pValue Pointer to BLOB data
/// \param[in ] nValueLen Size of \p pValue in bytes
///
/// \returns
/// - >0 if succeeded with warnings;
/// - =0 (\c S_OK) if successful;
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
///
/// Builds XPath for a given node
///
/// \param[in] pXmlNode XML node
///
/// \returns String with XPath for a given node up to node terminal parent
///
inline std::wstring get_xpath(_In_ IXMLDOMNode *pXmlNode); inline std::wstring get_xpath(_In_ IXMLDOMNode *pXmlNode);
/// @}
} }
#pragma once #pragma once
@@ -294,7 +786,7 @@ namespace eapxml
pbstrValue = std::move(bstrEn); pbstrValue = std::move(bstrEn);
return S_OK; return S_OK;
} else } else
return ERROR_NOT_FOUND; return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
} }
winstd::com_obj<IXMLDOMNode> pXmlElLocalizedText; winstd::com_obj<IXMLDOMNode> pXmlElLocalizedText;
@@ -339,7 +831,6 @@ namespace eapxml
{ {
assert(pDoc); assert(pDoc);
assert(pCurrentDOMNode); assert(pCurrentDOMNode);
assert(ppXmlElement);
static const VARIANT varNodeTypeEl = { VT_I4, 0, 0, 0, { NODE_ELEMENT } }; static const VARIANT varNodeTypeEl = { VT_I4, 0, 0, 0, { NODE_ELEMENT } };
HRESULT hr; HRESULT hr;
@@ -386,7 +877,7 @@ namespace eapxml
} }
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement) inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
{ {
std::wstring sBase64; std::wstring sBase64;
winstd::base64_enc enc; winstd::base64_enc enc;
@@ -395,7 +886,7 @@ namespace eapxml
} }
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement) inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
{ {
std::wstring sHex; std::wstring sHex;
winstd::hex_enc enc; winstd::hex_enc enc;
@@ -444,8 +935,6 @@ namespace eapxml
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool &pbValue) inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool &pbValue)
{ {
assert(pbValue);
winstd::bstr bstr; winstd::bstr bstr;
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, bstr); HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, bstr);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
@@ -520,7 +1009,7 @@ namespace eapxml
} }
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen) inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
{ {
std::wstring sBase64; std::wstring sBase64;
winstd::base64_enc enc; winstd::base64_enc enc;
@@ -529,7 +1018,7 @@ namespace eapxml
} }
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen) inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
{ {
std::wstring sHex; std::wstring sHex;
winstd::hex_enc enc; winstd::hex_enc enc;

View File

@@ -20,15 +20,9 @@
namespace eap namespace eap
{ {
///
/// EAP and non-EAP method base class
///
class method; class method;
class method_tunnel;
/// class method_eap;
/// Non-EAP method base class
///
class method_noneap;
} }
#pragma once #pragma once
@@ -49,37 +43,44 @@ extern "C" {
namespace eap namespace eap
{ {
///
/// \defgroup EAPBaseMethod Methods
/// Methods
///
/// @{
///
/// Method base class
///
class method class method
{ {
WINSTD_NONCOPYABLE(method) WINSTD_NONCOPYABLE(method)
public: public:
/// ///
/// Constructs an EAP method /// Constructs a method
/// ///
/// \param[in] mod EAP module to use for global services /// \param[in] mod Module to use for global services
/// \param[in] cfg Method configuration
/// \param[in] cred User credentials
/// ///
method(_In_ module &module, _In_ config_method &cfg, _In_ credentials &cred); method(_In_ module &mod);
/// ///
/// Moves an EAP method /// Moves a method
/// ///
/// \param[in] other EAP method to move from /// \param[in] other Method to move from
/// ///
method(_Inout_ method &&other); method(_Inout_ method &&other) noexcept;
/// ///
/// Moves an EAP method /// Moves a method
/// ///
/// \param[in] other EAP method to move from /// \param[in] other Method to move from
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
method& operator=(_Inout_ method &&other); method& operator=(_Inout_ method &&other) noexcept;
/// \name Packet processing /// \name Session management
/// @{ /// @{
/// ///
@@ -87,6 +88,11 @@ namespace eap
/// ///
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx) /// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
/// ///
/// \param[in] dwFlags A combination of EAP flags that describe the new EAP authentication session behavior.
/// \param[in] pAttributeArray A pointer to an array structure that specifies the EAP attributes of the entity to authenticate.
/// \param[in] hTokenImpersonateUser Specifies a handle to the user impersonation token to use in this session.
/// \param[in] dwMaxSendPacketSize Specifies the maximum size in bytes of an EAP packet sent during the session. If the method needs to send a packet larger than the maximum size, the method must accommodate fragmentation and reassembly.
///
virtual void begin_session( virtual void begin_session(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ const EapAttributes *pAttributeArray, _In_ const EapAttributes *pAttributeArray,
@@ -100,111 +106,266 @@ namespace eap
/// ///
virtual void end_session(); virtual void end_session();
/// @}
/// \name Packet processing
/// @{
/// ///
/// Processes a packet received by EapHost from a supplicant. /// Processes a packet received by EapHost from a supplicant.
/// ///
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx) /// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
/// ///
virtual void process_request_packet( /// \param[in] pReceivedPacket Received packet data
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket, /// \param[in] dwReceivedPacketSize \p pReceivedPacket size in bytes
_In_ DWORD dwReceivedPacketSize, ///
_Out_ EapPeerMethodOutput *pEapOutput) = 0; /// \returns Action peer wants EapHost to do next.
///
virtual EapPeerMethodResponseAction process_request_packet(
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
_In_ DWORD dwReceivedPacketSize) = 0;
/// ///
/// Obtains a response packet from the EAP method. /// Obtains a response packet from the EAP method.
/// ///
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx) /// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
/// ///
/// \param[out] packet Response packet
/// \param[in] size_max The maximum size in bytes \p packet must not exceed. If the method needs to send a packet larger than the maximum size, the method must accommodate fragmentation and reassembly.
///
virtual void get_response_packet( virtual void get_response_packet(
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket, _Out_ sanitizing_blob &packet,
_Inout_ DWORD *pdwSendPacketSize) = 0; _In_opt_ DWORD size_max = MAXDWORD) = 0;
/// @}
/// ///
/// Obtains the result of an authentication session from the EAP method. /// Obtains the result of an authentication session from the EAP method.
/// ///
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx) /// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
/// ///
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[inout] pResult A pointer to a structure that contains the authentication results.
///
virtual void get_result( virtual void get_result(
_In_ EapPeerMethodResultReason reason, _In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult); _Inout_ EapPeerMethodResult *pResult);
/// \name User Interaction
/// @{
///
/// Obtains the user interface context from the EAP method.
///
/// \note This function is always followed by the `EapPeerInvokeInteractiveUI()` function, which is followed by the `EapPeerSetUIContext()` function.
///
/// \sa [EapPeerGetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363612.aspx)
///
/// \param[out] context_data Supplicant user interface context data from EAPHost.
///
virtual void get_ui_context(_Out_ sanitizing_blob &context_data);
///
/// Provides a user interface context to the EAP method.
///
/// \note This function is called after the UI has been raised through the `EapPeerGetUIContext()` function.
///
/// \sa [EapPeerSetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363626.aspx)
///
/// \param[in] pUIContextData A pointer to an address that contains a byte buffer with the new supplicant UI context data to set on EAPHost.
/// \param[in] dwUIContextDataSize \p pUIContextData size in bytes
///
/// \returns Action peer wants EapHost to do next.
///
virtual EapPeerMethodResponseAction set_ui_context(
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ DWORD dwUIContextDataSize);
/// @}
/// \name EAP Response Attributes
/// @{
///
/// Obtains an array of EAP response attributes from the EAP method.
///
/// \sa [EapPeerGetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363609.aspx)
///
/// \param[out] pAttribs A pointer to a structure that contains an array of EAP authentication response attributes for the supplicant.
///
virtual void get_response_attributes(_Out_ EapAttributes *pAttribs);
///
/// Provides an updated array of EAP response attributes to the EAP method.
///
/// \sa [EapPeerSetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363625.aspx)
///
/// \param[in] pAttribs A pointer to a structure that contains an array of new EAP authentication response attributes to set for the supplicant on EAPHost.
///
/// \returns Action peer wants EapHost to do next.
///
virtual EapPeerMethodResponseAction set_response_attributes(_In_ const EapAttributes *pAttribs);
/// @} /// @}
public: public:
module &m_module; ///< EAP module module &m_module; ///< Module for global services
config_method &m_cfg; ///< Connection configuration
credentials &m_cred; ///< User credentials
std::vector<winstd::eap_attr> m_eap_attr; ///< EAP attributes
}; };
class method_noneap : public method ///
/// Tunnel method base class
///
/// This is a base class for all the methods that encapsulate inner methods to provide stacking framework.
///
class method_tunnel : public method
{ {
WINSTD_NONCOPYABLE(method_noneap) WINSTD_NONCOPYABLE(method_tunnel)
public: public:
/// ///
/// Constructs an EAP method /// Constructs a method
/// ///
/// \param[in] mod EAP module to use for global services /// \param[in] mod Module to use for global services
/// \param[in] cfg Method configuration /// \param[in] inner Inner method
/// \param[in] cred User credentials
/// ///
method_noneap(_In_ module &module, _In_ config_method &cfg, _In_ credentials &cred); method_tunnel(_In_ module &mod, _In_ method *inner);
/// ///
/// Moves an EAP method /// Moves a method
/// ///
/// \param[in] other EAP method to move from /// \param[in] other Method to move from
/// ///
method_noneap(_Inout_ method_noneap &&other); method_tunnel(_Inout_ method_tunnel &&other) noexcept;
/// ///
/// Moves an EAP method /// Moves a method
/// ///
/// \param[in] other EAP method to move from /// \param[in] other Method to move from
/// ///
/// \returns Reference to this object /// \returns Reference to this object
/// ///
method_noneap& operator=(_Inout_ method_noneap &&other); method_tunnel& operator=(_Inout_ method_tunnel &&other) noexcept;
/// \name Session management
/// @{
virtual void begin_session(
_In_ DWORD dwFlags,
_In_ const EapAttributes *pAttributeArray,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ DWORD dwMaxSendPacketSize = MAXDWORD);
virtual void end_session();
/// @}
/// \name Packet processing /// \name Packet processing
/// @{ /// @{
/// virtual EapPeerMethodResponseAction process_request_packet(
/// Obtains a response packet from the EAP method. _In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
/// _In_ DWORD dwReceivedPacketSize);
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
///
virtual void get_response_packet( virtual void get_response_packet(
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket, _Out_ sanitizing_blob &packet,
_Inout_ DWORD *pdwSendPacketSize); _In_opt_ DWORD size_max = MAXDWORD);
/// @}
virtual void get_result(
_In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult);
/// \name User Interaction
/// @{
virtual void get_ui_context(_Out_ sanitizing_blob &context_data);
virtual EapPeerMethodResponseAction set_ui_context(
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ DWORD dwUIContextDataSize);
/// @}
/// \name EAP Response Attributes
/// @{
virtual void get_response_attributes(_Out_ EapAttributes *pAttribs);
virtual EapPeerMethodResponseAction set_response_attributes(_In_ const EapAttributes *pAttribs);
/// @} /// @}
protected: protected:
std::unique_ptr<method> m_inner; ///< Inner method
};
///
/// EAP tunnel method
///
/// This method encapsulates inner data in EAP packets.
///
class method_eap : public method_tunnel
{
WINSTD_NONCOPYABLE(method_eap)
public:
/// ///
/// Appends Diameter AVP to response packet /// Constructs a method
/// ///
/// \param[in] code AVP code /// \param[in] mod Module to use for global services
/// \param[in] flags AVP flags /// \param[in] eap_method EAP method type
/// \param[in] data AVP data (<16777212B) /// \param[in] inner Inner method
/// \param[in] size Size of \p data in bytes
/// ///
void append_avp(_In_ unsigned int code, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size); method_eap(_In_ module &mod, _In_ winstd::eap_type_t eap_method, _In_ method *inner);
/// ///
/// Appends Diameter AVP to response packet /// Moves a method
/// ///
/// \param[in] code AVP code /// \param[in] other Method to move from
/// \param[in] vendor_id Vendor-ID
/// \param[in] flags AVP flags
/// \param[in] data AVP data (<16777212B)
/// \param[in] size Size of \p data in bytes
/// ///
void append_avp(_In_ unsigned int code, _In_ unsigned int vendor_id, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size); method_eap(_Inout_ method_eap &&other) noexcept;
///
/// Moves a method
///
/// \param[in] other Method to move from
///
/// \returns Reference to this object
///
method_eap& operator=(_Inout_ method_eap &&other) noexcept;
/// \name Session management
/// @{
virtual void begin_session(
_In_ DWORD dwFlags,
_In_ const EapAttributes *pAttributeArray,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ DWORD dwMaxSendPacketSize = MAXDWORD);
/// @}
/// \name Packet processing
/// @{
virtual EapPeerMethodResponseAction process_request_packet(
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
_In_ DWORD dwReceivedPacketSize);
virtual void get_response_packet(
_Out_ sanitizing_blob &packet,
_In_opt_ DWORD size_max = MAXDWORD);
/// @}
protected: protected:
sanitizing_blob m_packet_res; ///< Response packet const winstd::eap_type_t m_eap_method; ///< EAP method type
unsigned char m_id; ///< Request packet ID
bool m_send_nak; ///< Are we sending Legacy Nak response?
}; };
/// @}
} }

View File

@@ -20,18 +20,7 @@
namespace eap namespace eap
{ {
///
/// EAP module base class
///
/// Provides basic services to EAP methods.
///
class module; class module;
///
/// EAP peer base class
///
/// A group of methods all EAP peers must or should implement.
///
class peer; class peer;
} }
@@ -58,6 +47,14 @@ extern "C" {
namespace eap namespace eap
{ {
/// \addtogroup EAPBaseModule
/// @{
///
/// EAP module base class
///
/// Provides basic services to EAP methods.
///
class module class module
{ {
WINSTD_NONCOPYABLE(module) WINSTD_NONCOPYABLE(module)
@@ -88,23 +85,30 @@ namespace eap
/// ///
EAP_ERROR* make_error(_In_ std::exception &err) const; EAP_ERROR* make_error(_In_ std::exception &err) const;
///
/// Allocate a EAP_ERROR and fill it according to another EAP_ERROR
///
EAP_ERROR* make_error(_In_ const EAP_ERROR *err) const;
/// ///
/// Allocate BLOB /// Allocate BLOB
/// ///
BYTE* alloc_memory(_In_ size_t size); BYTE* alloc_memory(_In_ size_t size) const;
/// ///
/// Free BLOB allocated with this peer /// Free BLOB allocated with this peer
/// ///
void free_memory(_In_ BYTE *ptr); void free_memory(_In_ BYTE *ptr) const;
/// ///
/// Free EAP_ERROR allocated with `make_error()` method /// Free EAP_ERROR allocated with `make_error()` method
/// ///
void free_error_memory(_In_ EAP_ERROR *err); void free_error_memory(_In_ EAP_ERROR *err) const;
/// ///
/// Makes a new method config /// Makes a new method configuration
///
/// \returns New method configuration
/// ///
virtual config_method* make_config_method(); virtual config_method* make_config_method();
@@ -129,6 +133,7 @@ namespace eap
/// Writes EAPMETHOD_TRACE_EVT_FN_CALL and returns auto event writer class /// Writes EAPMETHOD_TRACE_EVT_FN_CALL and returns auto event writer class
/// ///
/// \param[in] pszFnName Function name /// \param[in] pszFnName Function name
/// \param[in] result Reference to function return variable
/// ///
/// \returns A new auto event writer that writes EAPMETHOD_TRACE_EVT_FN_RETURN_DWORD event on destruction /// \returns A new auto event writer that writes EAPMETHOD_TRACE_EVT_FN_RETURN_DWORD event on destruction
/// ///
@@ -142,6 +147,35 @@ namespace eap
/// ///
void log_error(_In_ const EAP_ERROR *err) const; void log_error(_In_ const EAP_ERROR *err) const;
///
/// Logs error and optionally returns EAP_ERROR
///
inline DWORD log_error(_Out_opt_ EAP_ERROR **eap_err, _In_ DWORD dwErrorCode, _In_opt_z_ LPCWSTR pszRootCauseString = NULL, _In_opt_z_ LPCWSTR pszRepairString = NULL, _In_opt_ DWORD dwReasonCode = 0, _In_opt_ LPCGUID pRootCauseGuid = NULL, _In_opt_ LPCGUID pRepairGuid = NULL, _In_opt_ LPCGUID pHelpLinkGuid = NULL) const
{
EAP_ERROR *e = make_error(dwErrorCode, pszRootCauseString, pszRepairString, dwReasonCode, pRootCauseGuid, pRepairGuid, pHelpLinkGuid);
log_error(e);
if (eap_err)
*eap_err = e;
else
free_error_memory(e);
return dwErrorCode;
}
///
/// Logs error and optionally returns EAP_ERROR
///
inline DWORD log_error(_Out_opt_ EAP_ERROR **eap_err, _In_ std::exception &err) const
{
EAP_ERROR *e = make_error(err);
log_error(e);
DWORD dwWinError = e->dwWinError;
if (eap_err)
*eap_err = e;
else
free_error_memory(e);
return dwWinError;
}
/// ///
/// Logs Unicode string config value /// Logs Unicode string config value
/// ///
@@ -223,6 +257,9 @@ namespace eap
/// ///
/// If \c _DEBUG is set the value is masked. /// If \c _DEBUG is set the value is masked.
/// ///
/// \param[in] name Variable name
/// \param[in] value Variable value
///
inline void log_config_discrete(_In_z_ LPCWSTR name, _In_z_ LPCWSTR value) const inline void log_config_discrete(_In_z_ LPCWSTR name, _In_z_ LPCWSTR value) const
{ {
#if __DANGEROUS__LOG_CONFIDENTIAL_DATA #if __DANGEROUS__LOG_CONFIDENTIAL_DATA
@@ -238,6 +275,10 @@ namespace eap
/// ///
/// If \c _DEBUG is set the value is masked. /// If \c _DEBUG is set the value is masked.
/// ///
/// \param[in] name Variable name
/// \param[in] data Variable data
/// \param[in] size \p data size in bytes
///
inline void log_config_discrete(_In_z_ LPCWSTR name, _In_bytecount_(size) const void *data, _In_ ULONG size) const inline void log_config_discrete(_In_z_ LPCWSTR name, _In_bytecount_(size) const void *data, _In_ ULONG size) const
{ {
#if __DANGEROUS__LOG_CONFIDENTIAL_DATA #if __DANGEROUS__LOG_CONFIDENTIAL_DATA
@@ -251,6 +292,8 @@ namespace eap
/// ///
/// Logs event /// Logs event
/// ///
/// \param[in] EventDescriptor Event descriptor
///
inline void log_event(_In_ PCEVENT_DESCRIPTOR EventDescriptor, ...) const inline void log_event(_In_ PCEVENT_DESCRIPTOR EventDescriptor, ...) const
{ {
va_list arg; va_list arg;
@@ -270,12 +313,11 @@ namespace eap
/// \param[in ] hProv Handle of cryptographics provider /// \param[in ] hProv Handle of cryptographics provider
/// \param[in ] data Pointer to data to encrypt /// \param[in ] data Pointer to data to encrypt
/// \param[in ] size Size of \p data in bytes /// \param[in ] size Size of \p data in bytes
/// \param[out] enc Encrypted data
/// \param[out] hHash Handle of hashing object /// \param[out] hHash Handle of hashing object
/// ///
/// \returns Encrypted data /// \returns Encrypted data
/// ///
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const; std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const;
/// ///
@@ -288,7 +330,7 @@ namespace eap
/// \returns Encrypted data /// \returns Encrypted data
/// ///
template<class _Elem, class _Traits, class _Ax> template<class _Elem, class _Traits, class _Ax>
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val, _Out_opt_ HCRYPTHASH hHash = NULL) const std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val, _In_opt_ HCRYPTHASH hHash = NULL) const
{ {
return encrypt(hProv, val.c_str(), val.length()*sizeof(_Elem), hHash); return encrypt(hProv, val.c_str(), val.length()*sizeof(_Elem), hHash);
} }
@@ -304,7 +346,7 @@ namespace eap
/// \returns Encrypted data /// \returns Encrypted data
/// ///
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val, _Out_opt_ HCRYPTHASH hHash = NULL) const std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val, _In_opt_ HCRYPTHASH hHash = NULL) const
{ {
winstd::sanitizing_string val_utf8; winstd::sanitizing_string val_utf8;
WideCharToMultiByte(CP_UTF8, 0, val, val_utf8, NULL, NULL); WideCharToMultiByte(CP_UTF8, 0, val, val_utf8, NULL, NULL);
@@ -367,13 +409,15 @@ namespace eap
/// \returns Decrypted data /// \returns Decrypted data
/// ///
template<class _Ty, class _Ax> template<class _Ty, class _Ax>
std::vector<_Ty, _Ax> decrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const std::vector<_Ty, _Ax> decrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{ {
// Import the private RSA key. // Import the private RSA key.
HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PRIVATE), RT_RCDATA); HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PRIVATE), RT_RCDATA);
assert(res); if (!res)
throw winstd::win_runtime_error(__FUNCTION__ " FindResource failed.");
HGLOBAL res_handle = LoadResource(m_instance, res); HGLOBAL res_handle = LoadResource(m_instance, res);
assert(res_handle); if (!res_handle)
throw winstd::win_runtime_error(__FUNCTION__ " LoadResource failed.");
winstd::crypt_key key_rsa; winstd::crypt_key key_rsa;
std::unique_ptr<unsigned char[], winstd::LocalFree_delete<unsigned char[]> > keyinfo_data; std::unique_ptr<unsigned char[], winstd::LocalFree_delete<unsigned char[]> > keyinfo_data;
DWORD keyinfo_size = 0; DWORD keyinfo_size = 0;
@@ -410,7 +454,7 @@ namespace eap
/// \returns Decrypted string /// \returns Decrypted string
/// ///
template<class _Elem, class _Traits, class _Ax> template<class _Elem, class _Traits, class _Ax>
std::basic_string<_Elem, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const std::basic_string<_Elem, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{ {
std::vector<_Elem, sanitizing_allocator<_Elem> > buf(std::move(decrypt(hProv, data, size, hHash))); std::vector<_Elem, sanitizing_allocator<_Elem> > buf(std::move(decrypt(hProv, data, size, hHash)));
return std::basic_string<_Elem, _Traits, _Ax>(buf.data(), buf.size()); return std::basic_string<_Elem, _Traits, _Ax>(buf.data(), buf.size());
@@ -428,7 +472,7 @@ namespace eap
/// \returns Decrypted string /// \returns Decrypted string
/// ///
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
std::basic_string<wchar_t, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const std::basic_string<wchar_t, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{ {
winstd::sanitizing_string buf(std::move(decrypt_str(hProv, data, size, hHash))); winstd::sanitizing_string buf(std::move(decrypt_str(hProv, data, size, hHash)));
std::basic_string<wchar_t, _Traits, _Ax> dec; std::basic_string<wchar_t, _Traits, _Ax> dec;
@@ -520,11 +564,6 @@ namespace eap
/// ///
/// \param[in ] pDataIn Pointer to encrypted BLOB /// \param[in ] pDataIn Pointer to encrypted BLOB
/// \param[in ] dwDataInSize Size of \p pDataIn /// \param[in ] dwDataInSize Size of \p pDataIn
/// \param[out ] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c true if succeeded
/// - \c false otherwise. See \p ppEapError for details.
/// ///
/// \returns Encrypted BLOB /// \returns Encrypted BLOB
/// ///
@@ -682,6 +721,11 @@ namespace eap
}; };
///
/// EAP peer base class
///
/// A group of methods all EAP peers must or should implement.
///
class peer : public module class peer : public module
{ {
WINSTD_NONCOPYABLE(peer) WINSTD_NONCOPYABLE(peer)
@@ -713,23 +757,43 @@ namespace eap
/// ///
/// \sa [EapPeerGetIdentity function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363607.aspx) /// \sa [EapPeerGetIdentity function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363607.aspx)
/// ///
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] pConnectionData Connection data used for the EAP method. If set to \c NULL, the static property of the method, as configured in the registry, is returned.
/// \param[in ] dwConnectionDataSize The size, in bytes, of the connection data buffer provided in \p pConnectionData.
/// \param[in ] pUserData A pointer to a byte buffer that contains the opaque user data BLOB. This parameter can be \c NULL.
/// \param[in ] dwUserDataSize The size, in bytes, of the user data buffer provided in \p pUserData.
/// \param[out] ppUserDataOut A pointer to a pointer to the returned user data. The data is passed to \p EapPeerBeginSession() as input \p pUserData.
/// \param[out] pdwUserDataOutSize Specifies the size, in bytes, of the \p ppUserDataOut buffer.
/// \param[in ] hTokenImpersonateUser A handle to the user impersonation token to use in this session.
/// \param[out] pfInvokeUI Returns \c TRUE if the user identity and user data blob aren't returned successfully, and the method seeks to collect the information from the user through the user interface dialog.
/// \param[out] ppwszIdentity A pointer to the returned user identity. The pointer will be included in the identity response packet and returned to the server.
///
virtual void get_identity( virtual void get_identity(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData, _In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ DWORD dwUserDataSize, _In_ DWORD dwUserDataSize,
_Inout_ BYTE **ppUserDataOut, _Out_ BYTE **ppUserDataOut,
_Inout_ DWORD *pdwUserDataOutSize, _Out_ DWORD *pdwUserDataOutSize,
_In_ HANDLE hTokenImpersonateUser, _In_ HANDLE hTokenImpersonateUser,
_Inout_ BOOL *pfInvokeUI, _Out_ BOOL *pfInvokeUI,
_Inout_ WCHAR **ppwszIdentity) = 0; _Out_ WCHAR **ppwszIdentity) = 0;
/// ///
/// Defines the implementation of an EAP method-specific function that retrieves the properties of an EAP method given the connection and user data. /// Defines the implementation of an EAP method-specific function that retrieves the properties of an EAP method given the connection and user data.
/// ///
/// \sa [EapPeerGetMethodProperties function](https://msdn.microsoft.com/en-us/library/windows/desktop/hh706636.aspx) /// \sa [EapPeerGetMethodProperties function](https://msdn.microsoft.com/en-us/library/windows/desktop/hh706636.aspx)
/// ///
/// \param[in ] dwVersion The version number of the API.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] hUserImpersonationToken A handle to the user impersonation token to use in this session.
/// \param[in ] pConnectionData Connection data used for the EAP method. If set to \c NULL, the static property of the method, as configured in the registry, is returned.
/// \param[in ] dwConnectionDataSize The size, in bytes, of the connection data buffer provided in \p pConnectionData.
/// \param[in ] pUserData A pointer to a byte buffer that contains the opaque user data BLOB. This parameter can be \c NULL.
/// \param[in ] dwUserDataSize The size, in bytes, of the user data buffer provided in \p pUserData.
/// \param[out] pMethodPropertyArray A pointer to the method properties array. Caller should free the inner pointers using `EapHostPeerFreeMemory()` starting at the innermost pointer. The caller should free an \c empvtString value only when the type is \c empvtString.
///
virtual void get_method_properties( virtual void get_method_properties(
_In_ DWORD dwVersion, _In_ DWORD dwVersion,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
@@ -738,72 +802,107 @@ namespace eap
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData, _In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ DWORD dwUserDataSize, _In_ DWORD dwUserDataSize,
_Inout_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray) = 0; _Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray) = 0;
/// ///
/// Converts XML into the configuration BLOB. The XML based credentials can come from group policy or from a system administrator. /// Converts XML into the configuration BLOB. The XML based credentials can come from group policy or from a system administrator.
/// ///
/// \sa [EapPeerCredentialsXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363603.aspx) /// \sa [EapPeerCredentialsXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363603.aspx)
/// ///
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] pConfigRoot A pointer to an XML node that contains credentials, which are either user or machine credentials depending on the configuration passed in. The XML document is created with the EapHostUserCredentials Schema.
/// \param[in ] dwConnectionDataSize The size of the EAP SSO configuration data pointed to by \p pConnectionData, in bytes.
/// \param[in ] pConnectionData A pointer to an opaque byte buffer that contains the EAP SSO configuration data BLOB.
/// \param[out] ppCredentialsOut A pointer to the byte buffer that receives the credentials BLOB buffer generated by the input XML. The buffer can is of size \p pdwCredentialsOutSize. After consuming the data, this memory must be freed by calling `EapPeerFreeMemory()`.
/// \param[out] pdwCredentialsOutSize The size, in bytes, of the buffer pointed to by \p ppCredentialsOut.
///
virtual void credentials_xml2blob( virtual void credentials_xml2blob(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ IXMLDOMNode *pConfigRoot, _In_ IXMLDOMNode *pConfigRoot,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_Inout_ BYTE **ppCredentialsOut, _Out_ BYTE **ppCredentialsOut,
_Inout_ DWORD *pdwCredentialsOutSize) = 0; _Out_ DWORD *pdwCredentialsOutSize) = 0;
/// ///
/// Defines the implementation of an EAP method-specific function that obtains the EAP Single-Sign-On (SSO) credential input fields for an EAP method. /// Defines the implementation of an EAP method-specific function that obtains the EAP Single-Sign-On (SSO) credential input fields for an EAP method.
/// ///
/// \sa [EapPeerQueryCredentialInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363622.aspx) /// \sa [EapPeerQueryCredentialInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363622.aspx)
/// ///
/// \param[in ] hUserImpersonationToken An impersonation token for the user whose credentials are to be requested and obtained.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] dwConnectionDataSize The size of the EAP SSO configuration data pointed to by \p pConnectionData, in bytes.
/// \param[in ] pConnectionData A pointer to an opaque byte buffer that contains the EAP SSO configuration data BLOB.
/// \param[out] pEapConfigInputFieldsArray A Pointer to a structure that contains the input fields to display to the supplicant user. The `pwszData` fields in the individual `EAP_CONFIG_INPUT_FIELD_DATA` elements are initialized to \c NULL.
///
virtual void query_credential_input_fields( virtual void query_credential_input_fields(
_In_ HANDLE hUserImpersonationToken, _In_ HANDLE hUserImpersonationToken,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_Inout_ EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldsArray) const; _Out_ EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldsArray) const;
/// ///
/// Defines the implementation of an EAP method function that obtains the user BLOB data provided in an interactive Single-Sign-On (SSO) UI raised on the supplicant. /// Defines the implementation of an EAP method function that obtains the user BLOB data provided in an interactive Single-Sign-On (SSO) UI raised on the supplicant.
/// ///
/// \sa [EapPeerQueryUserBlobFromCredentialInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204697.aspx) /// \sa [EapPeerQueryUserBlobFromCredentialInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204697.aspx)
/// ///
/// \param[in ] hUserImpersonationToken An impersonation token for the user whose credentials are to be requested and obtained.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] dwConnectionDataSize The size of the EAP SSO configuration data pointed to by \p pConnectionData, in bytes.
/// \param[in ] pConnectionData A pointer to an opaque byte buffer that contains the EAP SSO configuration data BLOB.
/// \param[in ] pEapConfigInputFieldArray A pointer to a structure that contains the input fields to display to the supplicant user. The `pwszData` fields in the individual `EAP_CONFIG_INPUT_FIELD_DATA` elements are initialized to \c NULL.
/// \param[out] pdwUsersBlobSize A pointer to a buffer that contains the size, in bytes, of the opaque user configuration data BLOB in \p ppUserBlob.
/// \param[out] ppUserBlob A pointer that contains the opaque user data BLOB.
///
virtual void query_user_blob_from_credential_input_fields( virtual void query_user_blob_from_credential_input_fields(
_In_ HANDLE hUserImpersonationToken, _In_ HANDLE hUserImpersonationToken,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ const EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldArray, _In_ const EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldArray,
_Inout_ DWORD *pdwUsersBlobSize, _Out_ DWORD *pdwUsersBlobSize,
_Inout_ BYTE **ppUserBlob) const; _Out_ BYTE **ppUserBlob) const;
/// ///
/// Defines the implementation of an EAP method API that provides the input fields for interactive UI components to be raised on the supplicant. /// Defines the implementation of an EAP method API that provides the input fields for interactive UI components to be raised on the supplicant.
/// ///
/// \sa [EapPeerQueryInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204695.aspx) /// \sa [EapPeerQueryInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204695.aspx)
/// ///
/// \param[in ] dwVersion The version number of the API.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] dwUIContextDataSize The size of the context data in \p pUIContextData, in bytes.
/// \param[in ] pUIContextData A pointer to a BLOB that contains UI context data, represented as inner pointers to field data. The supplicant obtained these inner pointers from EAPHost run-time APIs.
/// \param[out] pEapInteractiveUIData Pointer that receives a structure that contains configuration information for interactive UI components raised on an EAP supplicant.
///
virtual void query_interactive_ui_input_fields( virtual void query_interactive_ui_input_fields(
_In_ DWORD dwVersion, _In_ DWORD dwVersion,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize, _In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_Inout_ EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData) const; _Out_ EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData) const;
/// ///
/// Converts user information into a user BLOB that can be consumed by EapHost run-time functions. /// Converts user information into a user BLOB that can be consumed by EapHost run-time functions.
/// ///
/// \sa [EapPeerQueryUIBlobFromInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204696.aspx) /// \sa [EapPeerQueryUIBlobFromInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204696.aspx)
/// ///
/// \param[in ] dwVersion The version number of the API.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] dwUIContextDataSize The size of the context data in \p pUIContextData, in bytes.
/// \param[in ] pUIContextData A pointer to a BLOB that contains UI context data, represented as inner pointers to field data. The supplicant obtained these inner pointers from EAPHost run-time APIs.
/// \param[in ] pEapInteractiveUIData Pointer with a structure that contains configuration information for interactive user interface components raised on an EAP supplicant.
/// \param[out] pdwDataFromInteractiveUISize A pointer to a `DWORD` that specifies the size of the buffer pointed to by the \p ppDataFromInteractiveUI parameter, in bytes. If this value is not set to \c 0, then a pointer to a buffer of the size specified in this parameter must be supplied in the \p ppDataFromInteractiveUI parameter.
/// \param[out] ppDataFromInteractiveUI A pointer that receives a credentials BLOB that can be used in authentication. The caller should free the inner pointers using the function \p EapPeerFreeMemory(), starting at the innermost pointer. If a non-NULL value is supplied for this parameter, meaning that an existing data BLOB is passed to it, the supplied data BLOB will be updated and returned in this parameter.
///
virtual void query_ui_blob_from_interactive_ui_input_fields( virtual void query_ui_blob_from_interactive_ui_input_fields(
_In_ DWORD dwVersion, _In_ DWORD dwVersion,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize, _In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData, _In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Inout_ DWORD *pdwDataFromInteractiveUISize, _Out_ DWORD *pdwDataFromInteractiveUISize,
_Inout_ BYTE **ppDataFromInteractiveUI) const; _Outptr_result_buffer_(*pdwDataFromInteractiveUISize) BYTE **ppDataFromInteractiveUI) const;
/// \name Session management /// \name Session management
/// @{ /// @{
@@ -813,6 +912,15 @@ namespace eap
/// ///
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx) /// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
/// ///
/// \param[in] dwFlags A combination of EAP flags that describe the new EAP authentication session behavior.
/// \param[in] pAttributeArray A pointer to an array structure that specifies the EAP attributes of the entity to authenticate.
/// \param[in] hTokenImpersonateUser Specifies a handle to the user impersonation token to use in this session.
/// \param[in] pConnectionData Connection data specific to this method used to decide the user data returned from this API, where the user data depends on certain connection data configuration. When this parameter is NULL the method implementation should use default values for connection.
/// \param[in] dwConnectionDataSize Specifies the size, in bytes, of the connection data buffer provided in \p pConnectionData.
/// \param[in] pUserData A pointer to a byte buffer that contains the opaque user data BLOB.
/// \param[in] dwUserDataSize Specifies the size in bytes of the user data buffer provided in \p pUserData.
/// \param[in] dwMaxSendPacketSize Specifies the maximum size in bytes of an EAP packet sent during the session. If the method needs to send a packet larger than the maximum size, the method must accommodate fragmentation and reassembly.
///
/// \returns Session handle /// \returns Session handle
/// ///
virtual EAP_SESSION_HANDLE begin_session( virtual EAP_SESSION_HANDLE begin_session(
@@ -830,13 +938,25 @@ namespace eap
/// ///
/// \sa [EapPeerEndSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363604.aspx) /// \sa [EapPeerEndSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363604.aspx)
/// ///
/// \param[in] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
///
virtual void end_session(_In_ EAP_SESSION_HANDLE hSession) = 0; virtual void end_session(_In_ EAP_SESSION_HANDLE hSession) = 0;
/// @}
/// \name Packet processing
/// @{
/// ///
/// Processes a packet received by EapHost from a supplicant. /// Processes a packet received by EapHost from a supplicant.
/// ///
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx) /// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
/// ///
/// \param[in] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in] pReceivedPacket Received packet data
/// \param[in] dwReceivedPacketSize \p pReceivedPacket size in bytes
/// \param[in] pEapOutput A pointer to a structure that contains the output of the packet process operation.
///
virtual void process_request_packet( virtual void process_request_packet(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket, _In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket,
@@ -848,21 +968,34 @@ namespace eap
/// ///
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx) /// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
/// ///
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[inout] pSendPacket A pointer to a structure that contains the response packet.
/// \param[inout] pdwSendPacketSize A pointer to a value that contains the size in bytes of the buffer allocated for the response packet. On return, this parameter receives a pointer to the actual size in bytes of \p pSendPacket.
///
virtual void get_response_packet( virtual void get_response_packet(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_Inout_bytecap_(*dwSendPacketSize) EapPacket *pSendPacket, _Out_bytecapcount_(*pdwSendPacketSize) EapPacket *pSendPacket,
_Inout_ DWORD *pdwSendPacketSize) = 0; _Inout_ DWORD *pdwSendPacketSize) = 0;
/// @}
/// ///
/// Obtains the result of an authentication session from the EAP method. /// Obtains the result of an authentication session from the EAP method.
/// ///
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx) /// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
/// ///
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[inout] pResult A pointer to a structure that contains the authentication results.
///
virtual void get_result( virtual void get_result(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_In_ EapPeerMethodResultReason reason, _In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult) = 0; _Inout_ EapPeerMethodResult *pResult) = 0;
/// \name User Interaction
/// @{
/// ///
/// Obtains the user interface context from the EAP method. /// Obtains the user interface context from the EAP method.
/// ///
@@ -870,10 +1003,14 @@ namespace eap
/// ///
/// \sa [EapPeerGetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363612.aspx) /// \sa [EapPeerGetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363612.aspx)
/// ///
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[out] ppUIContextData A pointer to an address that contains a byte buffer with the supplicant user interface context data from EAPHost.
/// \param[out] pdwUIContextDataSize A pointer to a value that specifies the size of the user interface context data byte buffer returned in \p ppUIContextData.
///
virtual void get_ui_context( virtual void get_ui_context(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_Inout_ BYTE **ppUIContextData, _Out_ BYTE **ppUIContextData,
_Inout_ DWORD *pdwUIContextDataSize) = 0; _Out_ DWORD *pdwUIContextDataSize) = 0;
/// ///
/// Provides a user interface context to the EAP method. /// Provides a user interface context to the EAP method.
@@ -882,26 +1019,43 @@ namespace eap
/// ///
/// \sa [EapPeerSetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363626.aspx) /// \sa [EapPeerSetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363626.aspx)
/// ///
/// \param[in] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in] pUIContextData A pointer to an address that contains a byte buffer with the new supplicant UI context data to set on EAPHost.
/// \param[in] dwUIContextDataSize \p pUIContextData size in bytes
/// \param[in] pEapOutput A pointer to a structure that contains the output of the packet process operation.
///
virtual void set_ui_context( virtual void set_ui_context(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ DWORD dwUIContextDataSize, _In_ DWORD dwUIContextDataSize,
_Out_ EapPeerMethodOutput *pEapOutput) = 0; _Out_ EapPeerMethodOutput *pEapOutput) = 0;
/// @}
/// \name EAP Response Attributes
/// @{
/// ///
/// Obtains an array of EAP response attributes from the EAP method. /// Obtains an array of EAP response attributes from the EAP method.
/// ///
/// \sa [EapPeerGetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363609.aspx) /// \sa [EapPeerGetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363609.aspx)
/// ///
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[out] pAttribs A pointer to a structure that contains an array of EAP authentication response attributes for the supplicant.
///
virtual void get_response_attributes( virtual void get_response_attributes(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_Inout_ EapAttributes *pAttribs) = 0; _Out_ EapAttributes *pAttribs) = 0;
/// ///
/// Provides an updated array of EAP response attributes to the EAP method. /// Provides an updated array of EAP response attributes to the EAP method.
/// ///
/// \sa [EapPeerSetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363625.aspx) /// \sa [EapPeerSetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363625.aspx)
/// ///
/// \param[in] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in] pAttribs A pointer to a structure that contains an array of new EAP authentication response attributes to set for the supplicant on EAPHost.
/// \param[in] pEapOutput A pointer to a structure that contains the output of the packet process operation.
///
virtual void set_response_attributes( virtual void set_response_attributes(
_In_ EAP_SESSION_HANDLE hSession, _In_ EAP_SESSION_HANDLE hSession,
_In_ const EapAttributes *pAttribs, _In_ const EapAttributes *pAttribs,
@@ -909,4 +1063,6 @@ namespace eap
/// @} /// @}
}; };
/// @}
} }

View File

@@ -0,0 +1,102 @@
/*
Copyright 2015-2017 Amebis
Copyright 2016-2017 GÉANT
This file is part of GÉANTLink.
GÉANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GÉANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
namespace eap
{
class ui_context;
}
#pragma once
#include "Config.h"
#include "Credentials.h"
#include "Module.h"
#include "../../../include/Version.h"
namespace eap
{
///
/// \defgroup EAPBaseUICtx UI Context
/// Back and front-end inter-process data exchange
///
/// @{
///
/// UI context
///
class ui_context : public packable
{
public:
///
/// Constructs context
///
/// \param[in] cfg Connection configuration
/// \param[in] cred Connection credentials
///
ui_context(_In_ config_connection &cfg, _In_ credentials_connection &cred);
///
/// Copies context
///
/// \param[in] other Credentials to copy from
///
ui_context(_In_ const ui_context &other);
///
/// Moves context
///
/// \param[in] other Credentials to move from
///
ui_context(_Inout_ ui_context &&other) noexcept;
///
/// Copies context
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
ui_context& operator=(_In_ const ui_context &other);
///
/// Moves context
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
ui_context& operator=(_Inout_ ui_context &&other) noexcept;
/// \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);
/// @}
public:
config_connection &m_cfg; ///< Connection configuration
credentials_connection &m_cred; ///< Connection credentials
};
/// @}
}

View File

@@ -40,7 +40,7 @@ eap::config::config(_In_ const config &other) :
} }
eap::config::config(_Inout_ config &&other) : eap::config::config(_Inout_ config &&other) noexcept :
m_module(other.m_module) m_module(other.m_module)
{ {
} }
@@ -55,7 +55,7 @@ eap::config& eap::config::operator=(_In_ const config &other)
} }
eap::config& eap::config::operator=(_Inout_ config &&other) eap::config& eap::config::operator=(_Inout_ config &&other) noexcept
{ {
if (this != &other) if (this != &other)
assert(&m_module == &other.m_module); assert(&m_module == &other.m_module);
@@ -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");
@@ -121,7 +103,7 @@ eap::config_method::config_method(_In_ const config_method &other) :
} }
eap::config_method::config_method(_Inout_ config_method &&other) : eap::config_method::config_method(_Inout_ config_method &&other) noexcept :
m_level (std::move(other.m_level )), m_level (std::move(other.m_level )),
m_allow_save (std::move(other.m_allow_save )), m_allow_save (std::move(other.m_allow_save )),
m_last_status(std::move(other.m_last_status)), m_last_status(std::move(other.m_last_status)),
@@ -145,7 +127,7 @@ eap::config_method& eap::config_method::operator=(_In_ const config_method &othe
} }
eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other) eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
assert(m_level == other.m_level); // Allow move within same configuration level only. assert(m_level == other.m_level); // Allow move within same configuration level only.
@@ -249,7 +231,7 @@ eap::config_method_with_cred::config_method_with_cred(_In_ const config_method_w
} }
eap::config_method_with_cred::config_method_with_cred(_Inout_ config_method_with_cred &&other) : eap::config_method_with_cred::config_method_with_cred(_Inout_ config_method_with_cred &&other) noexcept :
m_use_cred (std::move(other.m_use_cred)), m_use_cred (std::move(other.m_use_cred)),
m_cred (std::move(other.m_cred )), m_cred (std::move(other.m_cred )),
config_method(std::move(other )) config_method(std::move(other ))
@@ -269,7 +251,7 @@ eap::config_method_with_cred& eap::config_method_with_cred::operator=(_In_ const
} }
eap::config_method_with_cred& eap::config_method_with_cred::operator=(_Inout_ config_method_with_cred &&other) eap::config_method_with_cred& eap::config_method_with_cred::operator=(_Inout_ config_method_with_cred &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(config_method&)*this = std::move(other ); (config_method&)*this = std::move(other );
@@ -380,7 +362,7 @@ eap::config_provider::config_provider(_In_ const config_provider &other) :
} }
eap::config_provider::config_provider(_Inout_ config_provider &&other) : eap::config_provider::config_provider(_Inout_ config_provider &&other) noexcept :
m_namespace (std::move(other.m_namespace )), m_namespace (std::move(other.m_namespace )),
m_id (std::move(other.m_id )), m_id (std::move(other.m_id )),
m_read_only (std::move(other.m_read_only )), m_read_only (std::move(other.m_read_only )),
@@ -422,7 +404,7 @@ eap::config_provider& eap::config_provider::operator=(_In_ const config_provider
} }
eap::config_provider& eap::config_provider::operator=(_Inout_ config_provider &&other) eap::config_provider& eap::config_provider::operator=(_Inout_ config_provider &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(config&&)*this = std::move(other ); (config&&)*this = std::move(other );
@@ -718,7 +700,7 @@ eap::config_connection::config_connection(_In_ const config_connection &other) :
} }
eap::config_connection::config_connection(_Inout_ config_connection &&other) : eap::config_connection::config_connection(_Inout_ config_connection &&other) noexcept :
m_providers(std::move(other.m_providers)), m_providers(std::move(other.m_providers)),
config (std::move(other )) config (std::move(other ))
{ {
@@ -736,7 +718,7 @@ eap::config_connection& eap::config_connection::operator=(_In_ const config_conn
} }
eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other) eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(config&&)*this = std::move(other ); (config&&)*this = std::move(other );

View File

@@ -53,7 +53,7 @@ eap::credentials::credentials(_In_ const credentials &other) :
} }
eap::credentials::credentials(_Inout_ credentials &&other) : eap::credentials::credentials(_Inout_ credentials &&other) noexcept :
m_identity(std::move(other.m_identity)), m_identity(std::move(other.m_identity)),
config(std::move(other)) config(std::move(other))
{ {
@@ -71,7 +71,7 @@ eap::credentials& eap::credentials::operator=(_In_ const credentials &other)
} }
eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other) eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(config&)*this = std::move(other); (config&)*this = std::move(other);
@@ -163,6 +163,183 @@ tstring eap::credentials::get_name() const
} }
//////////////////////////////////////////////////////////////////////
// eap::credentials_identity
//////////////////////////////////////////////////////////////////////
eap::credentials_identity::credentials_identity(_In_ module &mod) : credentials(mod)
{
}
eap::credentials_identity::credentials_identity(_In_ const credentials_identity &other) : credentials(other)
{
}
eap::credentials_identity::credentials_identity(_Inout_ credentials_identity &&other) noexcept : credentials(std::move(other))
{
}
eap::credentials_identity& eap::credentials_identity::operator=(_In_ const credentials_identity &other)
{
if (this != &other)
(credentials&)*this = other;
return *this;
}
eap::credentials_identity& eap::credentials_identity::operator=(_Inout_ credentials_identity &&other) noexcept
{
if (this != &other)
(credentials&)*this = std::move(other);
return *this;
}
eap::config* eap::credentials_identity::clone() const
{
return new credentials_identity(*this);
}
void eap::credentials_identity::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
{
assert(pDoc);
assert(pConfigRoot);
// We could have used credentials::save() to save identity,
// but that method tolerates absence of <UserName> element,
// whereas for this class the absence of <UserName> is fatal.
config::save(pDoc, pConfigRoot);
HRESULT hr;
// <UserName>
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), namespace_eapmetadata, bstr(m_identity))))
throw com_runtime_error(hr, __FUNCTION__ " Error creating <UserName> element.");
}
void eap::credentials_identity::load(_In_ IXMLDOMNode *pConfigRoot)
{
assert(pConfigRoot);
HRESULT hr;
// We could have used credentials::load() to load identity,
// but that method tolerates absence of <UserName> element,
// whereas for this class the absence of <UserName> is fatal.
config::load(pConfigRoot);
wstring xpath(eapxml::get_xpath(pConfigRoot));
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity)))
throw com_runtime_error(hr, __FUNCTION__ " Error reading <UserName> element.");
m_module.log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
}
void eap::credentials_identity::store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const
{
assert(pszTargetName);
tstring target(target_name(pszTargetName, level));
// Write credentials.
assert(m_identity.length() < CRED_MAX_USERNAME_LENGTH);
CREDENTIAL cred = {
0, // Flags
CRED_TYPE_GENERIC, // Type
const_cast<LPTSTR>(target.c_str()), // TargetName
_T(""), // Comment
{ 0, 0 }, // LastWritten
0, // CredentialBlobSize
NULL, // CredentialBlob
CRED_PERSIST_ENTERPRISE, // Persist
0, // AttributeCount
NULL, // Attributes
NULL, // TargetAlias
const_cast<LPTSTR>(m_identity.c_str()) // UserName
};
if (!CredWrite(&cred, 0))
throw win_runtime_error(__FUNCTION__ " CredWrite failed.");
}
void eap::credentials_identity::retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level)
{
assert(pszTargetName);
// Read credentials.
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
if (!CredRead(target_name(pszTargetName, level).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred))
throw win_runtime_error(__FUNCTION__ " CredRead failed.");
if (cred->UserName)
m_identity = cred->UserName;
else
m_identity.clear();
wstring xpath(pszTargetName);
m_module.log_config((xpath + L"/Identity").c_str(), m_identity.c_str());
}
LPCTSTR eap::credentials_identity::target_suffix() const
{
return _T("id");
}
eap::credentials::source_t eap::credentials_identity::combine(
_In_ DWORD dwFlags,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName)
{
UNREFERENCED_PARAMETER(dwFlags);
if (cred_cached) {
// Using EAP service cached credentials.
*this = *dynamic_cast<const credentials_identity*>(cred_cached);
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_identity::get_name()), event_data(pszTargetName), event_data::blank);
return source_cache;
}
auto cfg_with_cred = dynamic_cast<const config_method_with_cred*>(&cfg);
if (cfg_with_cred && cfg_with_cred->m_use_cred) {
// Using configured credentials.
*this = *dynamic_cast<const credentials_identity*>(cfg_with_cred->m_cred.get());
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CONFIG2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_identity::get_name()), event_data(pszTargetName), event_data::blank);
return source_config;
}
if (pszTargetName) {
// Switch user context.
user_impersonator impersonating(hTokenImpersonateUser);
try {
credentials_identity cred_loaded(m_module);
cred_loaded.retrieve(pszTargetName, cfg.m_level);
// Using stored credentials.
*this = std::move(cred_loaded);
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_identity::get_name()), event_data(pszTargetName), event_data::blank);
return source_storage;
} catch (...) {
// Not actually an error.
}
}
return source_unknown;
}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// eap::credentials_pass // eap::credentials_pass
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -182,7 +359,7 @@ eap::credentials_pass::credentials_pass(_In_ const credentials_pass &other) :
} }
eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) : eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) noexcept :
m_password (std::move(other.m_password)), m_password (std::move(other.m_password)),
m_enc_alg (std::move(other.m_enc_alg )), m_enc_alg (std::move(other.m_enc_alg )),
credentials(std::move(other )) credentials(std::move(other ))
@@ -202,7 +379,7 @@ eap::credentials_pass& eap::credentials_pass::operator=(_In_ const credentials_p
} }
eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass &&other) eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(credentials&)*this = std::move(other ); (credentials&)*this = std::move(other );
@@ -425,32 +602,40 @@ LPCTSTR eap::credentials_pass::target_suffix() const
eap::credentials::source_t eap::credentials_pass::combine( eap::credentials::source_t eap::credentials_pass::combine(
_In_ const credentials *cred_cached, _In_ DWORD dwFlags,
_In_ const config_method_with_cred &cfg, _In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_z_ LPCTSTR pszTargetName) _In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName)
{ {
UNREFERENCED_PARAMETER(dwFlags);
if (cred_cached) { if (cred_cached) {
// Using EAP service cached credentials. // Using EAP service cached credentials.
*this = *dynamic_cast<const credentials_pass*>(cred_cached); *this = *dynamic_cast<const credentials_pass*>(cred_cached);
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED1, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data::blank); m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data(pszTargetName), event_data::blank);
return source_cache; return source_cache;
} }
if (cfg.m_use_cred) { auto cfg_with_cred = dynamic_cast<const config_method_with_cred*>(&cfg);
if (cfg_with_cred && cfg_with_cred->m_use_cred) {
// Using configured credentials. // Using configured credentials.
*this = *dynamic_cast<const credentials_pass*>(cfg.m_cred.get()); *this = *dynamic_cast<const credentials_pass*>(cfg_with_cred->m_cred.get());
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CONFIG1, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data::blank); m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CONFIG2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data(pszTargetName), event_data::blank);
return source_config; return source_config;
} }
if (pszTargetName) { if (pszTargetName) {
// Switch user context.
user_impersonator impersonating(hTokenImpersonateUser);
try { try {
credentials_pass cred_loaded(m_module); credentials_pass cred_loaded(m_module);
cred_loaded.retrieve(pszTargetName, cfg.m_level); cred_loaded.retrieve(pszTargetName, cfg.m_level);
// Using stored credentials. // Using stored credentials.
*this = std::move(cred_loaded); *this = std::move(cred_loaded);
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED1, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data::blank); m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED2, event_data((unsigned int)cfg.get_method_id()), event_data(credentials_pass::get_name()), event_data(pszTargetName), event_data::blank);
return source_storage; return source_storage;
} catch (...) { } catch (...) {
// Not actually an error. // Not actually an error.
@@ -461,6 +646,7 @@ eap::credentials::source_t eap::credentials_pass::combine(
} }
/// \cond internal
const unsigned char eap::credentials_pass::s_entropy[1024] = { const unsigned char eap::credentials_pass::s_entropy[1024] = {
0x40, 0x88, 0xd3, 0x13, 0x81, 0x8a, 0xf6, 0x74, 0x55, 0x8e, 0xcc, 0x73, 0x2c, 0xf8, 0x93, 0x37, 0x40, 0x88, 0xd3, 0x13, 0x81, 0x8a, 0xf6, 0x74, 0x55, 0x8e, 0xcc, 0x73, 0x2c, 0xf8, 0x93, 0x37,
0x4f, 0xeb, 0x1d, 0x66, 0xb7, 0xfb, 0x47, 0x75, 0xb4, 0xfd, 0x07, 0xbb, 0xf6, 0xb3, 0x05, 0x30, 0x4f, 0xeb, 0x1d, 0x66, 0xb7, 0xfb, 0x47, 0x75, 0xb4, 0xfd, 0x07, 0xbb, 0xf6, 0xb3, 0x05, 0x30,
@@ -527,6 +713,7 @@ const unsigned char eap::credentials_pass::s_entropy[1024] = {
0x30, 0x29, 0x39, 0x9a, 0xd6, 0xab, 0x2e, 0xc6, 0x42, 0x47, 0x5e, 0x54, 0xbb, 0x90, 0xe6, 0x98, 0x30, 0x29, 0x39, 0x9a, 0xd6, 0xab, 0x2e, 0xc6, 0x42, 0x47, 0x5e, 0x54, 0xbb, 0x90, 0xe6, 0x98,
0xe6, 0x52, 0x58, 0x58, 0x1e, 0xd0, 0x00, 0x9c, 0x8f, 0x4a, 0x17, 0x7e, 0x8a, 0x5a, 0xef, 0x3e, 0xe6, 0x52, 0x58, 0x58, 0x1e, 0xd0, 0x00, 0x9c, 0x8f, 0x4a, 0x17, 0x7e, 0x8a, 0x5a, 0xef, 0x3e,
}; };
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -550,7 +737,7 @@ eap::credentials_connection::credentials_connection(_In_ const credentials_conne
} }
eap::credentials_connection::credentials_connection(_Inout_ credentials_connection &&other) : eap::credentials_connection::credentials_connection(_Inout_ credentials_connection &&other) noexcept :
m_cfg ( other.m_cfg ), m_cfg ( other.m_cfg ),
m_namespace(std::move(other.m_namespace)), m_namespace(std::move(other.m_namespace)),
m_id (std::move(other.m_id )), m_id (std::move(other.m_id )),
@@ -573,7 +760,7 @@ eap::credentials_connection& eap::credentials_connection::operator=(_In_ const c
} }
eap::credentials_connection& eap::credentials_connection::operator=(_Inout_ credentials_connection &&other) eap::credentials_connection& eap::credentials_connection::operator=(_Inout_ credentials_connection &&other) noexcept
{ {
if (this != &other) { if (this != &other) {
(config&)*this = std::move(other ); (config&)*this = std::move(other );
@@ -651,8 +838,7 @@ void eap::credentials_connection::load(_In_ IXMLDOMNode *pConfigRoot)
// Matching provider found. Create matching blank credential set, then load. // Matching provider found. Create matching blank credential set, then load.
if (cfg_prov->m_methods.empty()) if (cfg_prov->m_methods.empty())
throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str())); throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str()));
const config_method_with_cred *cfg_method = dynamic_cast<const config_method_with_cred*>(cfg_prov->m_methods.front().get()); m_cred.reset(cfg_prov->m_methods.front().get()->make_credentials());
m_cred.reset(cfg_method->make_credentials());
m_cred->load(pXmlElClientSideCredential); m_cred->load(pXmlElClientSideCredential);
break; break;
} }
@@ -694,8 +880,7 @@ void eap::credentials_connection::operator>>(_Inout_ cursor_in &cursor)
// Matching provider found. Create matching blank credential set, then read. // Matching provider found. Create matching blank credential set, then read.
if (cfg_prov->m_methods.empty()) if (cfg_prov->m_methods.empty())
throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str())); throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str()));
const config_method_with_cred *cfg_method = dynamic_cast<const config_method_with_cred*>(cfg_prov->m_methods.front().get()); m_cred.reset(cfg_prov->m_methods.front().get()->make_credentials());
m_cred.reset(cfg_method->make_credentials());
cursor >> *m_cred; cursor >> *m_cred;
break; break;
} }
@@ -763,7 +948,7 @@ template<class _Elem, class _Traits, class _Ax>
inline static basic_string<_Elem, _Traits, _Ax> kph_encrypt(_In_ HCRYPTPROV hProv, _In_z_ const char *src) inline static basic_string<_Elem, _Traits, _Ax> kph_encrypt(_In_ HCRYPTPROV hProv, _In_z_ const char *src)
{ {
basic_string<_Elem, _Traits, _Ax> str; basic_string<_Elem, _Traits, _Ax> str;
unsigned short key[8]; unsigned short key[8] = { 0 };
// Generate the key. // Generate the key.
if (!CryptGenRandom(hProv, sizeof(key), (BYTE*)key)) if (!CryptGenRandom(hProv, sizeof(key), (BYTE*)key))

View File

@@ -20,64 +20,106 @@
#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::packet // eap::packable
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
eap::packet::packet() : eap::packable::packable()
m_code((EapCode)0),
m_id(0)
{ {
} }
eap::packet::packet(_In_ const packet &other) : void eap::packable::operator<<(_Inout_ cursor_out &cursor) const
m_code(other.m_code),
m_id (other.m_id ),
m_data(other.m_data)
{ {
UNREFERENCED_PARAMETER(cursor);
} }
eap::packet::packet(_Inout_ packet &&other) : size_t eap::packable::get_pk_size() const
m_code(std::move(other.m_code)),
m_id (std::move(other.m_id )),
m_data(std::move(other.m_data))
{ {
return 0;
} }
eap::packet& eap::packet::operator=(_In_ const packet &other) void eap::packable::operator>>(_Inout_ cursor_in &cursor)
{ {
if (this != std::addressof(other)) { UNREFERENCED_PARAMETER(cursor);
m_code = other.m_code;
m_id = other.m_id ;
m_data = other.m_data;
}
return *this;
} }
eap::packet& eap::packet::operator=(_Inout_ packet &&other) //////////////////////////////////////////////////////////////////////
{ // eap::diameter_avp_append
if (this != std::addressof(other)) { //////////////////////////////////////////////////////////////////////
m_code = std::move(other.m_code);
m_id = std::move(other.m_id );
m_data = std::move(other.m_data);
}
return *this; void eap::diameter_avp_append(
_In_ unsigned int code,
_In_ unsigned char flags,
_In_bytecount_(size) const void *data,
_In_ unsigned int size,
_Inout_ sanitizing_blob &packet)
{
unsigned int
padding = (unsigned int)((4 - size) % 4),
size_outer;
packet.reserve(
packet.size() +
(size_outer =
sizeof(diameter_avp_header) + // Diameter header
size) + // Data
padding); // Data padding
// Diameter AVP header
diameter_avp_header hdr;
*reinterpret_cast<unsigned int*>(hdr.code) = htonl(code);
hdr.flags = flags;
hton24(size_outer, hdr.length);
packet.insert(packet.end(), reinterpret_cast<const unsigned char*>(&hdr), reinterpret_cast<const unsigned char*>(&hdr + 1));
// Data
packet.insert(packet.end(), reinterpret_cast<const unsigned char*>(data), reinterpret_cast<const unsigned char*>(data) + size);
packet.insert(packet.end(), padding, 0);
} }
void eap::packet::clear() //////////////////////////////////////////////////////////////////////
// eap::diameter_avp_append
//////////////////////////////////////////////////////////////////////
void eap::diameter_avp_append(
_In_ unsigned int code,
_In_ unsigned int vendor_id,
_In_ unsigned char flags,
_In_bytecount_(size) const void *data,
_In_ unsigned int size,
_Inout_ sanitizing_blob &packet)
{ {
m_code = (EapCode)0; unsigned int
m_id = 0; padding = (unsigned int)((4 - size) % 4),
m_data.clear(); size_outer;
packet.reserve(
packet.size() +
(size_outer =
sizeof(diameter_avp_header_ven) + // Diameter header
size) + // Data
padding); // Data padding
// Diameter AVP header
diameter_avp_header_ven hdr;
*reinterpret_cast<unsigned int*>(hdr.code) = htonl(code);
hdr.flags = flags | diameter_avp_flag_vendor;
hton24(size_outer, hdr.length);
*reinterpret_cast<unsigned int*>(hdr.vendor) = htonl(vendor_id);
packet.insert(packet.end(), reinterpret_cast<const unsigned char*>(&hdr), reinterpret_cast<const unsigned char*>(&hdr + 1));
// Data
packet.insert(packet.end(), reinterpret_cast<const unsigned char*>(data), reinterpret_cast<const unsigned char*>(data) + size);
packet.insert(packet.end(), padding, 0);
} }

View File

@@ -28,30 +28,22 @@ using namespace winstd;
// eap::method // eap::method
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
eap::method::method(_In_ module &module, _In_ config_method &cfg, _In_ credentials &cred) : eap::method::method(_In_ module &mod) :
m_module(module), m_module(mod)
m_cfg(cfg),
m_cred(cred)
{ {
} }
eap::method::method(_Inout_ method &&other) : eap::method::method(_Inout_ method &&other) noexcept :
m_module ( other.m_module ), m_module(other.m_module)
m_cfg ( other.m_cfg ),
m_cred ( other.m_cred ),
m_eap_attr(std::move(other.m_eap_attr))
{ {
} }
eap::method& eap::method::operator=(_Inout_ method &&other) eap::method& eap::method::operator=(_Inout_ method &&other) noexcept
{ {
if (this != std::addressof(other)) { if (this != std::addressof(other)) {
assert(std::addressof(m_module) == std::addressof(other.m_module)); // Move method within same module only! assert(std::addressof(m_module) == std::addressof(other.m_module)); // Move method within same module only!
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move method with same configuration only!
assert(std::addressof(m_cred ) == std::addressof(other.m_cred )); // Move method with same credentials only!
m_eap_attr = std::move(other.m_eap_attr);
} }
return *this; return *this;
@@ -68,11 +60,6 @@ void eap::method::begin_session(
UNREFERENCED_PARAMETER(pAttributeArray); UNREFERENCED_PARAMETER(pAttributeArray);
UNREFERENCED_PARAMETER(hTokenImpersonateUser); UNREFERENCED_PARAMETER(hTokenImpersonateUser);
UNREFERENCED_PARAMETER(dwMaxSendPacketSize); UNREFERENCED_PARAMETER(dwMaxSendPacketSize);
// Presume authentication will fail with generic protocol failure. (Pesimist!!!)
// We will reset once we get get_result(Success) call.
m_cfg.m_last_status = config_method::status_auth_failed;
m_cfg.m_last_msg.clear();
} }
@@ -85,123 +72,282 @@ void eap::method::get_result(
_In_ EapPeerMethodResultReason reason, _In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult) _Inout_ EapPeerMethodResult *pResult)
{ {
assert(pResult); UNREFERENCED_PARAMETER(reason);
UNREFERENCED_PARAMETER(pResult);
}
switch (reason) {
case EapPeerMethodResultSuccess: {
m_module.log_event(&EAPMETHOD_METHOD_SUCCESS, event_data((unsigned int)m_cfg.get_method_id()), event_data::blank);
m_cfg.m_last_status = config_method::status_success;
break;
}
case EapPeerMethodResultFailure: void eap::method::get_ui_context(_Out_ sanitizing_blob &context_data)
m_module.log_event(&EAPMETHOD_METHOD_FAILURE_ERROR2, event_data((unsigned int)m_cfg.get_method_id()), event_data((unsigned int)m_cfg.m_last_status), event_data::blank); {
break; // Default implementation returns blank context data.
context_data.clear();
}
default:
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Not supported.");
}
// Always ask EAP host to save the connection data. And it will save it *only* when we report "success". EapPeerMethodResponseAction eap::method::set_ui_context(
// Don't worry. EapHost is well aware of failed authentication condition. _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
pResult->fSaveConnectionData = TRUE; _In_ DWORD dwUIContextDataSize)
pResult->fIsSuccess = TRUE; {
UNREFERENCED_PARAMETER(pUIContextData);
UNREFERENCED_PARAMETER(dwUIContextDataSize);
// Default implementation does nothing with context data.
return EapPeerMethodResponseActionNone;
}
void eap::method::get_response_attributes(_Out_ EapAttributes *pAttribs)
{
assert(pAttribs);
// Default implementation returns no EAP attributes.
pAttribs->dwNumberOfAttributes = 0;
pAttribs->pAttribs = NULL;
}
EapPeerMethodResponseAction eap::method::set_response_attributes(_In_ const EapAttributes *pAttribs)
{
UNREFERENCED_PARAMETER(pAttribs);
// Default implementation does nothing with EAP attributes.
return EapPeerMethodResponseActionNone;
} }
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// eap::method_noneap // eap::method_tunnel
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
eap::method_noneap::method_noneap(_In_ module &module, _In_ config_method &cfg, _In_ credentials &cred) : method(module, cfg, cred) eap::method_tunnel::method_tunnel(_In_ module &mod, _In_ method *inner) :
m_inner(inner),
method(mod)
{ {
} }
eap::method_noneap::method_noneap(_Inout_ method_noneap &&other) : eap::method_tunnel::method_tunnel(_Inout_ method_tunnel &&other) noexcept :
m_packet_res(std::move(other.m_packet_res)), m_inner(std::move(other.m_inner)),
method (std::move(other )) method (std::move(other ))
{ {
} }
eap::method_noneap& eap::method_noneap::operator=(_Inout_ method_noneap &&other) eap::method_tunnel& eap::method_tunnel::operator=(_Inout_ method_tunnel &&other) noexcept
{ {
if (this != std::addressof(other)) { if (this != std::addressof(other)) {
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move method with same credentials only! (method&)*this = std::move(other );
(method&)*this = std::move(other ); m_inner = std::move(other.m_inner);
m_packet_res = std::move(other.m_packet_res);
} }
return *this; return *this;
} }
void eap::method_noneap::get_response_packet( void eap::method_tunnel::begin_session(
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket, _In_ DWORD dwFlags,
_Inout_ DWORD *pdwSendPacketSize) _In_ const EapAttributes *pAttributeArray,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ DWORD dwMaxSendPacketSize)
{ {
assert(pdwSendPacketSize); method::begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
assert(pSendPacket);
size_t size_packet = m_packet_res.size(); assert(m_inner);
if (size_packet > *pdwSendPacketSize) m_inner->begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
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).", size_packet, *pdwSendPacketSize));
memcpy(pSendPacket, m_packet_res.data(), size_packet);
*pdwSendPacketSize = (DWORD)size_packet;
m_packet_res.clear();
} }
void eap::method_noneap::append_avp(_In_ unsigned int code, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size) void eap::method_tunnel::end_session()
{ {
unsigned int assert(m_inner);
padding = (unsigned int)((4 - size) % 4), m_inner->end_session();
size_outer;
m_packet_res.reserve( method::end_session();
m_packet_res.size() +
(size_outer =
sizeof(diameter_avp_header) + // Diameter header
size) + // Data
padding); // Data padding
// Diameter AVP header
diameter_avp_header hdr;
*reinterpret_cast<unsigned int*>(hdr.code) = htonl(code);
hdr.flags = flags;
hton24(size_outer, hdr.length);
m_packet_res.insert(m_packet_res.end(), reinterpret_cast<const unsigned char*>(&hdr), reinterpret_cast<const unsigned char*>(&hdr + 1));
// Data
m_packet_res.insert(m_packet_res.end(), reinterpret_cast<const unsigned char*>(data), reinterpret_cast<const unsigned char*>(data) + size);
m_packet_res.insert(m_packet_res.end(), padding, 0);
} }
void eap::method_noneap::append_avp(_In_ unsigned int code, _In_ unsigned int vendor_id, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size) EapPeerMethodResponseAction eap::method_tunnel::process_request_packet(
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
_In_ DWORD dwReceivedPacketSize)
{ {
unsigned int assert(m_inner);
padding = (unsigned int)((4 - size) % 4), return m_inner->process_request_packet(pReceivedPacket, dwReceivedPacketSize);
size_outer; }
m_packet_res.reserve(
m_packet_res.size() + void eap::method_tunnel::get_response_packet(
(size_outer = _Out_ sanitizing_blob &packet,
sizeof(diameter_avp_header_ven) + // Diameter header _In_opt_ DWORD size_max)
size) + // Data {
padding); // Data padding assert(m_inner);
m_inner->get_response_packet(packet, size_max);
// Diameter AVP header }
diameter_avp_header_ven hdr;
*reinterpret_cast<unsigned int*>(hdr.code) = htonl(code);
hdr.flags = flags | diameter_avp_flag_vendor; void eap::method_tunnel::get_result(
hton24(size_outer, hdr.length); _In_ EapPeerMethodResultReason reason,
*reinterpret_cast<unsigned int*>(hdr.vendor) = htonl(vendor_id); _Inout_ EapPeerMethodResult *pResult)
m_packet_res.insert(m_packet_res.end(), reinterpret_cast<const unsigned char*>(&hdr), reinterpret_cast<const unsigned char*>(&hdr + 1)); {
assert(m_inner);
// Data m_inner->get_result(reason, pResult);
m_packet_res.insert(m_packet_res.end(), reinterpret_cast<const unsigned char*>(data), reinterpret_cast<const unsigned char*>(data) + size); }
m_packet_res.insert(m_packet_res.end(), padding, 0);
void eap::method_tunnel::get_ui_context(_Out_ sanitizing_blob &context_data)
{
assert(m_inner);
// Default implementation forwards UI context handling to the inner method.
m_inner->get_ui_context(context_data);
}
EapPeerMethodResponseAction eap::method_tunnel::set_ui_context(
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ DWORD dwUIContextDataSize)
{
assert(m_inner);
// Default implementation forwards UI context handling to the inner method.
return m_inner->set_ui_context(pUIContextData, dwUIContextDataSize);
}
void eap::method_tunnel::get_response_attributes(_Out_ EapAttributes *pAttribs)
{
assert(m_inner);
m_inner->get_response_attributes(pAttribs);
}
EapPeerMethodResponseAction eap::method_tunnel::set_response_attributes(_In_ const EapAttributes *pAttribs)
{
assert(m_inner);
return m_inner->set_response_attributes(pAttribs);
}
//////////////////////////////////////////////////////////////////////
// eap::method_eap
//////////////////////////////////////////////////////////////////////
eap::method_eap::method_eap(_In_ module &mod, _In_ winstd::eap_type_t eap_method, _In_ method *inner) :
m_eap_method(eap_method),
m_id(0),
m_send_nak(false),
method_tunnel(mod, inner)
{
}
eap::method_eap::method_eap(_Inout_ method_eap &&other) noexcept :
m_eap_method (std::move(other.m_eap_method)),
m_id (std::move(other.m_id )),
m_send_nak (std::move(other.m_send_nak )),
method_tunnel(std::move(other ))
{
}
eap::method_eap& eap::method_eap::operator=(_Inout_ method_eap &&other) noexcept
{
if (this != std::addressof(other)) {
assert(m_eap_method == other.m_eap_method); // Move method within same EAP method type only!
(method_tunnel&)*this = std::move(other );
m_id = std::move(other.m_id );
m_send_nak = std::move(other.m_send_nak);
}
return *this;
}
void eap::method_eap::begin_session(
_In_ DWORD dwFlags,
_In_ const EapAttributes *pAttributeArray,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ DWORD dwMaxSendPacketSize)
{
// Initialize tunnel method session only.
method::begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
// Inner method can generate packets of up to 64kB (less the EAP packet header).
// Initialize inner method with appropriately less packet size maximum.
if (dwMaxSendPacketSize < sizeof(EapPacket))
throw invalid_argument(string_printf(__FUNCTION__ " Maximum packet size too small (minimum: %zu, available: %u).", sizeof(EapPacket) + 1, dwMaxSendPacketSize));
assert(m_inner);
m_inner->begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, std::min<DWORD>(dwMaxSendPacketSize, MAXWORD) - sizeof(EapPacket));
}
EapPeerMethodResponseAction eap::method_eap::process_request_packet(
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
_In_ DWORD dwReceivedPacketSize)
{
assert(dwReceivedPacketSize >= sizeof(EapPacket)); // Request packet should contain an EAP packet header at least.
auto hdr = reinterpret_cast<const EapPacket*>(pReceivedPacket);
// This must be an EAP-Request packet.
if (hdr->Code != EapCodeRequest)
throw invalid_argument(string_printf(__FUNCTION__ " Unknown EAP packet received (expected: %u, received: %u).", EapCodeRequest, (int)hdr->Code));
// Check packet size.
DWORD size_packet = ntohs(*reinterpret_cast<const unsigned short*>(hdr->Length));
if (size_packet > dwReceivedPacketSize)
throw invalid_argument(string_printf(__FUNCTION__ " Incorrect EAP packet length (expected: %uB, received: %uB).", size_packet, dwReceivedPacketSize));
// Save request packet ID to make matching response packet in get_response_packet() later.
m_id = hdr->Id;
if (hdr->Data[0] != m_eap_method) {
// Unsupported EAP method. Respond with Legacy Nak.
m_send_nak = true;
return EapPeerMethodResponseActionSend;
} else {
// Process the data with underlying method.
m_send_nak = false;
return method_tunnel::process_request_packet(hdr->Data + 1, size_packet - sizeof(EapPacket));
}
}
void eap::method_eap::get_response_packet(
_Out_ sanitizing_blob &packet,
_In_opt_ DWORD size_max)
{
assert(size_max >= sizeof(EapPacket)); // We should be able to respond with at least an EAP packet header.
if (size_max > MAXWORD) size_max = MAXWORD; // EAP packets maximum size is 64kB.
// Prepare EAP packet header.
EapPacket hdr;
hdr.Code = (BYTE)EapCodeResponse;
hdr.Id = m_id;
if (!m_send_nak) {
hdr.Data[0] = m_eap_method;
packet.reserve(size_max); // To avoid reallocation when inserting EAP packet header later.
// Get data from underlying method.
method_tunnel::get_response_packet(packet, size_max - sizeof(EapPacket));
} else {
// Respond with Legacy Nak suggesting our EAP method to continue.
hdr.Data[0] = eap_type_nak;
// Check packet size. We will suggest one EAP method alone, so we need one byte for data.
size_t size_packet = sizeof(EapPacket) + 1;
if (size_packet > 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: %zu, maximum: %u).", size_packet, size_max));
packet.reserve(size_packet); // To avoid reallocation when inserting EAP packet header later.
// Data of Legacy Nak packet is a list of supported EAP types: our method alone.
packet.assign(1, m_eap_method);
}
size_t size_packet = packet.size() + sizeof(EapPacket);
assert(size_packet <= MAXWORD); // Packets spanning over 64kB are not supported.
*reinterpret_cast<unsigned short*>(hdr.Length) = htons((unsigned short)size_packet);
// Insert EAP packet header before data.
packet.insert(packet.begin(), reinterpret_cast<const unsigned char*>(&hdr), reinterpret_cast<const unsigned char*>(&hdr + 1));
} }

View File

@@ -28,7 +28,7 @@ using namespace winstd;
// eap::module // eap::module
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
eap::module::module(eap_type_t eap_method) : eap::module::module(_In_ eap_type_t eap_method) :
m_eap_method(eap_method), m_eap_method(eap_method),
m_instance(NULL) m_instance(NULL)
{ {
@@ -90,6 +90,12 @@ EAP_ERROR* eap::module::make_error(_In_ std::exception &err) const
wstring what; wstring what;
MultiByteToWideChar(CP_ACP, 0, err.what(), -1, what); MultiByteToWideChar(CP_ACP, 0, err.what(), -1, what);
{
eap_runtime_error *e = dynamic_cast<eap_runtime_error*>(&err);
if (e)
return make_error(e->number(), e->root_cause(), e->repair(), e->reason(), &e->root_cause_id(), &e->repair_id(), &e->help_link_id());
}
{ {
win_runtime_error *e = dynamic_cast<win_runtime_error*>(&err); win_runtime_error *e = dynamic_cast<win_runtime_error*>(&err);
if (e) if (e)
@@ -122,16 +128,29 @@ EAP_ERROR* eap::module::make_error(_In_ std::exception &err) const
} }
BYTE* eap::module::alloc_memory(_In_ size_t size) EAP_ERROR* eap::module::make_error(_In_ const EAP_ERROR *err) const
{
return make_error(
err->dwWinError,
err->pRootCauseString,
err->pRepairString,
err->dwReasonCode,
&(err->rootCauseGuid),
&(err->repairGuid),
&(err->helpLinkGuid));
}
BYTE* eap::module::alloc_memory(_In_ size_t size) const
{ {
BYTE *p = (BYTE*)HeapAlloc(m_heap, 0, size); BYTE *p = (BYTE*)HeapAlloc(m_heap, 0, size);
if (!p) if (!p)
throw win_runtime_error(winstd::string_printf(__FUNCTION__ " Error allocating memory for BLOB (%uB).", size)); throw win_runtime_error(winstd::string_printf(__FUNCTION__ " Error allocating memory for BLOB (%zuB).", size));
return p; return p;
} }
void eap::module::free_memory(_In_ BYTE *ptr) void eap::module::free_memory(_In_ BYTE *ptr) const
{ {
#if !EAP_ENCRYPT_BLOBS #if !EAP_ENCRYPT_BLOBS
// Since we do security here and some of the BLOBs contain credentials, sanitize every memory block before freeing. // Since we do security here and some of the BLOBs contain credentials, sanitize every memory block before freeing.
@@ -141,7 +160,7 @@ void eap::module::free_memory(_In_ BYTE *ptr)
} }
void eap::module::free_error_memory(_In_ EAP_ERROR *err) void eap::module::free_error_memory(_In_ EAP_ERROR *err) const
{ {
// pRootCauseString and pRepairString always trail the ppEapError to reduce number of (de)allocations. // pRootCauseString and pRepairString always trail the ppEapError to reduce number of (de)allocations.
HeapFree(m_heap, 0, err); HeapFree(m_heap, 0, err);
@@ -174,7 +193,7 @@ eap::config_method* eap::module::make_config_method()
} }
std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash) const std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash) const
{ {
// Generate 256-bit AES session key. // Generate 256-bit AES session key.
crypt_key key_aes; crypt_key key_aes;
@@ -183,9 +202,11 @@ std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytec
// Import the public RSA key. // Import the public RSA key.
HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PUBLIC), RT_RCDATA); HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PUBLIC), RT_RCDATA);
assert(res); if (!res)
throw winstd::win_runtime_error(__FUNCTION__ " FindResource failed.");
HGLOBAL res_handle = LoadResource(m_instance, res); HGLOBAL res_handle = LoadResource(m_instance, res);
assert(res_handle); if (!res_handle)
throw winstd::win_runtime_error(__FUNCTION__ " LoadResource failed.");
crypt_key key_rsa; crypt_key key_rsa;
unique_ptr<CERT_PUBLIC_KEY_INFO, LocalFree_delete<CERT_PUBLIC_KEY_INFO> > keyinfo_data; unique_ptr<CERT_PUBLIC_KEY_INFO, LocalFree_delete<CERT_PUBLIC_KEY_INFO> > keyinfo_data;
DWORD keyinfo_size = 0; DWORD keyinfo_size = 0;
@@ -251,7 +272,7 @@ void eap::peer::query_credential_input_fields(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_Inout_ EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldsArray) const _Out_ EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldsArray) const
{ {
UNREFERENCED_PARAMETER(hUserImpersonationToken); UNREFERENCED_PARAMETER(hUserImpersonationToken);
UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(dwFlags);
@@ -269,8 +290,8 @@ void eap::peer::query_user_blob_from_credential_input_fields(
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ const EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldArray, _In_ const EAP_CONFIG_INPUT_FIELD_ARRAY *pEapConfigInputFieldArray,
_Inout_ DWORD *pdwUsersBlobSize, _Out_ DWORD *pdwUsersBlobSize,
_Inout_ BYTE **ppUserBlob) const _Out_ BYTE **ppUserBlob) const
{ {
UNREFERENCED_PARAMETER(hUserImpersonationToken); UNREFERENCED_PARAMETER(hUserImpersonationToken);
UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(dwFlags);
@@ -289,7 +310,7 @@ void eap::peer::query_interactive_ui_input_fields(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize, _In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_Inout_ EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData) const _Out_ EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData) const
{ {
UNREFERENCED_PARAMETER(dwVersion); UNREFERENCED_PARAMETER(dwVersion);
UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(dwFlags);
@@ -302,13 +323,13 @@ void eap::peer::query_interactive_ui_input_fields(
void eap::peer::query_ui_blob_from_interactive_ui_input_fields( void eap::peer::query_ui_blob_from_interactive_ui_input_fields(
_In_ DWORD dwVersion, _In_ DWORD dwVersion,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize, _In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData, _In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Inout_ DWORD *pdwDataFromInteractiveUISize, _Out_ DWORD *pdwDataFromInteractiveUISize,
_Inout_ BYTE **ppDataFromInteractiveUI) const _Outptr_result_buffer_(*pdwDataFromInteractiveUISize) BYTE **ppDataFromInteractiveUI) const
{ {
UNREFERENCED_PARAMETER(dwVersion); UNREFERENCED_PARAMETER(dwVersion);
UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(dwFlags);

View File

@@ -24,6 +24,7 @@
#include "../include/Credentials.h" #include "../include/Credentials.h"
#include "../include/Method.h" #include "../include/Method.h"
#include "../include/Module.h" #include "../include/Module.h"
#include "../include/UIContext.h"
#include "../include/EAP.h" #include "../include/EAP.h"
#include "../include/EAPXML.h" #include "../include/EAPXML.h"

View File

@@ -0,0 +1,100 @@
/*
Copyright 2015-2016 Amebis
Copyright 2016 GÉANT
This file is part of GÉANTLink.
GÉANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GÉANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
#include "StdAfx.h"
using namespace std;
using namespace winstd;
//////////////////////////////////////////////////////////////////////
// eap::ui_context
//////////////////////////////////////////////////////////////////////
eap::ui_context::ui_context(_In_ config_connection &cfg, _In_ credentials_connection &cred) :
m_cfg(cfg),
m_cred(cred)
{
}
eap::ui_context::ui_context(_In_ const ui_context &other) :
m_cfg (other.m_cfg ),
m_cred (other.m_cred),
packable(other )
{
}
eap::ui_context::ui_context(_Inout_ ui_context &&other) noexcept :
m_cfg ( other.m_cfg ),
m_cred ( other.m_cred ),
packable(std::move(other ))
{
}
eap::ui_context& eap::ui_context::operator=(_In_ const ui_context &other)
{
if (this != &other) {
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!
(packable&)*this = other;
}
return *this;
}
eap::ui_context& eap::ui_context::operator=(_Inout_ ui_context &&other) noexcept
{
if (this != &other) {
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!
(packable&)*this = std::move(other);
}
return *this;
}
void eap::ui_context::operator<<(_Inout_ cursor_out &cursor) const
{
packable::operator<<(cursor);
cursor << m_cfg ;
cursor << m_cred;
}
size_t eap::ui_context::get_pk_size() const
{
return
packable::get_pk_size() +
pksizeof(m_cfg ) +
pksizeof(m_cred);
}
void eap::ui_context::operator>>(_Inout_ cursor_in &cursor)
{
packable::operator>>(cursor);
cursor >> m_cfg ;
cursor >> m_cred;
}

View File

@@ -29,26 +29,26 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{D4B54856-BE1F-4937-A8F7-495125BE76BE}</ProjectGuid> <ProjectGuid>{D4B54856-BE1F-4937-A8F7-495125BE76BE}</ProjectGuid>
<RootNamespace>EAPBase_UI</RootNamespace> <RootNamespace>EAPBase_UI</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -56,21 +56,21 @@
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

View File

@@ -27,101 +27,76 @@
#include <Windows.h> #include <Windows.h>
///
/// Reusable EAP dialog banner for `wxEAPConfigDialog` and `wxEAPCredentialsDialog`
///
class wxEAPBannerPanel; class wxEAPBannerPanel;
///
/// EAP top-most configuration dialog
///
template <class _wxT> class wxEAPConfigDialog; template <class _wxT> class wxEAPConfigDialog;
///
/// EAP general-use dialog
///
class wxEAPGeneralDialog; class wxEAPGeneralDialog;
///
/// EAP method credential dialog
///
class wxEAPCredentialsDialog; class wxEAPCredentialsDialog;
///
/// EAP connection credential dialog
///
class wxEAPCredentialsConnectionDialog;
///
/// EAP general note
///
class wxEAPNotePanel; class wxEAPNotePanel;
///
/// EAP provider-locked congifuration note
///
class wxEAPProviderLockedPanel; class wxEAPProviderLockedPanel;
///
/// EAP credential warning note
///
class wxEAPCredentialWarningPanel; class wxEAPCredentialWarningPanel;
#if __DANGEROUS__LOG_CONFIDENTIAL_DATA #if __DANGEROUS__LOG_CONFIDENTIAL_DATA
///
/// EAP credential logging enabled warning note
///
class wxEAPCredentialLogWarningPanel; class wxEAPCredentialLogWarningPanel;
#endif #endif
///
/// EAP Configuration window
///
class wxEAPConfigWindow; class wxEAPConfigWindow;
///
/// EAP provider contact info config panel
///
class wxEAPProviderContactInfoPanel; class wxEAPProviderContactInfoPanel;
///
/// EAP provider identity config panel
///
class wxEAPProviderIDPanel; class wxEAPProviderIDPanel;
///
/// EAP provider configuration dialog
///
class wxEAPConfigProvider; class wxEAPConfigProvider;
///
/// Base template for credential configuration panel
///
template <class _Tcred, class _wxT> class wxEAPCredentialsConfigPanel; template <class _Tcred, class _wxT> class wxEAPCredentialsConfigPanel;
///
/// Helper template for all credential entry panels
///
template <class _Tcred, class _Tbase> class wxEAPCredentialsPanel; template <class _Tcred, class _Tbase> class wxEAPCredentialsPanel;
template <class _Tcred, class _Tbase> class wxIdentityCredentialsPanel;
template <class _Tcred, class _Tbase> class wxPasswordCredentialsPanel;
class wxEAPProviderSelectDialog;
/// ///
/// Generic password credential entry panel /// \defgroup EAPBaseGUI GUI
/// Graphical User Interface
/// ///
template <class _Tcred, class _Tbase> class wxPasswordCredentialsPanel; /// @{
/// ///
/// Loads icon from resource /// Loads icon from resource
/// ///
/// When icon of desired \p cx × \p cy dimensions is not found, the most appropriate variant (larger if available) is loaded and scaled to \p cx × \p cy.
///
/// \sa [LoadIconWithScaleDown function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775703.aspx)
///
/// \param[in] hinst Resource module instance handle
/// \param[in] pszName Resource name (`MAKEINTRESOURCE()` macro can be used for numerical resources)
/// \param[in] cx Desired width of the icon
/// \param[in] cy Desired height of the icon
///
/// \returns
/// - Loaded icon when successful;
/// - \c wxNullIcon otherwise.
///
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx = GetSystemMetrics(SM_CXICON), int cy = GetSystemMetrics(SM_CYICON)); inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx = GetSystemMetrics(SM_CXICON), int cy = GetSystemMetrics(SM_CYICON));
/// ///
/// Loads icon from resource /// Loads icon from resource
/// ///
/// When icon of desired \p size dimensions is not found, the most appropriate variant (larger if available) is loaded and scaled to \p size.
///
/// \sa [LoadIconWithScaleDown function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775703.aspx)
///
/// \param[in] hinst Resource module instance handle
/// \param[in] pszName Resource name (`MAKEINTRESOURCE()` macro can be used for numerical resources)
/// \param[in] size Desired width and height of the icon
///
/// \returns
/// - Loaded icon when successful;
/// - \c wxNullIcon otherwise.
///
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, const wxSize &size); inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, const wxSize &size);
/// ///
/// Returns GUI displayable provider name /// Returns GUI displayable provider name
/// ///
/// \param[in] id Provider name
///
/// \returns
/// - \p id when \p id is not blank;
/// - localized "(Your Organization)" otherwise.
///
inline wxString wxEAPGetProviderName(const std::wstring &id); inline wxString wxEAPGetProviderName(const std::wstring &id);
/// ///
@@ -129,19 +104,14 @@ inline wxString wxEAPGetProviderName(const std::wstring &id);
/// ///
inline void wxInitializeConfig(); inline void wxInitializeConfig();
/// @}
namespace eap
{
///
/// Base class to prevent multiple instances of the same dialog
///
class monitor_ui;
}
#pragma once #pragma once
#include <wx/msw/winundef.h> // Fixes `CreateDialog` name collision #pragma warning(push)
#pragma warning(disable: 26444)
#include "../res/wxEAP_UI.h" #include "../res/wxEAP_UI.h"
#pragma warning(pop)
#include "../../EAPBase/include/Config.h" #include "../../EAPBase/include/Config.h"
#include "../../EAPBase/include/Credentials.h" #include "../../EAPBase/include/Credentials.h"
@@ -158,13 +128,24 @@ namespace eap
#include <list> #include <list>
#include <memory> #include <memory>
#pragma warning(push)
#pragma warning(disable: 26444)
/// \addtogroup EAPBaseGUI
/// @{
///
/// Reusable EAP dialog banner for `wxEAPConfigDialog` and `wxEAPCredentialsDialog`
///
class wxEAPBannerPanel : public wxEAPBannerPanelBase class wxEAPBannerPanel : public wxEAPBannerPanelBase
{ {
public: public:
/// ///
/// Constructs a banner pannel and set the title text to product name /// Constructs a banner pannel and set the title text to product name
/// ///
/// \param[in] parent Parent window
///
wxEAPBannerPanel(wxWindow* parent); wxEAPBannerPanel(wxWindow* parent);
protected: protected:
@@ -174,6 +155,9 @@ protected:
}; };
///
/// EAP top-most configuration dialog template
///
template <class _wxT> template <class _wxT>
class wxEAPConfigDialog : public wxEAPConfigDialogBase class wxEAPConfigDialog : public wxEAPConfigDialogBase
{ {
@@ -217,7 +201,7 @@ public:
m_providers), m_providers),
is_single ? is_single ?
wxEAPGetProviderName(provider->m_name) : wxEAPGetProviderName(provider->m_name) :
winstd::tstring_printf(_T("%s (%u)"), static_cast<LPCTSTR>(wxEAPGetProviderName(provider->m_name)), count)); winstd::tstring_printf(_T("%s (%zu)"), static_cast<LPCTSTR>(wxEAPGetProviderName(provider->m_name)), count));
} }
} }
@@ -270,7 +254,11 @@ protected:
// Create provider. // Create provider.
eap::config_provider cfg_provider(m_cfg.m_module); eap::config_provider cfg_provider(m_cfg.m_module);
GUID guid; GUID guid;
CoCreateGuid(&guid); HRESULT hr = CoCreateGuid(&guid);
if (FAILED(hr)) {
wxLogError(winstd::tstring_printf(wxT("error 0x%08x generating GUID"), hr).c_str());
return;
}
cfg_provider.m_namespace = L"urn:uuid"; cfg_provider.m_namespace = L"urn:uuid";
cfg_provider.m_id = winstd::wstring_guid(guid).substr(1, 36); cfg_provider.m_id = winstd::wstring_guid(guid).substr(1, 36);
cfg_provider.m_methods.push_back(std::move(cfg_method)); cfg_provider.m_methods.push_back(std::move(cfg_method));
@@ -280,7 +268,7 @@ protected:
eap::config_provider &cfg_provider2 = m_cfg.m_providers.back(); eap::config_provider &cfg_provider2 = m_cfg.m_providers.back();
eap::config_method *cfg_method2 = cfg_provider2.m_methods.front().get(); eap::config_method *cfg_method2 = cfg_provider2.m_methods.front().get();
_wxT *page = new _wxT(cfg_provider2, *cfg_method2, m_providers); _wxT *page = new _wxT(cfg_provider2, *cfg_method2, m_providers);
m_providers->InsertPage(m_providers->GetSelection() + 1, page, wxEAPGetProviderName(cfg_provider2.m_name), true); m_providers->InsertPage((size_t)m_providers->GetSelection() + 1, page, wxEAPGetProviderName(cfg_provider2.m_name), true);
this->Layout(); this->Layout();
this->GetSizer()->Fit(this); this->GetSizer()->Fit(this);
@@ -333,12 +321,22 @@ protected:
}; };
///
/// EAP general-use dialog
///
class wxEAPGeneralDialog : public wxEAPGeneralDialogBase class wxEAPGeneralDialog : public wxEAPGeneralDialogBase
{ {
public: public:
/// ///
/// Constructs a dialog /// Constructs a dialog
/// ///
/// \param[in] parent Parent window
/// \param[in] id An identifier for the dialog. A value of \c wxID_ANY 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.
///
wxEAPGeneralDialog(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); wxEAPGeneralDialog(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
/// ///
@@ -358,31 +356,62 @@ protected:
}; };
///
/// EAP method credential dialog
///
class wxEAPCredentialsDialog : public wxEAPGeneralDialog class wxEAPCredentialsDialog : public wxEAPGeneralDialog
{ {
public: 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);
}; };
class wxEAPCredentialsConnectionDialog : public wxEAPCredentialsConnectionDialogBase ///
/// EAP provider select dialog
///
class wxEAPProviderSelectDialog : public wxEAPProviderSelectDialogBase
{ {
public: public:
/// ///
/// Constructs a credential dialog /// Constructs a provider select dialog
/// ///
wxEAPCredentialsConnectionDialog(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("EAP Credentials"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); /// \param[inout] cfg Connection configuration
/// \param[in] parent Parent window
///
wxEAPProviderSelectDialog(eap::config_connection &cfg, wxWindow* parent);
///
/// Returns pointer to selected provider or NULL if no provider is selected.
///
inline eap::config_provider* GetSelection() const
{
return m_selected;
}
protected: protected:
/// \cond internal /// \cond internal
virtual void OnInitDialog(wxInitDialogEvent& event); virtual void OnProvSelect(wxCommandEvent& event);
/// \endcond /// \endcond
protected:
eap::config_provider* m_selected; ///< Pointer to selected provider (or NULL if none selected).
}; };
///
/// EAP general note
///
class wxEAPNotePanel : public wxEAPNotePanelBase class wxEAPNotePanel : public wxEAPNotePanelBase
{ {
public: public:
@@ -422,16 +451,19 @@ protected:
/// \endcond /// \endcond
protected: protected:
wxStaticText *m_provider_notice; wxStaticText *m_provider_notice; ///< Identity provider notice
wxStaticText *m_help_web_label; wxStaticText *m_help_web_label; ///< Helpdesk URL label
wxHyperlinkCtrl *m_help_web_value; wxHyperlinkCtrl *m_help_web_value; ///< Helpdesk URL
wxStaticText *m_help_email_label; wxStaticText *m_help_email_label; ///< Helpdesk e-mail label
wxHyperlinkCtrl *m_help_email_value; wxHyperlinkCtrl *m_help_email_value; ///< Helpdesk e-mail
wxStaticText *m_help_phone_label; wxStaticText *m_help_phone_label; ///< Helpdesk phone number label
wxHyperlinkCtrl *m_help_phone_value; wxHyperlinkCtrl *m_help_phone_value; ///< Helpdesk phone number
}; };
///
/// EAP provider-locked congifuration note
///
class wxEAPProviderLockedPanel : public wxEAPNotePanel class wxEAPProviderLockedPanel : public wxEAPNotePanel
{ {
public: public:
@@ -442,6 +474,9 @@ public:
}; };
///
/// EAP credential warning note
///
class wxEAPCredentialWarningPanel : public wxEAPNotePanel class wxEAPCredentialWarningPanel : public wxEAPNotePanel
{ {
public: public:
@@ -452,6 +487,9 @@ public:
}; };
///
/// EAP credential logging enabled warning note
///
#if __DANGEROUS__LOG_CONFIDENTIAL_DATA #if __DANGEROUS__LOG_CONFIDENTIAL_DATA
class wxEAPCredentialLogWarningPanel : public wxEAPNotePanel class wxEAPCredentialLogWarningPanel : public wxEAPNotePanel
{ {
@@ -463,7 +501,9 @@ public:
}; };
#endif #endif
///
/// EAP Configuration window
///
class wxEAPConfigWindow : public wxScrolledWindow class wxEAPConfigWindow : public wxScrolledWindow
{ {
public: public:
@@ -471,7 +511,7 @@ public:
/// Constructs a configuration window /// Constructs a configuration window
/// ///
/// \param[in] prov Provider configuration data /// \param[in] prov Provider configuration data
/// \param[inout] cfg Configuration data /// \param[inout] cfg Method configuration data
/// \param[in] parent Parent window /// \param[in] parent Parent window
/// ///
wxEAPConfigWindow(eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent); wxEAPConfigWindow(eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent);
@@ -482,8 +522,21 @@ public:
virtual ~wxEAPConfigWindow(); virtual ~wxEAPConfigWindow();
public: public:
inline eap::config_provider& GetProvider() const { return m_prov; } ///
inline eap::config_method & GetConfig () const { return m_cfg ; } /// Returns reference to configuration provider
///
inline eap::config_provider& GetProvider() const
{
return m_prov;
}
///
/// Returns reference to method configuration
///
inline eap::config_method& GetConfig() const
{
return m_cfg;
}
protected: protected:
/// \cond internal /// \cond internal
@@ -496,6 +549,9 @@ protected:
}; };
///
/// EAP provider contact info config panel
///
class wxEAPProviderContactInfoPanel : public wxEAPProviderContactInfoPanelBase class wxEAPProviderContactInfoPanel : public wxEAPProviderContactInfoPanelBase
{ {
public: public:
@@ -520,6 +576,9 @@ protected:
}; };
///
/// EAP provider identity config panel
///
class wxEAPProviderIDPanel : public wxEAPProviderIDPanelBase class wxEAPProviderIDPanel : public wxEAPProviderIDPanelBase
{ {
public: public:
@@ -542,6 +601,9 @@ protected:
}; };
///
/// EAP provider lock config panel
///
class wxEAPProviderLockPanel : public wxEAPProviderLockPanelBase class wxEAPProviderLockPanel : public wxEAPProviderLockPanelBase
{ {
public: public:
@@ -564,6 +626,9 @@ protected:
}; };
///
/// EAP provider configuration dialog
///
class wxEAPConfigProvider : public wxEAPGeneralDialog class wxEAPConfigProvider : public wxEAPGeneralDialog
{ {
public: public:
@@ -572,6 +637,11 @@ public:
/// ///
/// \param[inout] prov Provider configuration data /// \param[inout] prov Provider configuration data
/// \param[in] parent Parent window /// \param[in] parent Parent window
/// \param[in] id An identifier for the dialog. A value of \c wxID_ANY 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.
/// ///
wxEAPConfigProvider(eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("Provider Settings"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); wxEAPConfigProvider(eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("Provider Settings"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
@@ -583,6 +653,9 @@ protected:
}; };
///
/// Base template for credential configuration panel
///
template <class _Tcred, class _wxT> template <class _Tcred, class _wxT>
class wxEAPCredentialsConfigPanel : public wxEAPCredentialsConfigPanelBase class wxEAPCredentialsConfigPanel : public wxEAPCredentialsConfigPanelBase
{ {
@@ -591,8 +664,9 @@ public:
/// Constructs a credential configuration panel /// Constructs a credential configuration panel
/// ///
/// \param[in] prov Provider configuration data /// \param[in] prov Provider configuration data
/// \param[inout] cfg Configuration data /// \param[inout] cfg Method configuration data
/// \param[in] parent Parent window /// \param[in] parent Parent window
/// \param[in] method Method name to display
/// ///
wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, wxWindow *parent, const wxString &method = wxEmptyString) : wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, wxWindow *parent, const wxString &method = wxEmptyString) :
m_prov(prov), m_prov(prov),
@@ -755,9 +829,7 @@ protected:
wxEAPCredentialsConfigPanelBase::OnSetConfig(event); wxEAPCredentialsConfigPanelBase::OnSetConfig(event);
wxEAPCredentialsDialog dlg(m_prov, this); wxEAPCredentialsDialog dlg(m_prov, this);
_wxT *panel = new _wxT(m_prov, m_cfg, m_cred_config, &dlg, true); _wxT *panel = new _wxT(m_prov, m_cfg, m_cred_config, &dlg, true);
dlg.AddContent(panel); dlg.AddContent(panel);
if (dlg.ShowModal() == wxID_OK) if (dlg.ShowModal() == wxID_OK)
UpdateConfigIdentity(); UpdateConfigIdentity();
@@ -825,23 +897,21 @@ private:
}; };
///
/// Helper template for all credential entry panels
///
template <class _Tcred, class _Tbase> template <class _Tcred, class _Tbase>
class wxEAPCredentialsPanel : public _Tbase class wxEAPCredentialsPanel : public _Tbase
{ {
private:
/// \cond internal
typedef wxEAPCredentialsPanel<_Tcred, _Tbase> _Tthis;
/// \endcond
public: public:
/// ///
/// Constructs a credentials panel /// Constructs a credentials panel
/// ///
/// \param[in] prov Provider configuration data /// \param[in] prov Provider configuration data
/// \param[in] cfg Configuration data /// \param[in] cfg Method configuration data
/// \param[inout] cred Credentials data /// \param[inout] cred Credentials data
/// \param[in] parent Parent window /// \param[in] parent Parent window
/// \param[in] is_config Is this panel used to config credentials? /// \param[in] is_config Is this panel used to config credentials?
/// ///
wxEAPCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) : wxEAPCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) :
m_prov(prov), m_prov(prov),
@@ -858,12 +928,20 @@ public:
m_remember = NULL; m_remember = NULL;
} }
///
/// (Un)checks "Remember credentials" checkbox
///
/// \param[in] val If \c true, checkbox is checked; otherwise cleared
///
virtual void SetRemember(bool val) virtual void SetRemember(bool val)
{ {
if (m_remember) if (m_remember)
m_remember->SetValue(val); m_remember->SetValue(val);
} }
///
/// Returns \c true if "Remember credentials" checkbox is checked
///
virtual bool GetRemember() const virtual bool GetRemember() const
{ {
return m_remember ? return m_remember ?
@@ -880,27 +958,29 @@ protected:
}; };
///
/// Generic identity credential entry panel
///
template <class _Tcred, class _Tbase> template <class _Tcred, class _Tbase>
class wxPasswordCredentialsPanel : public wxEAPCredentialsPanel<_Tcred, _Tbase> class wxIdentityCredentialsPanel : public wxEAPCredentialsPanel<_Tcred, _Tbase>
{ {
public: public:
/// ///
/// Constructs a password credentials panel /// Constructs a identity credentials panel
/// ///
/// \param[in] prov Provider configuration data /// \param[in] prov Provider configuration data
/// \param[in] cfg Configuration data /// \param[in] cfg Method configuration data
/// \param[inout] cred Credentials data /// \param[inout] cred Credentials data
/// \param[in] parent Parent window /// \param[in] parent Parent window
/// \param[in] is_config Is this panel used to config credentials? /// \param[in] is_config Is this panel used to config credentials?
/// ///
wxPasswordCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) : wxIdentityCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) :
m_password_set(false),
wxEAPCredentialsPanel<_Tcred, _Tbase>(prov, cfg, cred, parent, is_config) wxEAPCredentialsPanel<_Tcred, _Tbase>(prov, cfg, cred, parent, is_config)
{ {
// Load and set icon. // Load and set icon.
winstd::library lib_shell32; winstd::library lib_shell32;
if (lib_shell32.load(_T("imageres.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE)) if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(82))); m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(/*16770*/269)));
bool layout = false; bool layout = false;
if (!m_prov.m_lbl_alt_credential.empty()) { if (!m_prov.m_lbl_alt_credential.empty()) {
@@ -914,11 +994,6 @@ public:
layout = true; layout = true;
} }
if (!m_prov.m_lbl_alt_password.empty()) {
m_password_label->SetLabel(m_prov.m_lbl_alt_password);
layout = true;
}
if (layout) if (layout)
this->Layout(); this->Layout();
} }
@@ -930,26 +1005,85 @@ protected:
{ {
m_identity->SetValue(m_cred.m_identity); m_identity->SetValue(m_cred.m_identity);
m_identity->SetSelection(0, -1); m_identity->SetSelection(0, -1);
m_password->SetValue(m_cred.m_password.empty() ? wxEmptyString : wxT("dummypass"));
m_password_set = false;
if (!m_is_config && m_cfg.m_use_cred) { if (!m_is_config && m_cfg.m_use_cred) {
// Credential prompt mode & Using configured credentials // Credential prompt mode & Using configured credentials
m_identity_label->Enable(false); m_identity_label->Enable(false);
m_identity ->Enable(false); m_identity ->Enable(false);
m_password_label->Enable(false);
m_password ->Enable(false);
} }
return wxEAPCredentialsPanel<_Tcred, wxPasswordCredentialsPanelBase>::TransferDataToWindow(); return wxEAPCredentialsPanel<_Tcred, _Tbase>::TransferDataToWindow();
} }
virtual bool TransferDataFromWindow() virtual bool TransferDataFromWindow()
{ {
if (!wxEAPCredentialsPanel<_Tcred, wxPasswordCredentialsPanelBase>::TransferDataFromWindow()) if (!wxEAPCredentialsPanel<_Tcred, _Tbase>::TransferDataFromWindow())
return false; return false;
m_cred.m_identity = m_identity->GetValue(); m_cred.m_identity = m_identity->GetValue();
return true;
}
/// \endcond
};
/// @}
///
/// Generic password credential entry panel
///
template <class _Tcred, class _Tbase>
class wxPasswordCredentialsPanel : public wxIdentityCredentialsPanel<_Tcred, _Tbase>
{
public:
///
/// Constructs a password credentials panel
///
/// \param[in] prov Provider configuration data
/// \param[in] cfg Method configuration data
/// \param[inout] cred Credentials data
/// \param[in] parent Parent window
/// \param[in] is_config Is this panel used to config credentials?
///
wxPasswordCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) :
m_password_set(false),
wxIdentityCredentialsPanel<_Tcred, _Tbase>(prov, cfg, cred, parent, is_config)
{
// Load and set icon.
winstd::library lib_shell32;
if (lib_shell32.load(_T("imageres.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(82)));
if (!m_prov.m_lbl_alt_password.empty()) {
m_password_label->SetLabel(m_prov.m_lbl_alt_password);
this->Layout();
}
}
protected:
/// \cond internal
virtual bool TransferDataToWindow()
{
m_password->SetValue(m_cred.m_password.empty() ? wxEmptyString : wxT("dummypass"));
m_password_set = false;
if (!m_is_config && m_cfg.m_use_cred) {
// Credential prompt mode & Using configured credentials
m_password_label->Enable(false);
m_password ->Enable(false);
}
return wxIdentityCredentialsPanel<_Tcred, _Tbase>::TransferDataToWindow();
}
virtual bool TransferDataFromWindow()
{
if (!wxIdentityCredentialsPanel<_Tcred, _Tbase>::TransferDataFromWindow())
return false;
if (m_password_set) if (m_password_set)
m_cred.m_password = m_password->GetValue(); m_cred.m_password = m_password->GetValue();
@@ -958,7 +1092,7 @@ protected:
virtual void OnPasswordText(wxCommandEvent& event) virtual void OnPasswordText(wxCommandEvent& event)
{ {
wxEAPCredentialsPanel<_Tcred, _Tbase>::OnPasswordText(event); wxIdentityCredentialsPanel<_Tcred, _Tbase>::OnPasswordText(event);
m_password_set = true; m_password_set = true;
} }
@@ -969,6 +1103,8 @@ private:
bool m_password_set; bool m_password_set;
}; };
/// @}
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx, int cy) inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx, int cy)
{ {
@@ -1007,54 +1143,4 @@ inline void wxInitializeConfig()
if (cfgPrev) wxDELETE(cfgPrev); if (cfgPrev) wxDELETE(cfgPrev);
} }
#pragma warning(pop)
namespace eap
{
class monitor_ui
{
public:
monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid);
virtual ~monitor_ui();
void set_popup(_In_ HWND hwnd);
void release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const;
inline bool is_master() const
{
return m_is_master;
}
inline bool is_slave() const
{
return !is_master();
}
inline const std::vector<unsigned char>& master_data() const
{
return m_data;
}
protected:
virtual LRESULT winproc(
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam);
static LRESULT CALLBACK winproc(
_In_ HWND hwnd,
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam);
protected:
bool m_is_master; ///< Is this monitor master?
HWND m_hwnd; ///< Message window handle
std::list<HWND> m_slaves; ///< List of slaves to notify on finish
HWND m_hwnd_popup; ///< Pop-up window handle
std::vector<unsigned char> m_data; ///< Data master sent
// Custom window messages
static const UINT s_msg_attach; ///< Slave sends this message to attach to master
static const UINT s_msg_finish; ///< Master sends this message to slaves to notify them it has finished (wparam has size, lparam has data)
};
}

View File

@@ -20,12 +20,8 @@
namespace eap namespace eap
{ {
///
/// EAP UI peer base abstract class
///
/// A group of methods all EAP UI peers must or should implement.
///
class peer_ui; class peer_ui;
class monitor_ui;
} }
#pragma once #pragma once
@@ -35,6 +31,14 @@ namespace eap
namespace eap namespace eap
{ {
/// \addtogroup EAPBaseModule
/// @{
///
/// EAP UI peer base abstract class
///
/// A group of methods all EAP UI peers must or should implement.
///
class peer_ui : public module class peer_ui : public module
{ {
public: public:
@@ -50,11 +54,16 @@ namespace eap
/// ///
/// \sa [EapPeerConfigXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363602.aspx) /// \sa [EapPeerConfigXml2Blob function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363602.aspx)
/// ///
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] pConfigRoot Pointer to the XML configuration to be converted.
/// \param[out] pConnectionDataOut A pointer to a pointer to a byte buffer that contains the configuration data converted from XML. The configuration data is created inside the EapHostConfig Schema element. The buffer is of size \p pdwConnectionDataOutSize. After consuming the data, this memory must be freed by calling \p EapPeerFreeMemory().
/// \param[out] pdwConnectionDataOutSize A pointer to the size, in bytes, of the configuration BLOB in \p pConnectionDataOut.
///
virtual void config_xml2blob( virtual void config_xml2blob(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_ IXMLDOMNode *pConfigRoot, _In_ IXMLDOMNode *pConfigRoot,
_Inout_ BYTE **pConnectionDataOut, _Out_ BYTE **pConnectionDataOut,
_Inout_ DWORD *pdwConnectionDataOutSize) = 0; _Out_ DWORD *pdwConnectionDataOutSize) = 0;
/// ///
/// Converts the configuration BLOB to XML. /// Converts the configuration BLOB to XML.
@@ -63,6 +72,12 @@ namespace eap
/// ///
/// \sa [EapPeerConfigBlob2Xml function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363601.aspx) /// \sa [EapPeerConfigBlob2Xml function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363601.aspx)
/// ///
/// \param[in] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in] pConnectionData A pointer to a buffer that contains the configuration BLOB to convert. The buffer is of size \p dwConnectionDataSize.
/// \param[in] dwConnectionDataSize The size, in bytes, of the configuration BLOB in \p pConnectionData.
/// \param[in] pDoc A pointer to a pointer to an XML document that contains the converted configuration. If the EAP method does not support the \p EapPeerConfigBlob2Xml() function, the XML document will contain the \p ConfigBlob node with the BLOB in string form. The EAP method should create configuration inside the EapHostConfig Schema configuration element.
/// \param[in] pConfigRoot Configuration root XML node
///
virtual void config_blob2xml( virtual void config_blob2xml(
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
@@ -75,18 +90,34 @@ namespace eap
/// ///
/// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx) /// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx)
/// ///
/// \param[in ] hwndParent A handle to the parent window which will spawn the connection configuration user interface dialog.
/// \param[in ] pConnectionDataIn A pointer to a buffer that contains the configuration BLOB to convert. The buffer is of size \p dwConnectionDataInSize.
/// \param[in ] dwConnectionDataInSize The size, in bytes, of the configuration BLOB in \p pConnectionDataIn.
/// \param[out] ppConnectionDataOut Receives a pointer to a pointer that contains a byte buffer with the user-configured connection data.
/// \param[out] pdwConnectionDataOutSize Receives a pointer to the size, in bytes, of the \p ppConnectionDataOut parameter.
///
virtual void invoke_config_ui( virtual void invoke_config_ui(
_In_ HWND hwndParent, _In_ HWND hwndParent,
_In_count_(dwConnectionDataInSize) const BYTE *pConnectionDataIn, _In_count_(dwConnectionDataInSize) const BYTE *pConnectionDataIn,
_In_ DWORD dwConnectionDataInSize, _In_ DWORD dwConnectionDataInSize,
_Inout_ BYTE **ppConnectionDataOut, _Out_ BYTE **ppConnectionDataOut,
_Inout_ DWORD *pdwConnectionDataOutSize) = 0; _Out_ DWORD *pdwConnectionDataOutSize) = 0;
/// ///
/// Raises a custom interactive user interface dialog to obtain user identity information for the EAP method on the client. /// Raises a custom interactive user interface dialog to obtain user identity information for the EAP method on the client.
/// ///
/// \sa [EapPeerInvokeIdentityUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363615.aspx) /// \sa [EapPeerInvokeIdentityUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363615.aspx)
/// ///
/// \param[in ] hwndParent A handle to the parent window which will spawn the interactive user interface dialog to obtain the identity data. Can be \c NULL.
/// \param[in ] dwFlags A combination of EAP flags that describe the EAP authentication session behavior.
/// \param[in ] pConnectionData A pointer to a buffer that contains the configuration BLOB to convert. The buffer is of size \p dwConnectionDataSize.
/// \param[in ] dwConnectionDataSize The size, in bytes, of the configuration BLOB in \p pConnectionData.
/// \param[in ] pUserData A pointer to the user data specific to this authentication used to pre-populate the user data. When this API is called for the first time, or when a new authentication session starts, this parameter is \c NULL. Otherwise, set this parameter to the `pUserData` member of the structure pointed to by the \p pResult parameter received by `EapPeerGetResult()`.
/// \param[in ] dwUserDataSize Specifies the size, in bytes, of the user identity data returned in \p pUserData.
/// \param[out] ppUserDataOut A pointer to the pointer of the returned user data. The data is passed to `EapPeerBeginSession()` as input \p pUserData.
/// \param[out] pdwUserDataOutSize Specifies the size, in bytes, of the \p ppUserDataOut buffer.
/// \param[out] ppwszIdentity A pointer to the returned user identity. The pointer will be included in the identity response packet and returned to the server.
///
virtual void invoke_identity_ui( virtual void invoke_identity_ui(
_In_ HWND hwndParent, _In_ HWND hwndParent,
_In_ DWORD dwFlags, _In_ DWORD dwFlags,
@@ -94,15 +125,21 @@ namespace eap
_In_ DWORD dwConnectionDataSize, _In_ DWORD dwConnectionDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData, _In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ DWORD dwUserDataSize, _In_ DWORD dwUserDataSize,
_Inout_ BYTE **ppUserDataOut, _Out_ BYTE **ppUserDataOut,
_Inout_ DWORD *pdwUserDataOutSize, _Out_ DWORD *pdwUserDataOutSize,
_Inout_ LPWSTR *ppwszIdentity) = 0; _Out_ LPWSTR *ppwszIdentity) = 0;
/// ///
/// Raises a custom interactive user interface dialog for the EAP method on the client. /// Raises a custom interactive user interface dialog for the EAP method on the client.
/// ///
/// \sa [EapPeerInvokeInteractiveUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363616.aspx) /// \sa [EapPeerInvokeInteractiveUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363616.aspx)
/// ///
/// \param[in ] hwndParent A handle to the parent window which will spawn the interactive user interface dialog.
/// \param[in ] pUIContextData A pointer to an opaque byte buffer that contains the context data used to create the user interface dialog.
/// \param[in ] dwUIContextDataSize The size, in bytes, of the user interface context data specified by \p pUIContextData.
/// \param[out] ppDataFromInteractiveUI A pointer to the address of an opaque byte buffer that contains data obtained from the interactive user interface dialog.
/// \param[out] pdwDataFromInteractiveUISize A pointer to the size, in bytes, of the data returned in \p ppDataFromInteractiveUI.
///
virtual void invoke_interactive_ui( virtual void invoke_interactive_ui(
_In_ HWND hwndParent, _In_ HWND hwndParent,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
@@ -110,4 +147,94 @@ namespace eap
_Inout_ BYTE **ppDataFromInteractiveUI, _Inout_ BYTE **ppDataFromInteractiveUI,
_Inout_ DWORD *pdwDataFromInteractiveUISize) = 0; _Inout_ DWORD *pdwDataFromInteractiveUISize) = 0;
}; };
/// @}
/// \addtogroup EAPBaseGUI
/// @{
///
/// Base class to enable single instance of the same dialog (master) return result to multiple threads (slaves)
///
class monitor_ui
{
public:
///
/// Constructs a UI monitor
///
monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid);
///
/// Destructs the UI monitor
///
virtual ~monitor_ui();
///
/// Sets pop-up window handle
///
/// \param[in] hwnd Handle of window to set as a new pop-up
///
void set_popup(_In_ HWND hwnd);
///
/// Notifies all slaves waiting for this master and send them result data
///
/// \param[in] data Pointer to result data
/// \param[in] size \p data size in bytes
///
void release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const;
///
/// Returns true if this is a master
///
inline bool is_master() const
{
return m_is_master;
}
///
/// Returns true if this is a slave
///
inline bool is_slave() const
{
return !is_master();
}
///
/// Returns the data master send
///
inline const std::vector<unsigned char>& master_data() const
{
return m_data;
}
protected:
/// \cond internal
virtual LRESULT winproc(
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam);
static LRESULT CALLBACK winproc(
_In_ HWND hwnd,
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam);
/// \endcond
protected:
bool m_is_master; ///< Is this monitor master?
HWND m_hwnd; ///< Message window handle
std::list<HWND> m_slaves; ///< List of slaves to notify on finish
volatile HWND m_hwnd_popup; ///< Pop-up window handle
std::vector<unsigned char> m_data; ///< Data master sent
// Custom window messages
static const UINT s_msg_attach; ///< Slave sends this message to attach to master
static const UINT s_msg_finish; ///< Master sends this message to slaves to notify them it has finished (wparam has size, lparam has data)
};
/// @}
} }

View File

@@ -18,9 +18,6 @@
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>. along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/ */
///
/// Base class for all credential entry panel that must provide "Remember" credentials checkbox
///
class wxEAPCredentialsPanelBase; class wxEAPCredentialsPanelBase;
#pragma once #pragma once
@@ -28,12 +25,28 @@ class wxEAPCredentialsPanelBase;
#include <wx/panel.h> #include <wx/panel.h>
///
/// \defgroup EAPBaseGUI GUI
/// Graphical User Interface
///
/// @{
///
/// Base class for all credential entry panel that must provide "Remember" credentials checkbox
///
class wxEAPCredentialsPanelBase : public wxPanel class wxEAPCredentialsPanelBase : public wxPanel
{ {
public: public:
/// ///
/// Constructs a wxPanel with "Remember" credentials checkbox /// Constructs a wxPanel with "Remember" credentials checkbox
/// ///
/// \param[in] parent The parent window
/// \param[in] winid An identifier for the panel. \c wxID_ANY is taken to mean a default.
/// \param[in] pos The panel position. The value \c wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
/// \param[in] size The panel 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. See `wxPanel`.
/// \param[in] name Window name
///
wxEAPCredentialsPanelBase(wxWindow *parent, wxEAPCredentialsPanelBase(wxWindow *parent,
wxWindowID winid = wxID_ANY, wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -43,6 +56,17 @@ public:
{ {
} }
///
/// (Un)checks "Remember credentials" checkbox
///
/// \param[in] val If \c true, checkbox is checked; otherwise cleared
///
virtual void SetRemember(bool val) = 0; virtual void SetRemember(bool val) = 0;
///
/// Returns \c true if "Remember credentials" checkbox is checked
///
virtual bool GetRemember() const = 0; virtual bool GetRemember() const = 0;
}; };
/// @}

View File

@@ -418,6 +418,55 @@ wxPasswordCredentialsPanelBase::~wxPasswordCredentialsPanelBase()
} }
wxIdentityCredentialsPanelBase::wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxEAPCredentialsPanelBase( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name )
{
m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User ID") ), wxVERTICAL );
wxBoxSizer* sb_credentials_horiz;
sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL );
m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, FromDIP(5) );
m_sb_credentials_vert = new wxBoxSizer( wxVERTICAL );
m_credentials_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Please provide your user ID."), wxDefaultPosition, wxDefaultSize, 0 );
m_credentials_label->Wrap( FromDIP(440) );
m_sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, FromDIP(5) );
wxFlexGridSizer* sb_credentials_tbl;
sb_credentials_tbl = new wxFlexGridSizer( 0, 2, FromDIP(5), FromDIP(5) );
sb_credentials_tbl->AddGrowableCol( 1 );
sb_credentials_tbl->SetFlexibleDirection( wxBOTH );
sb_credentials_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("User ID:"), wxDefaultPosition, wxDefaultSize, 0 );
m_identity_label->Wrap( -1 );
sb_credentials_tbl->Add( m_identity_label, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5) );
m_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_identity->SetToolTip( _("Enter your user name here (user@domain.org, DOMAIN\\User, etc.)") );
sb_credentials_tbl->Add( m_identity, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) );
m_sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, FromDIP(5) );
sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, FromDIP(5) );
m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, FromDIP(5) );
this->SetSizer( m_sb_credentials );
this->Layout();
}
wxIdentityCredentialsPanelBase::~wxIdentityCredentialsPanelBase()
{
}
wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name )
{ {
wxStaticBoxSizer* sb_provider_contact; wxStaticBoxSizer* sb_provider_contact;
@@ -631,3 +680,43 @@ wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWind
wxEAPProviderLockPanelBase::~wxEAPProviderLockPanelBase() wxEAPProviderLockPanelBase::~wxEAPProviderLockPanelBase()
{ {
} }
wxEAPProviderSelectDialogBase::wxEAPProviderSelectDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* sb_content;
sb_content = new wxBoxSizer( wxVERTICAL );
m_banner = new wxEAPBannerPanel( this );
sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, FromDIP(5) );
m_providers = new wxBoxSizer( wxVERTICAL );
m_providers->SetMinSize( FromDIP(wxSize( 350,-1 )) );
sb_content->Add( m_providers, 1, wxEXPAND|wxALL, FromDIP(5) );
m_buttons = new wxStdDialogButtonSizer();
m_buttonsCancel = new wxButton( this, wxID_CANCEL );
m_buttons->AddButton( m_buttonsCancel );
m_buttons->Realize();
sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, FromDIP(5) );
this->SetSizer( sb_content );
this->Layout();
sb_content->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPProviderSelectDialogBase::OnInitDialog ) );
}
wxEAPProviderSelectDialogBase::~wxEAPProviderSelectDialogBase()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPProviderSelectDialogBase::OnInitDialog ) );
}

View File

@@ -3440,6 +3440,484 @@
</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">wxIdentityCredentialsPanelBase</property>
<property name="pos"></property>
<property name="size">500,-1</property>
<property name="subclass">wxEAPCredentialsPanelBase; ../include/wxEAP_UIBase.h</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="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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"></event>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">User ID</property>
<property name="minimum_size"></property>
<property name="name">m_sb_credentials</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">sb_credentials_horiz</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" 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="bitmap">Load From Icon Resource; ; [32; 32]</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_credentials_icon</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="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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_sb_credentials_vert</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</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">Please provide your user ID.</property>
<property name="markup">0</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_credentials_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">440</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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|wxALL</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">5</property>
<property name="minimum_size"></property>
<property name="name">sb_credentials_tbl</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</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">User ID:</property>
<property name="markup">0</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_identity_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="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">2</property>
<object class="wxTextCtrl" 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="maxlength"></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_identity</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">Enter your user name here (user@domain.org, DOMAIN\User, etc.)</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="Panel" expanded="1"> <object class="Panel" expanded="1">
<property name="aui_managed">0</property> <property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> <property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@@ -5825,5 +6303,216 @@
</object> </object>
</object> </object>
</object> </object>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></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="extra_style"></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">wxEAPProviderSelectDialogBase</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass"></property>
<property name="title">EAP Identity Provider</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog">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="OnMaximize"></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="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">sb_content</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="CustomControl" 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="class">wxEAPBannerPanel</property>
<property name="close_button">1</property>
<property name="construction">m_banner = new wxEAPBannerPanel( this );&#x0A;</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="declaration">wxEAPBannerPanel *m_banner;</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="include">class wxEAPBannerPanel;</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_banner</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="settings"></property>
<property name="show">1</property>
<property name="size">-1,-1</property>
<property name="subclass">; ../include/EAP_UI.h</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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|wxALL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">350,-1</property>
<property name="name">m_providers</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">0</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_buttons</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object> </object>
</wxFormBuilder_Project> </wxFormBuilder_Project>

View File

@@ -220,6 +220,28 @@ class wxPasswordCredentialsPanelBase : public wxEAPCredentialsPanelBase
}; };
///////////////////////////////////////////////////////////////////////////////
/// Class wxIdentityCredentialsPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxIdentityCredentialsPanelBase : public wxEAPCredentialsPanelBase
{
private:
protected:
wxStaticBoxSizer* m_sb_credentials;
wxStaticBitmap* m_credentials_icon;
wxBoxSizer* m_sb_credentials_vert;
wxStaticText* m_credentials_label;
wxStaticText* m_identity_label;
wxTextCtrl* m_identity;
public:
wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~wxIdentityCredentialsPanelBase();
};
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class wxEAPProviderContactInfoPanelBase /// Class wxEAPProviderContactInfoPanelBase
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@@ -290,4 +312,28 @@ class wxEAPProviderLockPanelBase : public wxPanel
}; };
///////////////////////////////////////////////////////////////////////////////
/// Class wxEAPProviderSelectDialogBase
///////////////////////////////////////////////////////////////////////////////
class wxEAPProviderSelectDialogBase : public wxDialog
{
private:
protected:
wxEAPBannerPanel *m_banner;
wxBoxSizer* m_providers;
wxStdDialogButtonSizer* m_buttons;
wxButton* m_buttonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
public:
wxEAPProviderSelectDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EAP Identity Provider"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~wxEAPProviderSelectDialogBase();
};
#endif //__WXEAP_UI_H__ #endif //__WXEAP_UI_H__

View File

@@ -30,10 +30,12 @@ wxEAPBannerPanel::wxEAPBannerPanel(wxWindow* parent) : wxEAPBannerPanelBase(pare
} }
/// \cond internal
bool wxEAPBannerPanel::AcceptsFocusFromKeyboard() const bool wxEAPBannerPanel::AcceptsFocusFromKeyboard() const
{ {
return false; return false;
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -79,6 +81,7 @@ void wxEAPGeneralDialog::AddContent(wxPanel *content)
} }
/// \cond internal
void wxEAPGeneralDialog::OnInitDialog(wxInitDialogEvent& event) void wxEAPGeneralDialog::OnInitDialog(wxInitDialogEvent& event)
{ {
wxEAPGeneralDialogBase::OnInitDialog(event); wxEAPGeneralDialogBase::OnInitDialog(event);
@@ -86,6 +89,7 @@ void wxEAPGeneralDialog::OnInitDialog(wxInitDialogEvent& event)
for (wxSizerItemList::compatibility_iterator panel = m_panels->GetChildren().GetFirst(); panel; panel = panel->GetNext()) for (wxSizerItemList::compatibility_iterator panel = m_panels->GetChildren().GetFirst(); panel; panel = panel->GetNext())
panel->GetData()->GetWindow()->GetEventHandler()->ProcessEvent(event); panel->GetData()->GetWindow()->GetEventHandler()->ProcessEvent(event);
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -104,46 +108,6 @@ wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov,
} }
//////////////////////////////////////////////////////////////////////
// wxEAPCredentialsConnectionDialog
//////////////////////////////////////////////////////////////////////
wxEAPCredentialsConnectionDialog::wxEAPCredentialsConnectionDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style) :
wxEAPCredentialsConnectionDialogBase(parent, id, title, pos, size, style)
{
// Set extra style here, as wxFormBuilder overrides all default flags.
this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
// Load window icons.
#ifdef __WINDOWS__
wxIconBundle icons;
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
this->SetIcons(icons);
#else
this->SetIcon(wxIcon(wxICON(product.ico)));
#endif
// Set banner title.
m_banner->m_title->SetLabel(_("EAP Credentials"));
m_buttonsOK->SetDefault();
}
void wxEAPCredentialsConnectionDialog::OnInitDialog(wxInitDialogEvent& event)
{
wxEAPCredentialsConnectionDialogBase::OnInitDialog(event);
// Forward the event to child panels.
for (wxWindowList::compatibility_iterator provider = m_providers->GetChildren().GetFirst(); provider; provider = provider->GetNext()) {
wxWindow *prov = wxDynamicCast(provider->GetData(), wxWindow);
if (prov)
prov->GetEventHandler()->ProcessEvent(event);
}
}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// wxEAPNotePanel // wxEAPNotePanel
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -161,6 +125,8 @@ wxEAPNotePanel::wxEAPNotePanel(wxWindow* parent) :
} }
/// \cond internal
bool wxEAPNotePanel::AcceptsFocusFromKeyboard() const bool wxEAPNotePanel::AcceptsFocusFromKeyboard() const
{ {
return m_help_web_value || m_help_email_value || m_help_phone_label; return m_help_web_value || m_help_email_value || m_help_phone_label;
@@ -220,6 +186,8 @@ void wxEAPNotePanel::CreateContactFields(const eap::config_provider &prov)
} }
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// wxEAPProviderLockedPanel // wxEAPProviderLockedPanel
@@ -311,6 +279,7 @@ wxEAPConfigWindow::~wxEAPConfigWindow()
} }
/// \cond internal
void wxEAPConfigWindow::OnInitDialog(wxInitDialogEvent& event) void wxEAPConfigWindow::OnInitDialog(wxInitDialogEvent& event)
{ {
// Call TransferDataToWindow() manually, as wxScrolledWindow somehow skips that. // Call TransferDataToWindow() manually, as wxScrolledWindow somehow skips that.
@@ -318,6 +287,7 @@ void wxEAPConfigWindow::OnInitDialog(wxInitDialogEvent& event)
event.Skip(); event.Skip();
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -335,6 +305,8 @@ wxEAPProviderContactInfoPanel::wxEAPProviderContactInfoPanel(eap::config_provide
} }
/// \cond internal
bool wxEAPProviderContactInfoPanel::TransferDataToWindow() bool wxEAPProviderContactInfoPanel::TransferDataToWindow()
{ {
m_provider_name ->SetValue(m_prov.m_name ); m_provider_name ->SetValue(m_prov.m_name );
@@ -358,6 +330,8 @@ bool wxEAPProviderContactInfoPanel::TransferDataFromWindow()
return true; return true;
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// wxEAPProviderIDPanel // wxEAPProviderIDPanel
@@ -374,6 +348,8 @@ wxEAPProviderIDPanel::wxEAPProviderIDPanel(eap::config_provider &prov, wxWindow*
} }
/// \cond internal
bool wxEAPProviderIDPanel::TransferDataToWindow() bool wxEAPProviderIDPanel::TransferDataToWindow()
{ {
m_provider_namespace->SetStringSelection(m_prov.m_namespace); m_provider_namespace->SetStringSelection(m_prov.m_namespace);
@@ -393,6 +369,8 @@ bool wxEAPProviderIDPanel::TransferDataFromWindow()
return true; return true;
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// wxEAPProviderLockPanel // wxEAPProviderLockPanel
@@ -409,6 +387,8 @@ wxEAPProviderLockPanel::wxEAPProviderLockPanel(eap::config_provider &prov, wxWin
} }
/// \cond internal
bool wxEAPProviderLockPanel::TransferDataToWindow() bool wxEAPProviderLockPanel::TransferDataToWindow()
{ {
m_provider_lock->SetValue(m_prov.m_read_only); m_provider_lock->SetValue(m_prov.m_read_only);
@@ -426,6 +406,8 @@ bool wxEAPProviderLockPanel::TransferDataFromWindow()
return true; return true;
} }
/// \endcond
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// wxEAPConfigProvider // wxEAPConfigProvider
@@ -451,194 +433,37 @@ wxEAPConfigProvider::wxEAPConfigProvider(eap::config_provider &prov, wxWindow *p
} }
using namespace std;
using namespace winstd;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// eap::monitor_ui // wxEAPProviderSelectDialog
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
eap::monitor_ui::monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid) : wxEAPProviderSelectDialog::wxEAPProviderSelectDialog(eap::config_connection &cfg, wxWindow *parent) :
m_hwnd_popup(NULL) m_selected(NULL),
wxEAPProviderSelectDialogBase(parent)
{ {
// Verify if the monitor is already running. // Set banner title.
const WNDCLASSEX wnd_class_desc_master = { std::unique_ptr<eap::config_method> cfg_dummy(cfg.m_module.make_config_method());
sizeof(WNDCLASSEX), // cbSize m_banner->m_title->SetLabel(wxString::Format("%s %s", wxT(PRODUCT_NAME_STR), cfg_dummy->get_method_str()));
0, // style
winproc, // lpfnWndProc
0, // cbClsExtra
0, // cbWndExtra
module, // hInstance
NULL, // hIcon
NULL, // hCursor
NULL, // hbrBackground
NULL, // lpszMenuName
_T(__FUNCTION__), // lpszClassName
NULL // hIconSm
};
ATOM wnd_class = RegisterClassEx(&wnd_class_desc_master);
if (!wnd_class)
throw win_runtime_error(__FUNCTION__ " Error registering master monitor window class.");
tstring_guid guid_str(guid);
HWND hwnd_master = FindWindowEx(HWND_MESSAGE, NULL, reinterpret_cast<LPCTSTR>(wnd_class), guid_str.c_str());
if (hwnd_master) {
// Another monitor is already running.
m_is_master = false;
// Register slave windows class slightly different, not to include slaves in FindWindowEx(). // Iterate over providers.
const WNDCLASSEX wnd_class_desc_slave = { for (auto cfg_prov = cfg.m_providers.cbegin(), cfg_prov_end = cfg.m_providers.cend(); cfg_prov != cfg_prov_end; ++cfg_prov) {
sizeof(WNDCLASSEX), // cbSize wxCommandLinkButton *btn = new wxCommandLinkButton(this, wxID_ANY, wxEAPGetProviderName(cfg_prov->m_name));
0, // style m_providers->Add(btn, 0, wxALL|wxEXPAND, FromDIP(5));
winproc, // lpfnWndProc
0, // cbClsExtra btn->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxEAPProviderSelectDialog::OnProvSelect), new wxVariant((void*)&*cfg_prov), this);
0, // cbWndExtra
module, // hInstance
NULL, // hIcon
NULL, // hCursor
NULL, // hbrBackground
NULL, // lpszMenuName
_T(__FUNCTION__) _T("-Slave"), // lpszClassName
NULL // hIconSm
};
wnd_class = RegisterClassEx(&wnd_class_desc_slave);
if (!wnd_class)
throw win_runtime_error(__FUNCTION__ " Error registering slave monitor window class.");
} else {
// This is a fresh monitor.
m_is_master = true;
} }
m_hwnd = CreateWindowEx( this->Layout();
0, // dwExStyle this->GetSizer()->Fit(this);
reinterpret_cast<LPCTSTR>(wnd_class), // lpClassName
guid_str.c_str(), // lpWindowName
0, // dwStyle
0, // x
0, // y
0, // nWidth
0, // nHeight
HWND_MESSAGE, // hWndParent
NULL, // hMenu
module, // hInstance
this); // lpParam
if (!m_is_master) {
// Notify master we are waiting him.
SendMessage(hwnd_master, s_msg_attach, 0, (LPARAM)m_hwnd);
// Slaves must pump message queue until finished.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
} }
eap::monitor_ui::~monitor_ui() /// \cond internal
void wxEAPProviderSelectDialog::OnProvSelect(wxCommandEvent& event)
{ {
if (m_hwnd) // Set selected provider and dismiss dialog.
DestroyWindow(m_hwnd); m_selected = static_cast<eap::config_provider*>(dynamic_cast<const wxVariant*>(event.GetEventUserData())->GetVoidPtr());
this->EndModal(wxID_OK);
event.Skip();
} }
/// \endcond
void eap::monitor_ui::set_popup(_In_ HWND hwnd)
{
m_hwnd_popup = hwnd;
}
void eap::monitor_ui::release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const
{
assert(!size || data);
for (auto slave = m_slaves.cbegin(), slave_end = m_slaves.cend(); slave != slave_end; ++slave) {
// Get slave's PID.
DWORD pid_slave;
GetWindowThreadProcessId(*slave, &pid_slave);
// Get slave's process handle.
process proc_slave;
if (!proc_slave.open(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, 0, pid_slave))
continue;
// Allocate memory in slave's virtual memory space and save data to it.
vmemory mem_slave;
if (!mem_slave.alloc(proc_slave, NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE))
continue;
if (!WriteProcessMemory(proc_slave, mem_slave, data, size, NULL))
continue;
// Notify slave. Use SendMessage(), not PostMessage(), as memory will get cleaned up.
SendMessage(*slave, s_msg_finish, (WPARAM)size, (LPARAM)(LPVOID)mem_slave);
}
}
LRESULT eap::monitor_ui::winproc(
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam)
{
UNREFERENCED_PARAMETER(wparam);
if (msg == s_msg_attach) {
// Attach a new slave.
assert(m_is_master);
m_slaves.push_back((HWND)lparam);
if (m_hwnd_popup) {
// Bring pop-up window up.
if (::IsIconic(m_hwnd_popup))
::SendMessage(m_hwnd_popup, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(m_hwnd_popup);
::SetForegroundWindow(m_hwnd_popup);
}
return TRUE;
} else if (msg == s_msg_finish) {
// Master finished.
assert(!m_is_master);
m_data.assign(reinterpret_cast<const unsigned char*>(lparam), reinterpret_cast<const unsigned char*>(lparam) + wparam);
// Finish slave too.
DestroyWindow(m_hwnd);
return TRUE;
} else if (msg == WM_DESTROY) {
// Stop the message pump.
PostQuitMessage(0);
return 0;
}
return DefWindowProc(m_hwnd, msg, wparam, lparam);
}
LRESULT CALLBACK eap::monitor_ui::winproc(
_In_ HWND hwnd,
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam)
{
if (msg == WM_CREATE) {
// Set window's user data to "this" pointer.
const CREATESTRUCT *cs = (CREATESTRUCT*)lparam;
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
// Forward to our handler.
return ((eap::monitor_ui*)cs->lpCreateParams)->winproc(msg, wparam, lparam);
} else {
// Get "this" pointer from window's user data.
eap::monitor_ui *_this = (eap::monitor_ui*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (_this) {
// Forward to our handler.
return _this->winproc(msg, wparam, lparam);
} else
return DefWindowProc(hwnd, msg, wparam, lparam);
}
}
const UINT eap::monitor_ui::s_msg_attach = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Attach"));
const UINT eap::monitor_ui::s_msg_finish = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Finish"));

View File

@@ -30,3 +30,208 @@ using namespace winstd;
eap::peer_ui::peer_ui(_In_ eap_type_t eap_method) : module(eap_method) eap::peer_ui::peer_ui(_In_ eap_type_t eap_method) : module(eap_method)
{ {
} }
//////////////////////////////////////////////////////////////////////
// eap::monitor_ui
//////////////////////////////////////////////////////////////////////
eap::monitor_ui::monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid) :
m_hwnd_popup(NULL)
{
// Verify if the monitor is already running.
const WNDCLASSEX wnd_class_desc_master = {
sizeof(WNDCLASSEX), // cbSize
0, // style
winproc, // lpfnWndProc
0, // cbClsExtra
0, // cbWndExtra
module, // hInstance
NULL, // hIcon
NULL, // hCursor
NULL, // hbrBackground
NULL, // lpszMenuName
_T(__FUNCTION__), // lpszClassName
NULL // hIconSm
};
LPCTSTR wnd_class = reinterpret_cast<LPCTSTR>(RegisterClassEx(&wnd_class_desc_master));
if (!wnd_class) {
DWORD dwResult = GetLastError();
if (dwResult == ERROR_CLASS_ALREADY_EXISTS)
wnd_class = _T(__FUNCTION__);
else
throw win_runtime_error(dwResult, __FUNCTION__ " Error registering master monitor window class.");
}
tstring_guid guid_str(guid);
HWND hwnd_master = FindWindowEx(HWND_MESSAGE, NULL, wnd_class, guid_str.c_str());
if (hwnd_master) {
// Another monitor is already running.
m_is_master = false;
// Register slave windows class slightly different, not to include slaves in FindWindowEx().
const WNDCLASSEX wnd_class_desc_slave = {
sizeof(WNDCLASSEX), // cbSize
0, // style
winproc, // lpfnWndProc
0, // cbClsExtra
0, // cbWndExtra
module, // hInstance
NULL, // hIcon
NULL, // hCursor
NULL, // hbrBackground
NULL, // lpszMenuName
_T(__FUNCTION__) _T("-Slave"), // lpszClassName
NULL // hIconSm
};
wnd_class = reinterpret_cast<LPCTSTR>(RegisterClassEx(&wnd_class_desc_slave));
if (!wnd_class) {
DWORD dwResult = GetLastError();
if (dwResult == ERROR_CLASS_ALREADY_EXISTS)
wnd_class = _T(__FUNCTION__) _T("-Slave");
else
throw win_runtime_error(dwResult, __FUNCTION__ " Error registering slave monitor window class.");
}
} else {
// This is a fresh monitor.
m_is_master = true;
}
m_hwnd = CreateWindowEx(
0, // dwExStyle
reinterpret_cast<LPCTSTR>(wnd_class), // lpClassName
guid_str.c_str(), // lpWindowName
0, // dwStyle
0, // x
0, // y
0, // nWidth
0, // nHeight
HWND_MESSAGE, // hWndParent
NULL, // hMenu
module, // hInstance
this); // lpParam
if (!m_is_master) {
// Notify master we are waiting him.
SendMessage(hwnd_master, s_msg_attach, 0, (LPARAM)m_hwnd);
// Slaves must pump message queue until finished.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
eap::monitor_ui::~monitor_ui()
{
if (m_hwnd)
DestroyWindow(m_hwnd);
}
void eap::monitor_ui::set_popup(_In_ HWND hwnd)
{
m_hwnd_popup = hwnd;
}
void eap::monitor_ui::release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const
{
assert(!size || data);
for (auto slave = m_slaves.cbegin(), slave_end = m_slaves.cend(); slave != slave_end; ++slave) {
// Get slave's PID.
DWORD pid_slave;
GetWindowThreadProcessId(*slave, &pid_slave);
// Get slave's process handle.
process proc_slave;
if (!proc_slave.open(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, 0, pid_slave))
continue;
// Allocate memory in slave's virtual memory space and save data to it.
vmemory mem_slave;
if (!mem_slave.alloc(proc_slave, NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE))
continue;
if (!WriteProcessMemory(proc_slave, mem_slave, data, size, NULL))
continue;
// Notify slave. Use SendMessage(), not PostMessage(), as memory will get cleaned up.
SendMessage(*slave, s_msg_finish, (WPARAM)size, (LPARAM)(LPVOID)mem_slave);
}
}
/// \cond internal
LRESULT eap::monitor_ui::winproc(
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam)
{
UNREFERENCED_PARAMETER(wparam);
if (msg == s_msg_attach) {
// Attach a new slave.
assert(m_is_master);
m_slaves.push_back((HWND)lparam);
HWND hwnd_popup = m_hwnd_popup;
if (hwnd_popup) {
// Bring pop-up window up.
if (::IsIconic(hwnd_popup))
::SendMessage(hwnd_popup, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(hwnd_popup);
::SetForegroundWindow(hwnd_popup);
}
return TRUE;
} else if (msg == s_msg_finish) {
// Master finished.
assert(!m_is_master);
m_data.assign(reinterpret_cast<const unsigned char*>(lparam), reinterpret_cast<const unsigned char*>(lparam) + wparam);
// Finish slave too.
DestroyWindow(m_hwnd);
return TRUE;
} else if (msg == WM_DESTROY) {
// Stop the message pump.
PostQuitMessage(0);
return 0;
}
return DefWindowProc(m_hwnd, msg, wparam, lparam);
}
LRESULT CALLBACK eap::monitor_ui::winproc(
_In_ HWND hwnd,
_In_ UINT msg,
_In_ WPARAM wparam,
_In_ LPARAM lparam)
{
if (msg == WM_CREATE) {
// Set window's user data to "this" pointer.
const CREATESTRUCT *cs = (CREATESTRUCT*)lparam;
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
// Forward to our handler.
return ((eap::monitor_ui*)cs->lpCreateParams)->winproc(msg, wparam, lparam);
} else {
// Get "this" pointer from window's user data.
eap::monitor_ui *_this = (eap::monitor_ui*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (_this) {
// Forward to our handler.
return _this->winproc(msg, wparam, lparam);
} else
return DefWindowProc(hwnd, msg, wparam, lparam);
}
}
/// \endcond
const UINT eap::monitor_ui::s_msg_attach = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Attach"));
const UINT eap::monitor_ui::s_msg_finish = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Finish"));

View File

@@ -24,3 +24,5 @@
#include "../include/EAP_UI.h" #include "../include/EAP_UI.h"
#include "../include/Module.h" #include "../include/Module.h"
#include <wx/commandlinkbutton.h>

2
lib/EapHost/build/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/temp
/*.user

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\..\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}</ProjectGuid>
<RootNamespace>EapHost</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" />
<Import Project="..\..\..\include\$(Configuration).props" />
<Import Project="EapHost.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
<ItemGroup>
<ClInclude Include="..\include\Config.h" />
<ClInclude Include="..\include\Credentials.h" />
<ClInclude Include="..\include\Method.h" />
<ClInclude Include="..\src\StdAfx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\Config.cpp" />
<ClCompile Include="..\src\Credentials.cpp" />
<ClCompile Include="..\src\Method.cpp" />
<ClCompile Include="..\src\StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\Config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\Method.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\Credentials.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Config.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Method.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Credentials.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,143 @@
/*
Copyright 2015-2016 Amebis
Copyright 2016 GÉANT
This file is part of GÉANTLink.
GÉANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GÉANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sal.h>
namespace eap
{
class config_method_eaphost;
}
#pragma once
#include "../../EAPBase/include/Config.h"
#include <Windows.h>
#include <sal.h>
#include <tchar.h>
namespace eap
{
/// \addtogroup EAPBaseConfig
/// @{
///
/// EapHost peer method configuration
///
class config_method_eaphost : public config_method
{
public:
///
/// Constructs configuration
///
/// \param[in] mod EAP module to use for global services
/// \param[in] level Config level (0=outer, 1=inner, 2=inner-inner...)
///
config_method_eaphost(_In_ module &mod, _In_ unsigned int level);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
config_method_eaphost(_In_ const config_method_eaphost &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
config_method_eaphost(_Inout_ config_method_eaphost &&other) noexcept;
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
/// \returns Reference to this object
///
config_method_eaphost& operator=(_In_ const config_method_eaphost &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
config_method_eaphost& operator=(_Inout_ config_method_eaphost &&other) noexcept;
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);
/// @}
virtual winstd::eap_type_t get_method_id() const;
virtual const wchar_t* get_method_str() const;
///
/// @copydoc eap::config_method::make_credentials()
/// \returns This implementation always returns `eap::credentials_eaphost` type of credentials
///
virtual credentials* make_credentials() const;
///
/// Returns method EAP_METHOD_TYPE
///
inline const EAP_METHOD_TYPE& get_type() const
{
return m_type;
}
///
/// Set method EAP_METHOD_TYPE
///
inline void set_type(_In_ const EAP_METHOD_TYPE &type)
{
m_type = type;
update_type();
}
protected:
/// \cond internal
void update_type();
/// \endcond
protected:
EAP_METHOD_TYPE m_type; ///< EapHost method type: (EAP type, vendor ID, vendor type, author ID) tuple
std::wstring m_type_str; ///< EAP method type as a string
public:
sanitizing_blob m_cfg_blob; ///< Method configuration BLOB
};
/// @}
}

Some files were not shown because too many files have changed in this diff Show More