Compare commits

...

287 Commits

Author SHA1 Message Date
75892b78c0 Version set to 1.0-alpha14 2016-08-28 23:00:27 +02:00
7c938fe291 OnUpdateUI() event handlers optimized to reduce ridiculous CPU consumption of GUI & Incorrect page-provider mapping in wxEAPConfigDialog<> fixed 2016-08-28 22:58:41 +02:00
497f4eca8a wxEAPCredentialsConfigPanel upgraded to use full retrieval of credentials from the store, allowing certificate credentials to display their name again 2016-08-28 20:11:10 +02:00
770b56e2cf credentials::get_name() now distinguish between empty credentials and blank identity 2016-08-28 20:06:54 +02:00
df680e74f6 TLS credentials are considered empty regardless the state of custom identity setting now 2016-08-28 20:05:41 +02:00
e66a7eb9ba dePAPization continues to pave the road for seamless MSCHAPv2 integration 2016-08-28 20:04:45 +02:00
6c66862eed TTLS config and credentials are now expected to always have inner config and credentials object present; it can be blank, but it must not be nullptr 2016-08-28 17:43:06 +02:00
fc5e54db05 Inner configuration/credential management virtualized to reduce cluttering code 2016-08-28 17:20:24 +02:00
d20aafb3ff Identity selection revised to support cases where TLS certificate is present but contains no usable username 2016-08-28 16:38:13 +02:00
8ce7154a77 Loading credentials from XML allows <UserName> absence and assumes blank identity in this case now 2016-08-28 15:46:30 +02:00
d926ea66b0 Sub-module update 2016-08-28 13:42:47 +02:00
3baa77d3bb WLANManager utility introduced
(closes #7)
2016-08-28 12:22:04 +02:00
25eb6d8d72 32-bit C++ compiler warning resolved 2016-08-27 21:18:06 +02:00
349508701c Support for localization added to MSI setup
(closes #9)
2016-08-27 21:17:46 +02:00
9f770bbb3f peer_ttls_ui now initializes wxWidgets further to support localization 2016-08-27 17:54:00 +02:00
bc1c56174a UI language in registry is ll_CC format now 2016-08-27 17:28:30 +02:00
db585975e8 Saving event source set to registry simplified to reduce registry clutter 2016-08-27 17:22:28 +02:00
8bf99423c8 Slovenian localization files added 2016-08-27 16:47:48 +02:00
249c4db1de Default column widths adjusted to better fit the content initially 2016-08-27 16:42:39 +02:00
3dd8f26c94 Registry settings key names changed as separate manufacturer name introduced 2016-08-27 16:41:26 +02:00
4a9d496ba1 Log trace control named for more logical name of settings in registry 2016-08-27 15:49:54 +02:00
6f5bbeffa2 UI text updated 2016-08-27 15:45:31 +02:00
f64dbacdbd Version set to 1.0-alpha13 2016-08-27 13:10:31 +02:00
2a88c4f2a8 Event sources and toolbar management now more dynamic 2016-08-27 13:01:58 +02:00
6ee34cdd47 Additional mnemonics introduced in Edit menu 2016-08-27 09:21:11 +02:00
65c87bcbc0 Toolbar management enhanced 2016-08-27 09:20:06 +02:00
1bdf4a2b8a UI strings revised 2016-08-27 07:30:30 +02:00
a8856b951b Windows folder icon arranged 2016-08-27 06:58:58 +02:00
6e58183d16 Panel icon loading simplified 2016-08-27 06:58:57 +02:00
9daa5b52a4 Incorrect letter case referencing EapHost service fixed 2016-08-27 06:58:57 +02:00
9704046868 EventMonitor upgraded
- Clipboard support
- Filtering by source and/or by message level
- Schannel event source added
(closes #8)
2016-08-27 06:58:21 +02:00
3b8bc90a0f "Add/Remove Programs" contact info changed from Amebis to GÉANT 2016-08-26 17:56:28 +02:00
b5c8b8ee67 Product icon introduced 2016-08-26 17:47:16 +02:00
53e31b1be7 Additional resource-loading functions introduced 2016-08-26 15:54:31 +02:00
5483368640 Version set to 1.0-alpha12 2016-08-25 13:10:42 +02:00
6077063599 The credentials are marked "invalid" at transition from handshake to application data phase only to prevent initial handshake problems from popping-up credential prompt when credentials have nothing to do with the connection failure. 2016-08-25 13:08:11 +02:00
2857b2edd2 First application data message is now appended piggyback to the last client handshake message
(Hopefully resolving issue with Radiator)
2016-08-25 13:00:47 +02:00
6760287f0d Duplicate log record of EAP-TLS handshake removed 2016-08-25 12:58:56 +02:00
7973a8d59b Handshake log events are a bit more specific now 2016-08-25 12:57:47 +02:00
f5d8f653af Texts updated 2016-08-25 10:46:35 +02:00
e1600e5aba Configuration GUIDs are not required any more
This reverts commit 1cb6ca5adb.
2016-08-24 18:59:59 +02:00
352d546da1 Version set to 1.0-alpha11 2016-08-24 18:48:10 +02:00
d2ff78a613 Credential prompt sometimes displayed in background issue fixed now 2016-08-24 18:39:15 +02:00
10807fad18 Variable renamed from Slovenian to English 2016-08-24 18:36:51 +02:00
c6d53cd13c eap::monitor_ui class to prevent multiple launches introduced 2016-08-24 17:45:31 +02:00
6f25e4c0ad wxEAPGeneralDialog constructor parameters extended 2016-08-24 17:43:02 +02:00
edac93e115 Custom TLS identity is correctly enabled/disabled now. 2016-08-24 15:30:27 +02:00
d1c24efcf0 config_method_with_cred renamed to config_connection to describe it better 2016-08-24 11:39:37 +02:00
1cb6ca5adb Connection configuration is equipped with GUID now for multiple credential prompt disambiguation later 2016-08-24 11:34:30 +02:00
38e1443276 Logging of handshake progress introduced 2016-08-24 11:04:04 +02:00
6835f5279c Certificate (TLS) credentials support custom identity now 2016-08-24 11:03:18 +02:00
eb9c8a5f7c If configured trusted root CA certificate list is empty, that really means "Trust no one!" now 2016-08-23 23:40:07 +02:00
5332b538aa Our own TLS merged back to master and compiles conditionally 2016-08-23 22:46:00 +02:00
a9baa07227 Error type detection fixed 2016-08-23 22:41:12 +02:00
387a12ab5e Additional cases of invalid certificate caught 2016-08-23 17:41:20 +02:00
7b3251a758 Error throwing clean-up 2016-08-23 17:20:04 +02:00
894f19a81e Binary publishing updated 2016-08-23 16:45:16 +02:00
318ad7f355 Version set to 1.0-alpha10 2016-08-23 14:53:27 +02:00
ef2042253c When server certificate has no subjectAltName(2), compare host name against Common Name 2016-08-23 14:29:47 +02:00
9b997408a1 Switched to Schannel to do the TLS 2016-08-23 13:53:23 +02:00
5720524abe Version set to 1.0-alpha9 2016-08-18 06:33:02 +02:00
1f1b9b1084 GUI boots with a predefined configuration on new profiles now
(closes #10)
2016-08-18 06:31:16 +02:00
076c6b77d7 GUI updated to show "<Your Provider>" when provider ID is blank 2016-08-18 06:30:02 +02:00
92460c571f Initial focus changed to the first non-mouse-wheel-capturing control to allow initial scrolling of the configuration dialog using mouse wheel 2016-08-17 16:42:19 +02:00
b79a2f26f6 Support for read-only lock added to GUI 2016-08-17 16:27:43 +02:00
373c83dbbe Provider identity and help-desk is configurable via GUI now 2016-08-17 15:56:11 +02:00
543dada025 Provider and method lists are arrays now, to allow random access for configuration dialog coming-up 2016-08-17 14:47:15 +02:00
ce22ec3bfa wxEAPCredentialsPanelPassBase >> wxEAPCredentialsPassPanelBase 2016-08-17 13:48:14 +02:00
a04647b7b5 Version set to 1.0-alpha8 2016-08-17 11:51:36 +02:00
df1d431bd0 - TLS revised (again)
- TLS Session resumption issues resolved
- Credential prompt has "Remember" checkbox initially selected when credentials originate from Windows Credential Manager
- Last authentication attempt failure notice is more general and no longer insinuate user credentials are the likely cause of the failure
- Additional log messages added
2016-08-17 11:50:34 +02:00
16527c8124 Client explicitly refuses to accept change cipher spec if no or NULL cipher was proposed now 2016-08-17 09:32:43 +02:00
69e6b775f8 Hello requests are no longer included in the handshake hashing (as per RFC) 2016-08-17 09:29:55 +02:00
c69316071f Support for encrypted change cipher spec messages added 2016-08-17 09:26:46 +02:00
a02d1e7094 Explicit checks on server certificate chain added:
- Certificate can not be self-signed: Cannot check trust against configured root CAs when server certificate is self-signed
- Server can provide full certificate chain up-to and including root CA. Importing root CA to the store for certificate chain validation would implicitly trust this certificate chain. Thus, we skip all self-signed certificates on import.
2016-08-17 09:22:38 +02:00
078636eb14 make_change_chiper_spec() removed as this message can simply be created using make_message() 2016-08-17 09:09:42 +02:00
cabae26e0b Flags describing handshake messages received assembled in a boolean table of flags 2016-08-17 09:01:11 +02:00
7376693838 Additional constants 2016-08-17 08:34:25 +02:00
a5b3914a09 Comments and some minor clean-up 2016-08-16 22:27:30 +02:00
8beb7bd27a Version set to 1.0-alpha7 2016-08-16 16:59:03 +02:00
00dd1277c5 Switched to the new key import method, as the old one had issues with PROV_RSA_AES crystallographic provider 2016-08-16 16:55:18 +02:00
e9839706b6 TLS clean-up 2016-08-16 16:44:19 +02:00
f5b03bc0bf Annotation update 2016-08-16 10:39:42 +02:00
c953fb8db4 Version set to 1.0-alpha6 2016-08-16 01:00:41 +02:00
db27355e46 Some last compiler warnings resolved 2016-08-16 00:58:22 +02:00
85d7c3d4ec Support for TLS 1.2 added 2016-08-16 00:47:47 +02:00
d68fd6ce08 Support for TLS 1.1 finished 2016-08-15 22:49:45 +02:00
82e910fea4 Late pad-checking added to prevent [Canvel, B] attack 2016-08-15 22:48:08 +02:00
7fa3289e3d Incorrect parameter reference fixed 2016-08-15 22:45:54 +02:00
de802b7a28 Byte-enums redefined & code clean-up 2016-08-15 21:01:38 +02:00
67fe27f6fd Support for stream ciphers added 2016-08-15 19:04:56 +02:00
c8cfe4da42 TLS version no longer static, thou still fixed to TLS 1.0 2016-08-15 19:04:21 +02:00
3267b7f53d Missing credential storage added 2016-08-15 18:36:01 +02:00
7b3ecda484 Clean-up 2016-08-15 18:35:15 +02:00
d8ccf7cbc0 Credential management revised 2016-08-15 17:33:10 +02:00
4dc7083028 wxEAPProviderLockedPanelBase renamed to wxEAPGeneralNotePanel to accommodate general use later 2016-08-15 16:53:42 +02:00
e34d2ba275 Prefast declaration update 2016-08-15 15:10:42 +02:00
3d6849a523 Peer correctly returns providers configuration instead of method configuration in method_tls::get_result() 2016-08-15 14:13:14 +02:00
217c3dd090 Issue with TLS credentials panel resetting PAP credentials in TTLS fixed 2016-08-15 14:05:14 +02:00
e807336e7b The TLS phase can be determined from flags alone, therefore m_phase member eliminated 2016-08-15 10:40:27 +02:00
95426cde7c Clean-up 2016-08-15 10:09:01 +02:00
92c62c53d7 16B PAP password padding added (RFC 5281) 2016-08-15 05:40:23 +02:00
99aa53726d - PPP authentication EAP response packet is correctly formed now
- MS-MPPE-Send-Key/MS-MPPE-Recv-Key sorted out
2016-08-14 21:04:19 +02:00
95e2f7e01b Encryption/decryption revised
- Number of memory copying reduced
- HMAC verification of server packets added
- Handshake hashing simplified
2016-08-14 18:51:18 +02:00
735d669887 Check for "change cipher spec" before server "finished" message added 2016-08-14 16:32:28 +02:00
a8db309a76 Wrong HMAC byte order issue fixed 2016-08-14 16:31:38 +02:00
7b94f01aa7 method_tls::create_key() optimization 2016-08-14 16:31:07 +02:00
12beee54ad Ambiguous variable name changed 2016-08-14 16:24:07 +02:00
956ef9bd4e CryptGenRandom() return status check added 2016-08-14 16:22:59 +02:00
f9c5f608d0 Fixed missing server handshake message hashing 2016-08-14 14:03:12 +02:00
4982fc1a9a Ambiguous logical expression equipped with parentheses 2016-08-14 14:01:20 +02:00
e7e8a88f32 Initialization of eap::tls_conn_state introduced 2016-08-14 13:59:54 +02:00
9a2663eb18 Non TLS1PRF case fixed in method_tls::prf() 2016-08-14 13:31:39 +02:00
940def31e6 Unused tls_conn_state member removed 2016-08-14 13:29:51 +02:00
47653492a2 Session key importing honours MSDN recommendation about exponent-one key usage 2016-08-14 12:44:49 +02:00
d1925a0704 method_tls::prf() simplified 2016-08-14 12:41:19 +02:00
a90a7722c7 PAP introduced 2016-08-13 18:56:37 +02:00
ae37c9aa6c TLS and TTLS distinction 2016-08-13 18:55:33 +02:00
cbda758178 MS-MPPE-Send-Key and MS-MPPE-Recv-Key are swapped now 2016-08-13 18:52:20 +02:00
04444eb99d Encrypted pre-master secret byte order is correct now 2016-08-13 18:51:14 +02:00
b7b45ea64c Cipher block length is correctly translated from bits to bytes now 2016-08-13 18:50:09 +02:00
4528f2d1fc Simplification 2016-08-13 18:48:56 +02:00
eb918f3141 Processing of vendor specific TLS messages introduced 2016-08-13 18:48:02 +02:00
c749753c68 State constants renamed more systematically 2016-08-13 18:45:40 +02:00
9f92a73aa1 make_handshake() renamed to make_message() and made more general 2016-08-13 18:42:52 +02:00
6d54d45512 Pre-master secret encryption moved to make_client_key_exchange() 2016-08-13 18:39:22 +02:00
9498e8c9a9 Fixed issue occurred after careless eap::tls_random::time elimination 2016-08-13 18:32:40 +02:00
f9c6bce0f8 Diameter AVP helper structures added 2016-08-13 18:26:19 +02:00
3d54c84430 method_ttls is now descendant of method_tls 2016-08-13 08:48:24 +02:00
1306c958fc config_method_ttls is now descendant of config_method_tls 2016-08-13 08:48:01 +02:00
09924ea3d2 credentials_ttls is descendant of credentials_tls again 2016-08-13 08:36:10 +02:00
537d0c0cbc Changing TLS configuration resets TLS session resumption 2016-08-13 08:31:03 +02:00
6408dbe237 Missing credentials error check lost with b71e30f642 reimplemented 2016-08-13 08:29:01 +02:00
534f6f6d7d tls_conn_state is class now 2016-08-13 08:09:47 +02:00
f7fdfb8dda EAP packet type check moved to Main.cpp 2016-08-13 08:09:13 +02:00
c7a41d891a TLS work continues... 2016-08-12 21:09:50 +02:00
a8c306953a TLS work continues... 2016-08-11 15:13:50 +02:00
77fe6b1bed TLS connection state moved from eap::method_tls to eap::method_tls::conn_state to make reusable later 2016-08-11 12:00:38 +02:00
659629ed93 Clean-up 2016-08-11 09:44:01 +02:00
6b4f597f27 - Microsoft's HMAC had problems with secrets longer than 16B, therefore we implemented our own
- Key generation finished
- Additional memory sanitization
2016-08-10 16:10:40 +02:00
fb0fa0de31 HMAC fixed to start with the correct key now 2016-08-10 11:18:20 +02:00
e92f47677d TLS implementation continues... 2016-08-09 18:37:12 +02:00
ba5bf1e533 HMAC cleanup 2016-08-09 06:39:33 +02:00
1bf51fda25 win_runtime_error moved to WinStd; eapxml functions return HRESULT now 2016-08-09 01:05:00 +02:00
b71e30f642 EAP_ERROR replaced with C++ exceptions for increased code readability 2016-08-08 22:59:17 +02:00
788c8cdb16 TLS implementation continues... 2016-08-08 18:52:13 +02:00
ce9e636840 TLS start packet processing logic made more robust 2016-08-08 10:42:24 +02:00
8f4c177d49 eap namespace clean-up 2016-08-08 10:13:34 +02:00
bf4b7f9787 Packet data updated correctly now; Missing server ACK detection added 2016-08-08 08:59:11 +02:00
be3c591955 TLS fragmented message correctly assembled now & Event manifest revised 2016-08-07 13:51:40 +02:00
d199cb68bb Work continues...
- More event reporting added
- unsigned long and DWORD replaced with unsigned int for code readability and (possibly) portability
- Client hello message fixed
- SSL version reverted to TLS 1.0, will catch-up later if required
2016-08-07 12:15:45 +02:00
e649a86b1f Error checking and size asserts added 2016-08-07 06:56:29 +02:00
a0efb6742d EAP-TTLS work continues... 2016-08-06 16:27:15 +02:00
b39cc927d2 Session.h/cpp >> Method.h/cpp 2016-08-06 10:36:58 +02:00
faadb712fc Sessions are actually methods now 2016-08-06 10:28:15 +02:00
97d0f75f8d eap::method introduced 2016-08-06 09:52:29 +02:00
4114863a94 Duplicate error logging removed 2016-08-06 08:21:14 +02:00
afe5450b95 Peer (Main.cpp) no longer manipulates session directly. Session management moved to eap::peer. 2016-08-06 08:06:38 +02:00
ac606b7a2e config_providers renamed to config_provider_list to avoid confusion with config_provider 2016-08-06 07:06:48 +02:00
2aa4bce8cc eap::config::m_module reference again 2016-08-06 07:01:12 +02:00
b0323d894a Issues with pre-shared credentials after being moved to heap fixed 2016-08-05 16:28:21 +02:00
42459ff16a EAP events changed to use numerical EAP type 2016-08-05 16:15:08 +02:00
2711425677 Documentation update 2016-08-05 15:52:27 +02:00
54bb2050fa peer and peer_ui are no longer templates; method specific BLOB management moved from Main(_UI).cpp to modules. 2016-08-05 15:45:45 +02:00
437f5f91b8 eap::peer<> and eap::session<> redundant template argument removed 2016-08-05 13:45:18 +02:00
91dcc0bbbc peer_base eliminated 2016-08-05 13:40:54 +02:00
a60458cdab eap::module is no longer abstract 2016-08-05 13:18:25 +02:00
4fc029138c config_method_with_cred is no longer a template 2016-08-05 11:51:59 +02:00
f4be571499 Pre-shared credentials moved to heap 2016-08-05 11:38:43 +02:00
460adb9858 m_module is now a pointer instead of reference 2016-08-05 11:23:59 +02:00
a9ecde86d9 TLS specific package communication moved from TTLS to TLS session 2016-08-05 11:01:30 +02:00
7e7c657358 Documentation update 2016-08-05 10:55:23 +02:00
f2aa43913d EAP-TTLS session development continues... 2016-08-05 00:32:57 +02:00
a102b43a19 eap::type_t >> winstd::eap_type_t 2016-08-04 12:08:20 +02:00
22a87bf90d eap::session::get_response_packet() implemented 2016-08-04 10:07:03 +02:00
caf0352833 Packet processing methods made pure virtual in eap::session<>, stubs created in eap::session_ttls 2016-08-03 15:31:06 +02:00
f68a65f8f8 eap::session<> remembers basic EAP session parameters now 2016-08-03 15:22:52 +02:00
3e82b7df49 eap::method_property => winstd::eap_method_prop 2016-08-03 15:09:58 +02:00
cb24fbd6a3 eap::peer_ttls::get_method_properties() implemented 2016-08-03 13:50:12 +02:00
b32b63631a Guests are not allowed to save credentials 2016-08-03 12:36:29 +02:00
5fe06deb97 Provider-locked configuration notice removed from credential prompt for aesthetic reasons 2016-08-03 12:35:51 +02:00
cadf7272df Credential UI revised to honor read-only, allow-save, and config/prompt mode correctly 2016-08-03 12:34:49 +02:00
2868fd3848 Cached credentials have priority now 2016-08-03 10:17:40 +02:00
9fed6dcf9d Sub-module update 2016-08-03 09:22:52 +02:00
a81ddde411 MSVC specific __super keyword replaced 2016-08-03 09:22:41 +02:00
aafd012809 Credential dialog is no longer displayed partially off the screen 2016-07-21 23:53:40 +02:00
3e60bebe3a Credential's "Remember" checkbox logic revised 2016-07-21 23:53:11 +02:00
6ae8029a47 config_method split into config_method and config_method_with_cred<> 2016-07-21 22:30:03 +02:00
ac88d55fe4 EapPeerInvokeConfigUI() checks for blank configuration now 2016-07-21 21:57:31 +02:00
955d7f5dc1 Missing credentials are correctly honoured now 2016-07-21 14:21:33 +02:00
b4667cac18 Inner-method-name-determining-from-NULL-pointer-crash fixed :) 2016-07-21 14:15:39 +02:00
98f20668c3 credentials_ttls::target_suffix() implemented 2016-07-21 14:14:26 +02:00
df773b649c Event colours updated for greater disambiguation between EAPHost and GÉANTLink entries 2016-07-21 13:29:55 +02:00
6d8bd3f1c1 Cached credentials are correctly honored now 2016-07-21 13:21:40 +02:00
fa84cf93b9 32-bit C compiler warning fixed 2016-07-21 12:52:30 +02:00
f459a036da peer_ttls::get_identity() finished 2016-07-21 12:36:18 +02:00
cc43b44d91 credentials_ttls::get_identity() introduced 2016-07-21 12:35:19 +02:00
35034789d2 String typing fixed 2016-07-21 12:34:49 +02:00
4834c9e4da credentials::get_name() fixed to return "<blank>" for empty credentials 2016-07-21 12:34:19 +02:00
ee8410bdb9 credentials::target_suffix() is public now, as it can be reused to provide GUI method identifier 2016-07-21 12:33:32 +02:00
d69e8b3f6a EapPeerGetIdentity() accounts for missing cached credentials now 2016-07-21 12:30:46 +02:00
4ab60271b7 Missing key-pair added to EAPTTLS resources 2016-07-21 12:29:49 +02:00
1b9f33a6fc Path-delimiters unified in RC files 2016-07-21 12:29:23 +02:00
627b20aabc pack() => operator <<, unpack() => operator >>, get_pk_size() => pksizeof() 2016-07-21 09:20:09 +02:00
51428d290f Memory overflow detection when packing/unpacking BLOB added 2016-07-20 19:29:21 +02:00
2f4425f38c EAPSerial.h merged into EAP.h 2016-07-20 18:17:25 +02:00
b26ab72e6e Some more template simplifications followed 2016-07-20 18:10:38 +02:00
9376404164 eap::config_provider changed from template to class followed by a mass detemplatization of other classes 2016-07-20 17:57:43 +02:00
a7d75ea72d eap::config_provider detemplatization 2016-07-20 16:47:37 +02:00
780b738842 config_provider::m_methods is a list of pointers to method configurations now paving the road to config_provider detemplatization 2016-07-20 16:04:56 +02:00
e87c0af221 Secondary method configurations properly initialized now 2016-07-20 15:33:00 +02:00
180d9b265c eap::config_method is no longer a template class 2016-07-20 15:21:58 +02:00
ce0bbc5b45 config_method::m_preshared moved to heap, which in turn required shift to virtual methods for packing/unpacking BLOBs 2016-07-20 14:59:12 +02:00
3e82e988d4 Identity of digital certificates is correctly resolved now 2016-07-20 12:59:58 +02:00
418e591aa6 Tool-tip update 2016-07-20 12:39:33 +02:00
b7ea2f7a72 EapPeerGetUIContext()/eap::session::get_ui_context() completed 2016-07-20 12:04:11 +02:00
07b4ce988b eap::credentials_ttls::m_inner is std::unique_ptr managed now
(Also fixes a memory leak caused by missing destructor pointer delete)
2016-07-20 11:47:40 +02:00
427e2fb892 config_method_ttls::m_inner is managed by std::unique_ptr now 2016-07-20 11:35:29 +02:00
db69c23689 usr => cred 2016-07-20 11:27:23 +02:00
43751ed908 Template arguments and type names unified 2016-07-20 11:25:03 +02:00
2a19b4624a Class consistency renaming 2016-07-20 11:05:01 +02:00
434e042f8b Class naming update 2016-07-20 10:37:12 +02:00
512f46f014 pack/unpack & load/save nesting arranged all the way up to eap::config 2016-07-20 10:31:34 +02:00
a92cafea36 eap::credentials::get_name() method introduced to allow more detailed display of certificate names 2016-07-20 10:05:36 +02:00
4f6943044f eap::credentials::m_identity replaced with virtual method get_identity() 2016-07-20 09:54:26 +02:00
504ea681a9 Strings packed/unpacked as zero-terminated (instead of length prefixed) now 2016-07-20 09:22:54 +02:00
54fc2dd830 Generic templates for data packing/unpacking replaced with specific to avoid accidental use 2016-07-20 09:14:47 +02:00
a0303f0a1f EAP-TTLS module and session data types for interactive prompt/response data changed to bool for simplicity of next commit 2016-07-20 09:10:54 +02:00
40c992e1a5 Memory sanitizing on BLOB free removed, since BLOBS are encrypted from d15b7066cd on 2016-07-20 08:48:28 +02:00
4630b32f77 target_suffix() method is private now 2016-07-19 13:39:41 +02:00
4acabbca4e Configuration and credentials logging introduced 2016-07-19 12:53:54 +02:00
2f28b89ab2 Trusted Root CA list displays the certificate names in the consistent way with credential certificates now 2016-07-19 12:15:01 +02:00
9257391938 eapxml::get_xpath() introduced 2016-07-19 12:05:38 +02:00
4e407b7dad Minor flaws with array and struct display fixed 2016-07-19 12:04:49 +02:00
faea2f3771 eap::get_cert_title() moved from TLS_UI to TLS 2016-07-19 12:03:02 +02:00
0ee9bade32 EAPMETHOD_TRACE_EAP_ERROR => EAPMETHOD_TRACE_EVT_EAP_ERROR 2016-07-19 08:54:32 +02:00
34f16478e4 EventMonitor icon added 2016-07-19 07:01:04 +02:00
00244e3846 EventMonitor is functional now 2016-07-18 16:49:55 +02:00
6822a91f41 Paths to files are generated using folder properties instead of component's key-file referencing to avoid ICE69 warnings 2016-07-18 09:46:47 +02:00
06adf7ddae EventMonitor replaced with Windows-based application (work in progress...) 2016-07-15 13:16:17 +02:00
8eb1936adf Internal and output folders now using $(MSBuildProjectName) instead of $(ProjectName), to distinguish project variations of essentially the same module 2016-07-15 12:45:34 +02:00
c8de331d50 Translation template added 2016-07-15 10:54:58 +02:00
560aa3068d General package information moved from NMAKE macros to Property table, to allow translation to other scripts (than Windows-1252 and Windows-1250) 2016-07-15 10:54:44 +02:00
d792520f51 Version set to 1.0-alpha5
(closes #2)
2016-06-23 17:19:47 +02:00
9f4c4514cb EAPHost trace added 2016-06-23 17:16:52 +02:00
de94d27380 EventMonitor added to MSI 2016-06-23 17:16:24 +02:00
ded87eb18c EventMonitor requires elevation now 2016-06-23 17:16:03 +02:00
0639169d9a EventMonitor utility is operational now 2016-06-23 15:46:58 +02:00
fa141fc525 Correct event is reported for DWORD-returning functions now 2016-06-23 15:46:12 +02:00
1fc77fc63d EAP method type is now a map 2016-06-23 15:44:57 +02:00
d15b7066cd RSA encryption replaced with RSA session key exchange and AES data encryption; BLOBs are encrypted again 2016-06-23 00:47:38 +02:00
922d0ac3d0 Additional RSA credential encryption replaced with product-specific entropy in user-specific encryption pass, to circumvent RSA data length limitation 2016-06-22 23:32:28 +02:00
f3cb90d1c3 EventMonitor development continues... 2016-06-22 18:03:47 +02:00
a7e0e5ebd8 MSIBUILD_PRODUCT_NAME check added 2016-06-22 18:02:42 +02:00
3238881af8 Event provider registration added 2016-06-22 18:02:20 +02:00
9d0d3418b0 Sub-module update 2016-06-22 18:01:52 +02:00
81a268df1b Sub-module update 2016-06-22 17:59:43 +02:00
d1a4487503 BLOB encryption temporary disabled, as RSA can not encrypt data this long 2016-06-22 17:59:26 +02:00
24008000a9 Merge branch 'master' of https://github.com/Amebis/GEANTLink 2016-06-22 09:18:41 +02:00
bdd3fc616c EAP BLOBs are encrypted now 2016-06-22 09:18:27 +02:00
e31fc08a64 EventMonitor utility introduced 2016-06-22 06:28:21 +02:00
a2ca2fd850 Logging and error reporting simplified 2016-06-21 13:15:50 +02:00
e98856f934 Support for provider contact info added 2016-06-21 10:46:05 +02:00
b634956901 Credentials dialog banner title now dynamic 2016-06-21 09:18:17 +02:00
0c8492ccd1 CredProtect() replaced with CryptProtectData() << the former didn't work between normal and UAC-elevated processes: stored credentials are no longer valid and should be reentered 2016-06-20 16:37:48 +02:00
768e0a5a36 Previously unused templates fixed 2016-06-20 16:24:58 +02:00
ac23d5f04f Custom credential prompt labels are honored now (for password-based methods) 2016-06-20 15:14:48 +02:00
e52b9a636f Support for read-only configurations added 2016-06-20 14:51:21 +02:00
2f0948b4fd Version set to 1.0-alpha4 2016-06-18 10:53:23 +02:00
33a72acac7 MsiUseFeature utility added
(closes #3)
2016-06-18 10:51:12 +02:00
d430b63829 (Pre-shared) client certificates are no longer maintained by hash only 2016-06-16 00:29:56 +02:00
cda81dd696 Aesthetic modifications 2016-06-16 00:25:10 +02:00
6e15d3535d Support for NULL certificates added 2016-06-16 00:24:52 +02:00
ec0b283540 Functions using EAP_ERROR descriptor return bool now for code simplicity 2016-06-15 22:59:52 +02:00
03358170f4 EAP-TTLS PAP credentials panel loads correctly now 2016-06-15 22:58:07 +02:00
a9fdd1d71d Support for pre-shared credentials introduced 2016-06-15 20:00:04 +02:00
ef9fa750a0 UI tune-up 2016-06-15 15:44:10 +02:00
fed1e6052a Encryption enhanced and moved to module 2016-06-15 14:20:12 +02:00
2f0252a33f Added missing result check 2016-06-15 14:06:11 +02:00
11c28326aa Serialization of TTLS credentials added 2016-06-15 11:30:03 +02:00
df2fee4cef Virtual method implementations moved to .cpp files
get_method_id() now const
2016-06-15 11:26:51 +02:00
9cf80108b5 Credential saving to XML introduced to support pre-shared credentials 2016-06-15 11:05:32 +02:00
e0460fa15b Redundant sizeof(char) removed for code clarity 2016-06-15 10:52:23 +02:00
8bff2d3060 Test credentials read added to debug builds of CredWrite 2016-06-15 10:44:31 +02:00
822852c8b4 Password encryption/decryption moved to standalone methods to make reusable 2016-06-15 10:25:52 +02:00
155671a4da .gitignore update 2016-06-14 10:23:01 +02:00
f675083891 Doxygen documentation update 2016-06-12 09:07:42 +02:00
cf7ca9c8e9 EAP modules divided to libraries 2016-06-10 12:24:49 +02:00
224 changed files with 58041 additions and 9257 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/*.opensdf
/*.suo
/*.sdf
/doc
/ipch

3
.gitmodules vendored
View File

@@ -4,3 +4,6 @@
[submodule "lib/WinStd"]
path = lib/WinStd
url = https://github.com/Amebis/WinStd.git
[submodule "lib/wxExtend"]
path = lib/wxExtend
url = https://github.com/Amebis/wxExtend.git

View File

@@ -7,8 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\EAPMethods\EAPMethodEvents\temp\EAPMethodEvents.$(Platform).$(Configuration).$(PlatformToolset);..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>EAPMETHOD_TYPE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\lib\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />

Binary file not shown.

View File

@@ -86,8 +86,6 @@
<ClInclude Include="StdAfx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\EAPMethods\src\EAP.cpp" />
<ClCompile Include="..\EAPMethods\src\PAP.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
@@ -100,9 +98,15 @@
<ResourceCompile Include="CredWrite.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EAPMethods\EAPMethodEvents\EAPMethodEvents.vcxproj">
<ProjectReference Include="..\lib\EAPBase\build\EAPBase.vcxproj">
<Project>{ad6816a0-9600-4e01-8c49-39d03d1e791f}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\PAP\build\PAP.vcxproj">
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>

View File

@@ -26,12 +26,6 @@
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\EAPMethods\src\EAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\EAPMethods\src\PAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="CredWrite.rc">

View File

@@ -20,8 +20,6 @@
#include "StdAfx.h"
#pragma comment(lib, "Crypt32.lib")
using namespace std;
using namespace winstd;
@@ -83,15 +81,25 @@ static int CredWrite()
}
// Write credentials.
EAP_ERROR *pEapError;
DWORD dwResult;
if ((dwResult = cred.store(target_name.c_str(), &pEapError)) != ERROR_SUCCESS) {
if (pEapError) {
OutputDebugStr(_T("%ls (error %u)\n"), pEapError->pRootCauseString, pEapError->dwWinError);
g_module.free_error_memory(pEapError);
} else
OutputDebugStr(_T("Writing credentials failed (error %u).\n"), dwResult);
#ifdef _DEBUG
{
eap::credentials_pap cred_stored(g_module);
try {
cred_stored.retrieve(target_name.c_str());
} catch(win_runtime_error &err) {
OutputDebugStr(_T("%hs (error %u)\n"), err.what(), err.number());
} catch(...) {
OutputDebugStr(_T("Reading credentials failed.\n"));
}
}
#endif
try {
cred.store(target_name.c_str());
} catch(win_runtime_error &err) {
OutputDebugStr(_T("%hs (error %u)\n"), err.what(), err.number());
return 2;
} catch(...) {
OutputDebugStr(_T("Writing credentials failed.\n"));
return 2;
}

View File

@@ -20,17 +20,16 @@
#pragma once
#include "../include/Version.h"
#include "../EAPMethods/include/EAP.h"
#include "../EAPMethods/include/PAP.h"
#include "../lib/PAP/include/Config.h"
#include "../lib/PAP/include/Credentials.h"
#include "../lib/EAPBase/include/Module.h"
#include <WinStd/Common.h>
#include <WinStd/Base64.h>
#include <WinStd/Cred.h>
#include <WinStd/Crypt.h>
#include <WinStd/Win.h>
#include <tchar.h>
#include <Windows.h>
#include <eaptypes.h> // Must include after <Windows.h>
#include <tchar.h>
#include <memory>

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.8.7
# Doxyfile 1.8.7
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "EAPModules"
PROJECT_NAME = "GÉANTLink"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -44,7 +44,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "EAP Modules"
PROJECT_BRIEF = "EAP Supplicant for Windows"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
@@ -718,7 +718,7 @@ WARN_IF_UNDOCUMENTED = YES
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
WARN_IF_DOC_ERROR = NO
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
@@ -726,7 +726,7 @@ WARN_IF_DOC_ERROR = YES
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
WARN_NO_PARAMDOC = YES
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
@@ -789,7 +789,11 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = res
EXCLUDE = \
lib\EAPBase_UI\res \
lib\TLS_UI\res \
lib\TTLS_UI\res \
lib\WinStd
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@@ -1 +0,0 @@
/doc

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="..\..\include\ResourceDLL.props" />
<Import Project="..\build\Common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup />
</Project>

Binary file not shown.

View File

@@ -79,20 +79,10 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemGroup>
<ClInclude Include="..\include\EAP.h" />
<ClInclude Include="..\include\EAPSerial.h" />
<ClInclude Include="..\include\TLS.h" />
<ClInclude Include="..\include\TTLS.h" />
<ClInclude Include="..\include\EAPXML.h" />
<ClInclude Include="..\include\PAP.h" />
<ClInclude Include="StdAfx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\EAP.cpp" />
<ClCompile Include="..\src\TLS.cpp" />
<ClCompile Include="..\src\TTLS.cpp" />
<ClCompile Include="..\src\Main.cpp" />
<ClCompile Include="..\src\PAP.cpp" />
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -104,12 +94,24 @@
<ResourceCompile Include="EAPTTLS.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\lib\EAPBase\build\EAPBase.vcxproj">
<Project>{ad6816a0-9600-4e01-8c49-39d03d1e791f}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\PAP\build\PAP.vcxproj">
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TLS\build\TLS.vcxproj">
<Project>{4d40cb8a-812e-4f12-b23a-31af743878e8}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TTLS\build\TTLS.vcxproj">
<Project>{ee0ef0d9-a475-4038-8637-5754724f65b0}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\EAPMethodEvents\EAPMethodEvents.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\build\EAPMethod.def" />

View File

@@ -18,24 +18,6 @@
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TTLS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\PAP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EAPXML.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TLS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EAP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EAPSerial.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
@@ -44,18 +26,6 @@
<ClCompile Include="..\src\Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\PAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\EAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TLS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TTLS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EAPTTLS.rc">

View File

@@ -20,31 +20,5 @@
#pragma once
#include "../../include/Version.h"
#include "../include/EAP.h"
#include "../include/EAPSerial.h"
#include "../include/TLS.h"
#include "../include/TTLS.h"
#include "../include/EAPXML.h"
#include "../include/PAP.h"
#include <WinStd/Base64.h>
#include <WinStd/Cred.h>
#include <WinStd/Crypt.h>
#include <WinStd/ETW.h>
#include <WinStd/Hex.h>
#include <WinStd/Win.h>
#include <eaptypes.h>
#include <eapmethodpeerapis.h>
#include <Commctrl.h>
#include <Msi.h>
#include <tchar.h>
#include <Shlwapi.h>
#include <Windows.h>
#include <EAPMethodETW.h>
#pragma comment(lib, "Crypt32.lib")
#include "../../lib/TTLS/include/Method.h"
#include "../../lib/TTLS/include/Module.h"

Binary file not shown.

View File

@@ -79,33 +79,10 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemGroup>
<ClInclude Include="..\include\EAP.h" />
<ClInclude Include="..\include\EAPXML.h" />
<ClInclude Include="..\include\EAP_UI.h" />
<ClInclude Include="..\include\PAP_UI.h" />
<ClInclude Include="..\include\TLS.h" />
<ClInclude Include="..\include\TTLS.h" />
<ClInclude Include="..\include\TTLS_UI.h" />
<ClInclude Include="..\include\PAP.h" />
<ClInclude Include="..\include\TLS_UI.h" />
<ClInclude Include="..\res\wxEAP_UI.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="..\res\wxTLS_UI.h" />
<ClInclude Include="..\res\wxTTLS_UI.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\res\wxEAP_UI.cpp" />
<ClCompile Include="..\res\wxTLS_UI.cpp" />
<ClCompile Include="..\res\wxTTLS_UI.cpp" />
<ClCompile Include="..\src\EAP.cpp" />
<ClCompile Include="..\src\PAP_UI.cpp" />
<ClCompile Include="..\src\TLS.cpp" />
<ClCompile Include="..\src\TTLS.cpp" />
<ClCompile Include="..\src\TTLS_UI.cpp" />
<ClCompile Include="..\src\Main_UI.cpp" />
<ClCompile Include="..\src\PAP.cpp" />
<ClCompile Include="..\src\EAP_UI.cpp" />
<ClCompile Include="..\src\TLS_UI.cpp" />
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -117,20 +94,46 @@
<ResourceCompile Include="EAPTTLSUI.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\lib\EAPBase\build\EAPBase.vcxproj">
<Project>{ad6816a0-9600-4e01-8c49-39d03d1e791f}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\EAPBase_UI\build\EAPBase_UI.vcxproj">
<Project>{d4b54856-be1f-4937-a8f7-495125be76be}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\PAP\build\PAP.vcxproj">
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\PAP_UI\build\PAP_UI.vcxproj">
<Project>{3d309c2e-64ab-4bc4-a16d-468571a2bc1a}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TLS\build\TLS.vcxproj">
<Project>{4d40cb8a-812e-4f12-b23a-31af743878e8}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TLS_UI\build\TLS_UI.vcxproj">
<Project>{9a25c261-8ade-4938-8393-e857ef0e37e9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TTLS\build\TTLS.vcxproj">
<Project>{ee0ef0d9-a475-4038-8637-5754724f65b0}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\TTLS_UI\build\TTLS_UI.vcxproj">
<Project>{42f0f0f4-c928-4860-a4e4-94991c2c3d90}</Project>
</ProjectReference>
<ProjectReference Include="..\..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\EAPMethodEvents\EAPMethodEvents.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\build\EAPMethodUI.def" />
<None Include="..\res\wxEAP_UI.fbp" />
<None Include="..\res\wxTLS_UI.fbp" />
<None Include="..\res\wxTTLS_UI.fbp" />
<None Include="..\locale\EAPMethods.pot" />
</ItemGroup>
<ItemGroup>
<POCompile Include="..\locale\sl_SI.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\include\xgettext.targets" />
</ImportGroup>
</Project>

View File

@@ -13,97 +13,23 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Header Files\wx">
<UniqueIdentifier>{51f0404d-9280-4fcc-8138-5d1f815ce568}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\wx">
<UniqueIdentifier>{9befee7a-5dff-41dd-b080-4e26ccb19a7f}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files\wx">
<UniqueIdentifier>{0ec1840b-101c-415a-91c6-2c7eb4530c15}</UniqueIdentifier>
<Filter Include="Resource Files\Localization">
<UniqueIdentifier>{e43059ae-37ac-4b28-84fb-18d1b3972b30}</UniqueIdentifier>
<Extensions>po;pot</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TTLS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\PAP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TLS_UI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TLS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\res\wxEAP_UI.h">
<Filter>Header Files\wx</Filter>
</ClInclude>
<ClInclude Include="..\res\wxTLS_UI.h">
<Filter>Header Files\wx</Filter>
</ClInclude>
<ClInclude Include="..\res\wxTTLS_UI.h">
<Filter>Header Files\wx</Filter>
</ClInclude>
<ClInclude Include="..\include\EAP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EAP_UI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TTLS_UI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EAPXML.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\PAP_UI.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\PAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\res\wxEAP_UI.cpp">
<Filter>Source Files\wx</Filter>
</ClCompile>
<ClCompile Include="..\res\wxTLS_UI.cpp">
<Filter>Source Files\wx</Filter>
</ClCompile>
<ClCompile Include="..\res\wxTTLS_UI.cpp">
<Filter>Source Files\wx</Filter>
</ClCompile>
<ClCompile Include="..\src\EAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\EAP_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TLS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TLS_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TTLS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\TTLS_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Main_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\PAP_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EAPTTLSUI.rc">
@@ -114,14 +40,13 @@
<None Include="..\build\EAPMethodUI.def">
<Filter>Source Files</Filter>
</None>
<None Include="..\res\wxEAP_UI.fbp">
<Filter>Resource Files\wx</Filter>
</None>
<None Include="..\res\wxTTLS_UI.fbp">
<Filter>Resource Files\wx</Filter>
</None>
<None Include="..\res\wxTLS_UI.fbp">
<Filter>Resource Files\wx</Filter>
<None Include="..\locale\EAPMethods.pot">
<Filter>Resource Files\Localization</Filter>
</None>
</ItemGroup>
<ItemGroup>
<POCompile Include="..\locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
</Project>

View File

@@ -18,48 +18,6 @@
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
#define _CRT_SECURE_NO_WARNINGS
#pragma once
#include "../../include/Version.h"
#include "../include/EAP.h"
#include "../include/EAP_UI.h"
#include "../include/EAPSerial.h"
#include "../include/EAPXML.h"
#include "../include/TLS.h"
#include "../include/TLS_UI.h"
#include "../include/TTLS.h"
#include "../include/TTLS_UI.h"
#include "../include/PAP.h"
#include "../include/PAP_UI.h"
#include "../res/wxTLS_UI.h"
#include "../res/wxTTLS_UI.h"
#include <WinStd/Base64.h>
#include <WinStd/Cred.h>
#include <WinStd/Crypt.h>
#include <WinStd/ETW.h>
#include <WinStd/Hex.h>
#include <WinStd/Win.h>
#include <wx/app.h>
#include <wx/filedlg.h>
#include <wx/init.h>
#include <wx/msgdlg.h>
#include <eaptypes.h>
#include <eapmethodpeerapis.h>
#include <Commctrl.h>
#include <cryptuiapi.h>
#include <Msi.h>
#include <tchar.h>
#include <Shlwapi.h>
#include <Windows.h>
#include <EAPMethodETW.h>
#pragma comment(lib, "Crypt32.lib")
#include "../../lib/TTLS_UI/include/Module.h"

Binary file not shown.

View File

@@ -8,11 +8,8 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);..\EAPMethodEvents\temp\EAPMethodEvents.$(Platform).$(Configuration).$(PlatformToolset);..\include;..\..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);..\..\lib\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\include;..\..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>temp\EAPMethodEvents.$(Platform).$(Configuration).$(PlatformToolset);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,370 +0,0 @@
/*
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 <WinStd/Crypt.h>
#include <list>
#include <string>
#include <vector>
namespace eapserial
{
template <class T> inline void pack(_Inout_ unsigned char *&cursor, _In_ const T &val);
template <class T> inline size_t get_pk_size(_In_ const T &val);
template <class T> inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ T &val);
template<class _Elem, class _Traits, class _Ax> inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val);
template<class _Elem, class _Traits, class _Ax> inline size_t get_pk_size(const std::basic_string<_Elem, _Traits, _Ax> &val);
template<class _Elem, class _Traits, class _Ax> inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::basic_string<_Elem, _Traits, _Ax> &val);
template<class _Traits, class _Ax> inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val);
template<class _Traits, class _Ax> inline size_t get_pk_size(const std::basic_string<wchar_t, _Traits, _Ax> &val);
template<class _Traits, class _Ax> inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &val);
template<class _Ty, class _Ax> inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::vector<_Ty, _Ax> &val);
template<class _Ty, class _Ax> inline size_t get_pk_size(const std::vector<_Ty, _Ax> &val);
template<class _Ty, class _Ax> inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::vector<_Ty, _Ax> &val);
template<class _Ty, class _Ax> inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::list<_Ty, _Ax> &val);
template<class _Ty, class _Ax> inline size_t get_pk_size(const std::list<_Ty, _Ax> &val);
template<class _Ty, class _Ax> inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::list<_Ty, _Ax> &val);
inline void pack(_Inout_ unsigned char *&cursor, _In_ const winstd::cert_context &val);
inline size_t get_pk_size(const winstd::cert_context &val);
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ winstd::cert_context &val);
}
#pragma once
namespace eapserial
{
///
/// Packs a primitive data
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Variable with data to pack
///
template <class T>
inline void pack(_Inout_ unsigned char *&cursor, _In_ const T &val)
{
memcpy(cursor, &val, sizeof(T));
cursor += sizeof(T);
}
///
/// Returns packed size of a primitive data
///
/// \param[in] val Data to pack
///
/// \returns Size of data when packed (in bytes)
///
template <class T>
inline size_t get_pk_size(_In_ const T &val)
{
UNREFERENCED_PARAMETER(val);
return sizeof(T);
}
///
/// Unpacks a primitive data
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Variable to receive unpacked value
///
template <class T>
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ T &val)
{
memcpy(&val, cursor, sizeof(T));
cursor += sizeof(T);
}
///
/// Packs a string
///
/// \param[inout] cursor Memory cursor
/// \param[in] val String to pack
///
template<class _Elem, class _Traits, class _Ax>
inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val)
{
std::basic_string<_Elem, _Traits, _Ax>::size_type count = val.length();
*(std::basic_string<_Elem, _Traits, _Ax>::size_type*&)cursor = count;
cursor += sizeof(std::basic_string<_Elem, _Traits, _Ax>::size_type);
size_t nSize = sizeof(_Elem)*count;
memcpy(cursor, (const _Elem*)val.c_str(), nSize);
cursor += nSize;
}
///
/// Returns packed size of a string
///
/// \param[in] val String to pack
///
/// \returns Size of data when packed (in bytes)
///
template<class _Elem, class _Traits, class _Ax>
inline size_t get_pk_size(const std::basic_string<_Elem, _Traits, _Ax> &val)
{
return sizeof(std::basic_string<_Elem, _Traits, _Ax>::size_type) + sizeof(_Elem)*val.length();
}
///
/// Unpacks a string
///
/// \param[inout] cursor Memory cursor
/// \param[out] val String to unpack to
///
template<class _Elem, class _Traits, class _Ax>
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::basic_string<_Elem, _Traits, _Ax> &val)
{
std::basic_string<_Elem, _Traits, _Ax>::size_type count = *(const std::basic_string<_Elem, _Traits, _Ax>::size_type*&)cursor;
cursor += sizeof(std::basic_string<_Elem, _Traits, _Ax>::size_type);
val.assign((const _Elem*&)cursor, count);
cursor += sizeof(_Elem)*count;
}
///
/// Packs a wide string
///
/// \param[inout] cursor Memory cursor
/// \param[in] val String to pack
///
template<class _Traits, class _Ax>
inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val)
{
std::string val_utf8;
WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), val_utf8, NULL, NULL);
pack(cursor, val_utf8);
}
///
/// Returns packed size of a wide string
///
/// \param[in] val String to pack
///
/// \returns Size of data when packed (in bytes)
///
template<class _Traits, class _Ax>
inline size_t get_pk_size(const std::basic_string<wchar_t, _Traits, _Ax> &val)
{
return sizeof(std::string::size_type) + sizeof(char)*WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), NULL, 0, NULL, NULL);
}
///
/// Unpacks a wide string
///
/// \param[inout] cursor Memory cursor
/// \param[out] val String to unpack to
///
template<class _Traits, class _Ax>
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &val)
{
std::string val_utf8;
unpack(cursor, val_utf8);
MultiByteToWideChar(CP_UTF8, 0, val_utf8.c_str(), (int)val_utf8.length(), val);
}
///
/// Packs a vector
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Vector to pack
///
template<class _Ty, class _Ax>
inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::vector<_Ty, _Ax> &val)
{
std::vector<_Ty, _Ax>::size_type count = val.size();
*(std::vector<_Ty, _Ax>::size_type*&)cursor = count;
cursor += sizeof(std::vector<_Ty, _Ax>::size_type);
// Since we do not know wheter vector elements are primitives or objects, iterate instead of memcpy.
// For performance critical vectors of flat opaque data types write specialized template instantiation.
for (std::vector<_Ty, _Ax>::size_type i = 0; i < count; i++)
pack(cursor, val[i]);
}
///
/// Returns packed size of a vector
///
/// \param[in] val Vector to pack
///
/// \returns Size of data when packed (in bytes)
///
template<class _Ty, class _Ax>
inline size_t get_pk_size(const std::vector<_Ty, _Ax> &val)
{
// 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.
size_t size = sizeof(std::vector<_Ty, _Ax>::size_type);
for (std::vector<_Ty, _Ax>::size_type i = 0, count = val.size(); i < count; i++)
size += get_pk_size(val[i]);
return size;
}
///
/// Unpacks a vector
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Vector to unpack to
///
template<class _Ty, class _Ax>
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::vector<_Ty, _Ax> &val)
{
std::vector<_Ty, _Ax>::size_type count = *(const std::vector<_Ty, _Ax>::size_type*&)cursor;
cursor += sizeof(std::vector<_Ty, _Ax>::size_type);
// Since we do not know wheter vector elements are primitives or objects, iterate instead of assign().
// For performance critical vectors of flat opaque data types write specialized template instantiation.
val.clear();
val.reserve(count);
for (std::vector<_Ty, _Ax>::size_type i = 0; i < count; i++) {
_Ty el;
unpack(cursor, el);
val.push_back(el);
}
}
///
/// Packs a list
///
/// \param[inout] cursor Memory cursor
/// \param[in] val List to pack
///
template<class _Ty, class _Ax>
inline void pack(_Inout_ unsigned char *&cursor, _In_ const std::list<_Ty, _Ax> &val)
{
std::list<_Ty, _Ax>::size_type count = val.size();
*(std::list<_Ty, _Ax>::size_type*&)cursor = count;
cursor += sizeof(std::list<_Ty, _Ax>::size_type);
// Since we do not know wheter list elements are primitives or objects, iterate instead of memcpy.
// For performance critical vectors of flat opaque data types write specialized template instantiation.
for (std::list<_Ty, _Ax>::const_iterator i = val.cbegin(), i_end = val.cend(); i != i_end; ++i)
pack(cursor, *i);
}
///
/// Returns packed size of a list
///
/// \param[in] val List to pack
///
/// \returns Size of data when packed (in bytes)
///
template<class _Ty, class _Ax>
inline size_t get_pk_size(const std::list<_Ty, _Ax> &val)
{
// 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.
size_t size = sizeof(std::list<_Ty, _Ax>::size_type);
for (std::list<_Ty, _Ax>::const_iterator i = val.cbegin(), i_end = val.cend(); i != i_end; ++i)
size += get_pk_size(*i);
return size;
}
///
/// Unpacks a list
///
/// \param[inout] cursor Memory cursor
/// \param[out] val List to unpack to
///
template<class _Ty, class _Ax>
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ std::list<_Ty, _Ax> &val)
{
std::list<_Ty, _Ax>::size_type count = *(const std::list<_Ty, _Ax>::size_type*&)cursor;
cursor += sizeof(std::list<_Ty, _Ax>::size_type);
// Since we do not know wheter list elements are primitives or objects, iterate instead of assign().
// For performance critical vectors of flat opaque data types write specialized template instantiation.
val.clear();
for (std::list<_Ty, _Ax>::size_type i = 0; i < count; i++) {
_Ty el;
unpack(cursor, el);
val.push_back(el);
}
}
///
/// Packs a certificate context
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Certificate context to pack
///
inline void pack(_Inout_ unsigned char *&cursor, _In_ const winstd::cert_context &val)
{
*(DWORD*&)cursor = val->dwCertEncodingType;
cursor += sizeof(DWORD);
*(DWORD*&)cursor = val->cbCertEncoded;
cursor += sizeof(DWORD);
memcpy(cursor, val->pbCertEncoded, val->cbCertEncoded);
cursor += val->cbCertEncoded;
}
///
/// Returns packed size of a certificate context
///
/// \param[in] val Certificate context to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t get_pk_size(const winstd::cert_context &val)
{
return sizeof(DWORD) + sizeof(DWORD) + val->cbCertEncoded;
}
///
/// Unpacks a certificate context
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Certificate context to unpack to
///
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ winstd::cert_context &val)
{
DWORD dwCertEncodingType = *(DWORD*&)cursor;
cursor += sizeof(DWORD);
DWORD dwCertEncodedSize = *(DWORD*&)cursor;
cursor += sizeof(DWORD);
val.create(dwCertEncodingType, (BYTE*)cursor, dwCertEncodedSize);
cursor += dwCertEncodedSize;
}
}

View File

@@ -1,384 +0,0 @@
/*
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 <WinStd/Base64.h>
#include <WinStd/COM.h>
#include <WinStd/Hex.h>
#include <assert.h>
#include <MsXml.h>
#include <string>
#include <vector>
namespace eapxml
{
inline DWORD get_document(_In_ IXMLDOMNode *pXmlNode, _Out_ IXMLDOMDocument2 **ppXmlDoc);
inline DWORD select_node(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ IXMLDOMNode **ppXmlNode);
inline DWORD select_nodes(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ IXMLDOMNodeList **ppXmlNodes);
inline DWORD select_element(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ IXMLDOMElement **ppXmlElement);
inline DWORD create_element(_In_ IXMLDOMDocument *pDoc, _In_z_ const BSTR bstrElementName, _In_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement);
inline DWORD create_element(_In_ IXMLDOMDocument *pDoc, IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementNameSelect, _In_z_ const BSTR bstrElementNameCreate, _In_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement);
inline bool has_parent(_In_ IXMLDOMNode *pXmlNode);
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ BSTR *pbstrValue);
template<class _Traits, class _Ax> inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue);
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ DWORD *pdwValue);
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ bool *pbValue);
template<class _Ty, class _Ax> inline DWORD get_element_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue);
template<class _Ty, class _Ax> inline DWORD get_element_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue);
inline DWORD get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ BSTR *pbstrValue);
template<class _Traits, class _Ax> inline DWORD get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue);
inline DWORD put_element(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement);
inline DWORD 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);
inline DWORD put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ DWORD dwValue);
inline DWORD put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ bool bValue);
inline DWORD 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);
inline DWORD 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);
}
#pragma once
namespace eapxml
{
inline DWORD get_document(_In_ IXMLDOMNode *pXmlNode, _Out_ IXMLDOMDocument2 **ppXmlDoc)
{
assert(pXmlNode);
assert(ppXmlDoc);
HRESULT hr;
winstd::com_obj<IXMLDOMDocument> doc;
return
SUCCEEDED(hr = pXmlNode->get_ownerDocument(&doc)) &&
SUCCEEDED(hr = doc.query_interface(ppXmlDoc)) ? ERROR_SUCCESS : HRESULT_CODE(hr);
}
inline DWORD select_node(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ IXMLDOMNode **ppXmlNode)
{
assert(pXmlParent);
assert(ppXmlNode);
HRESULT hr;
return
SUCCEEDED(hr = pXmlParent->selectSingleNode(bstrNodeName, ppXmlNode)) ?
*ppXmlNode ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr);
}
inline DWORD select_nodes(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrNodeName, _Out_ IXMLDOMNodeList **ppXmlNodes)
{
assert(pXmlParent);
assert(ppXmlNodes);
HRESULT hr;
return
SUCCEEDED(hr = pXmlParent->selectNodes(bstrNodeName, ppXmlNodes)) ?
*ppXmlNodes ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr);
}
inline DWORD select_element(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ IXMLDOMElement **ppXmlElement)
{
assert(ppXmlElement);
DWORD dwResult;
HRESULT hr;
winstd::com_obj<IXMLDOMNode> pXmlNode;
return
(dwResult = select_node(pXmlParent, bstrElementName, &pXmlNode)) == ERROR_SUCCESS ?
SUCCEEDED(hr = pXmlNode.query_interface(ppXmlElement)) ?
*ppXmlElement ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr) : dwResult;
}
inline DWORD create_element(_In_ IXMLDOMDocument *pDoc, _In_z_ const BSTR bstrElementName, _In_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement)
{
assert(pDoc);
assert(ppXmlElement);
static const winstd::variant varNodeTypeEl(NODE_ELEMENT);
HRESULT hr;
winstd::com_obj<IXMLDOMNode> pXmlNode;
return
SUCCEEDED(hr = pDoc->createNode(varNodeTypeEl, bstrElementName, bstrNamespace, &pXmlNode)) ?
SUCCEEDED(hr = pXmlNode.query_interface(ppXmlElement)) ?
*ppXmlElement ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr) : HRESULT_CODE(hr);
}
inline DWORD create_element(_In_ IXMLDOMDocument *pDoc, IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementNameSelect, _In_z_ const BSTR bstrElementNameCreate, _In_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement)
{
assert(pDoc);
assert(pXmlParent);
assert(ppXmlElement);
DWORD dwResult;
HRESULT hr;
return
(dwResult = select_element(pXmlParent, bstrElementNameSelect, ppXmlElement)) == ERROR_SUCCESS ? ERROR_SUCCESS :
(dwResult = create_element(pDoc, bstrElementNameCreate, bstrNamespace, ppXmlElement)) == ERROR_SUCCESS ?
SUCCEEDED(hr = pXmlParent->appendChild(*ppXmlElement, NULL)) ? ERROR_SUCCESS : HRESULT_CODE(hr) : dwResult;
}
inline bool has_parent(_In_ IXMLDOMNode *pXmlNode)
{
assert(pXmlNode);
winstd::com_obj<IXMLDOMNode> pXmlNodeParent;
return SUCCEEDED(pXmlNode->get_parentNode(&pXmlNodeParent)) && pXmlNodeParent;
}
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ BSTR *pbstrValue)
{
assert(pbstrValue);
DWORD dwResult;
HRESULT hr;
winstd::com_obj<IXMLDOMElement> pXmlElement;
return
(dwResult = select_element(pXmlParent, bstrElementName, &pXmlElement)) == ERROR_SUCCESS ?
SUCCEEDED(hr = pXmlElement->get_text(pbstrValue)) ?
*pbstrValue ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr) : dwResult;
}
template<class _Traits, class _Ax>
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue)
{
winstd::bstr bstr;
DWORD dwResult = get_element_value(pXmlParent, bstrElementName, &bstr);
if (dwResult == ERROR_SUCCESS)
sValue.assign(bstr, bstr.length());
return dwResult;
}
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ DWORD *pdwValue)
{
assert(pdwValue);
winstd::bstr bstr;
DWORD dwResult = get_element_value(pXmlParent, bstrElementName, &bstr);
if (dwResult == ERROR_SUCCESS)
*pdwValue = wcstoul(bstr, NULL, 10);
return dwResult;
}
inline DWORD get_element_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ bool *pbValue)
{
assert(pbValue);
winstd::bstr bstr;
DWORD dwResult = get_element_value(pXmlParent, bstrElementName, &bstr);
if (dwResult == ERROR_SUCCESS) {
if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"true" , -1, NULL, NULL, 0) == CSTR_EQUAL ||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"1" , -1, NULL, NULL, 0) == CSTR_EQUAL)
*pbValue = true;
else if (
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"false", -1, NULL, NULL, 0) == CSTR_EQUAL ||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"0" , -1, NULL, NULL, 0) == CSTR_EQUAL)
*pbValue = false;
else
dwResult = ERROR_INVALID_DATA;
}
return dwResult;
}
template<class _Ty, class _Ax>
inline DWORD get_element_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue)
{
winstd::bstr bstr;
DWORD dwResult = get_element_value(pXmlParent, bstrElementName, &bstr);
if (dwResult == ERROR_SUCCESS) {
winstd::base64_dec dec;
bool is_last;
dec.decode(aValue, is_last, (BSTR)bstr, bstr.length());
}
return dwResult;
}
template<class _Ty, class _Ax>
inline DWORD get_element_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _Out_ std::vector<_Ty, _Ax> &aValue)
{
winstd::bstr bstr;
DWORD dwResult = get_element_value(pXmlParent, bstrElementName, &bstr);
if (dwResult == ERROR_SUCCESS) {
winstd::hex_dec dec;
bool is_last;
dec.decode(aValue, is_last, (BSTR)bstr, bstr.length());
}
return dwResult;
}
inline DWORD get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ BSTR *pbstrValue)
{
assert(pbstrValue);
HRESULT hr;
winstd::com_obj<IXMLDOMElement> pXmlElement;
DWORD dwResult = select_element(pXmlParent, bstrElementName, &pXmlElement);
if (dwResult != ERROR_SUCCESS)
return dwResult;
winstd::com_obj<IXMLDOMNodeList> pXmlListLocalizedText;
long lCount = 0;
if (select_nodes(pXmlElement, winstd::bstr(L"eap-metadata:localized-text"), &pXmlListLocalizedText) != ERROR_SUCCESS ||
FAILED(pXmlListLocalizedText->get_length(&lCount)) ||
lCount <= 0)
{
return
SUCCEEDED(hr = pXmlElement->get_text(pbstrValue)) ?
*pbstrValue ? ERROR_SUCCESS : ERROR_NO_DATA : HRESULT_CODE(hr);
}
winstd::bstr bstrDefault, bstrEn;
for (long i = 0; ; i++) {
if (i >= lCount) {
if (bstrDefault != NULL) {
// Return "C" localization.
*pbstrValue = bstrDefault.detach();
return ERROR_SUCCESS;
} else if (bstrEn != NULL) {
// Return "en" localization.
*pbstrValue = bstrEn.detach();
return ERROR_SUCCESS;
} else
return ERROR_NOT_FOUND;
}
winstd::com_obj<IXMLDOMNode> pXmlElLocalizedText;
pXmlListLocalizedText->get_item(i, &pXmlElLocalizedText);
{
// Read <lang>.
winstd::bstr bstrLang;
if (get_element_value(pXmlElLocalizedText, winstd::bstr(L"eap-metadata:lang"), &bstrLang) != ERROR_SUCCESS ||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrLang, bstrLang.length(), L"C" , -1, NULL, NULL, 0) == CSTR_EQUAL)
{
// <lang> is missing or "C" language found.
winstd::bstr bstr;
if ((dwResult = get_element_value(pXmlElLocalizedText, winstd::bstr(L"eap-metadata:text"), &bstr)) == ERROR_SUCCESS)
bstrDefault.attach(bstr.detach());
} else if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrLang, bstrLang.length(), pszLang, -1, NULL, NULL, 0) == CSTR_EQUAL) {
// Found an exact match.
return get_element_value(pXmlElLocalizedText, winstd::bstr(L"eap-metadata:text"), pbstrValue);
} else if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrLang, bstrLang.length(), L"en", -1, NULL, NULL, 0) == CSTR_EQUAL) {
// "en" language found.
winstd::bstr bstr;
if ((dwResult = get_element_value(pXmlElLocalizedText, winstd::bstr(L"eap-metadata:text"), &bstr)) == ERROR_SUCCESS)
bstrEn.attach(bstr.detach());
}
}
}
}
template<class _Traits, class _Ax>
inline DWORD get_element_localized(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrElementName, _In_z_ LPCWSTR pszLang, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue)
{
winstd::bstr bstr;
DWORD dwResult = get_element_localized(pXmlParent, bstrElementName, pszLang, &bstr);
if (dwResult == ERROR_SUCCESS)
sValue.assign(bstr, bstr.length());
return dwResult;
}
inline DWORD put_element(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _Out_ IXMLDOMElement **ppXmlElement)
{
assert(pDoc);
assert(pCurrentDOMNode);
assert(ppXmlElement);
static const VARIANT varNodeTypeEl = { VT_I4, 0, 0, 0, { NODE_ELEMENT } };
HRESULT hr;
winstd::com_obj<IXMLDOMNode> pXmlEl;
return
SUCCEEDED(hr = pDoc->createNode(varNodeTypeEl, bstrElementName, bstrNamespace, &pXmlEl)) &&
SUCCEEDED(hr = pCurrentDOMNode->appendChild(pXmlEl, NULL)) &&
SUCCEEDED(hr = pXmlEl.query_interface(ppXmlElement)) ? ERROR_SUCCESS : HRESULT_CODE(hr);
}
inline DWORD 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)
{
assert(pDoc);
static const VARIANT varNodeTypeEl = { VT_I4, 0, 0, 0, { NODE_ELEMENT } };
HRESULT hr;
winstd::com_obj<IXMLDOMNode> pXmlEl;
winstd::com_obj<IXMLDOMText> pXmlElText;
return
SUCCEEDED(hr = pDoc->createNode(varNodeTypeEl, bstrElementName, bstrNamespace, &pXmlEl)) &&
SUCCEEDED(hr = pDoc->createTextNode(bstrValue, &pXmlElText)) &&
SUCCEEDED(hr = pXmlEl->appendChild(pXmlElText, NULL)) &&
SUCCEEDED(hr = pCurrentDOMNode->appendChild(pXmlEl, NULL)) ? ERROR_SUCCESS : HRESULT_CODE(hr);
}
inline DWORD put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ DWORD dwValue)
{
return put_element_value(pDoc, pCurrentDOMNode, bstrElementName, bstrNamespace, winstd::bstr(winstd::wstring_printf(L"%d", dwValue)));
}
inline DWORD put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ bool bValue)
{
return put_element_value(pDoc, pCurrentDOMNode, bstrElementName, bstrNamespace, winstd::bstr(bValue ? L"true": L"false"));
}
inline DWORD 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)
{
std::wstring sBase64;
winstd::base64_enc enc;
enc.encode(sBase64, pValue, nValueLen);
return put_element_value(pDoc, pCurrentDOMNode, bstrElementName, bstrNamespace, winstd::bstr(sBase64));
}
inline DWORD 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)
{
std::wstring sHex;
winstd::hex_enc enc;
enc.encode(sHex, pValue, nValueLen);
return put_element_value(pDoc, pCurrentDOMNode, bstrElementName, bstrNamespace, winstd::bstr(sHex));
}
}

View File

@@ -1,444 +0,0 @@
/*
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 "EAP.h"
#include "../res/wxEAP_UI.h"
#include <WinStd/Cred.h>
#include <wx/dialog.h>
#include <wx/icon.h>
#include <wx/log.h>
#include <CommCtrl.h>
namespace eap
{
template <class _Tmeth, class _Tid, class _Tint, class _Tintres> class peer_ui;
}
template <class _Tcfg, class _wxT> class wxEAPConfigDialog;
class wxEAPCredentialsDialog;
class wxEAPBannerPanel;
template <class _Tcfg, class _Tcred, class _Tpanel> class wxEAPCredentialsConfigPanel;
template <class _Tbase, class _Tcred> class wxCredentialsPanel;
class wxPasswordCredentialsPanel;
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName);
#pragma once
namespace eap
{
///
/// EAP UI peer base abstract class template
///
/// A group of methods all EAP UI peers must or should implement.
///
template <class _Tcfg, class _Tid, class _Tint, class _Tintres>
class peer_ui : public peer_base<_Tcfg, _Tid, _Tint, _Tintres>
{
public:
///
/// Constructor
///
peer_ui() : peer_base<_Tcfg, _Tid, _Tint, _Tintres>() {}
///
/// Raises the EAP method's specific connection configuration user interface dialog on the client.
///
/// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx)
///
/// \param[in] hwndParent Parent window
/// \param[inout] cfg Configuration to edit
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_config_ui(
_In_ HWND hwndParent,
_Inout_ config_type &cfg,
_Out_ EAP_ERROR **ppEapError) = 0;
///
/// 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)
///
/// \param[in] hwndParent Parent window
/// \param[in] dwFlags Flags passed to `EapPeerInvokeIdentityUI()` call
/// \param[inout] cfg Configuration
/// \param[inout] usr User data to edit
/// \param[out] ppwszIdentity Pointer to user identity. Free using `module::free_memory()`.
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_identity_ui(
_In_ HWND hwndParent,
_In_ DWORD dwFlags,
_Inout_ config_type &cfg,
_Inout_ identity_type &usr,
_Out_ LPWSTR *ppwszIdentity,
_Out_ EAP_ERROR **ppEapError) = 0;
///
/// 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)
///
/// \param[in] hwndParent Parent window
/// \param[in] req Interactive request
/// \param[out] res Interactive response
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_interactive_ui(
_In_ HWND hwndParent,
_In_ const interactive_request_type &req,
_Out_ interactive_response_type &res,
_Out_ EAP_ERROR **ppEapError) = 0;
};
}
///
/// EAP configuration dialog
///
template <class _Tmeth, class _wxT>
class wxEAPConfigDialog : public wxEAPConfigDialogBase
{
public:
///
/// Configuration provider data type
///
typedef eap::config_provider<_Tmeth> _Tprov;
///
/// Configuration data type
///
typedef eap::config_providers<_Tprov> config_type;
///
/// This data type
///
typedef wxEAPConfigDialog<_Tmeth, _wxT> _T;
public:
///
/// Constructs a configuration dialog
///
wxEAPConfigDialog(config_type &cfg, wxWindow* parent) :
m_cfg(cfg),
wxEAPConfigDialogBase(parent)
{
// Set extra style here, as wxFormBuilder overrides all default flags.
this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
for (std::list<_Tprov>::iterator provider = m_cfg.m_providers.begin(), provider_end = m_cfg.m_providers.end(); provider != provider_end; ++provider) {
bool is_single = provider->m_methods.size() == 1;
std::list<_Tmeth>::size_type count = 0;
std::list<_Tmeth>::iterator method = provider->m_methods.begin(), method_end = provider->m_methods.end();
for (; method != method_end; ++method, count++)
m_providers->AddPage(
new _wxT(
provider->m_methods.front(),
provider->m_id.c_str(),
m_providers),
is_single ? provider->m_id : winstd::tstring_printf(_T("%s (%u)"), provider->m_id.c_str(), count));
}
this->Layout();
this->GetSizer()->Fit(this);
m_buttonsOK->SetDefault();
}
protected:
/// \cond internal
virtual void OnInitDialog(wxInitDialogEvent& event)
{
// Forward the event to child panels.
for (wxWindowList::compatibility_iterator provider = m_providers->GetChildren().GetFirst(); provider; provider = provider->GetNext()) {
_wxT *prov = wxDynamicCast(provider->GetData(), _wxT);
if (prov)
prov->GetEventHandler()->ProcessEvent(event);
}
}
/// \endcond
protected:
config_type &m_cfg; ///< EAP providers configuration
};
///
/// EAP credentials dialog
///
class wxEAPCredentialsDialog : public wxEAPCredentialsDialogBase
{
public:
///
/// Constructs a credential dialog
///
wxEAPCredentialsDialog(wxWindow* parent);
///
/// Adds panels to the dialog
///
void AddContents(wxPanel **contents, size_t content_count);
protected:
/// \cond internal
virtual void OnInitDialog(wxInitDialogEvent& event);
/// \endcond
};
///
/// EAP dialog banner
///
class wxEAPBannerPanel : public wxEAPBannerPanelBase
{
public:
///
/// Constructs a banner pannel and set the title text to product name
///
wxEAPBannerPanel(wxWindow* parent);
protected:
/// \cond internal
virtual bool AcceptsFocusFromKeyboard() const { return false; }
/// \endcond
};
///
/// Base template for credentials configuration panel
///
template <class _Tcfg, class _Tcred, class _Tpanel>
class wxEAPCredentialsConfigPanel : public wxEAPCredentialsConfigPanelBase
{
public:
///
/// Constructs a credential configuration panel
///
/// \param[inout] cfg Configuration data
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
/// \param[in] parent Parent window
///
wxEAPCredentialsConfigPanel(_Tcfg &cfg, LPCTSTR pszCredTarget, wxWindow *parent) :
m_cfg(cfg),
m_target(pszCredTarget),
m_cred(m_cfg.m_module),
wxEAPCredentialsConfigPanelBase(parent)
{
// Load and set icon.
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
wxSetIconFromResource(m_credentials_icon, m_icon, m_shell32, MAKEINTRESOURCE(48));
}
protected:
/// \cond internal
virtual void OnUpdateUI(wxUpdateUIEvent& event)
{
UNREFERENCED_PARAMETER(event);
DWORD dwResult;
std::unique_ptr<CREDENTIAL, winstd::CredFree_delete<CREDENTIAL> > cred;
if (CredRead(m_cred.target_name(m_target.c_str()).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
m_clear->Enable(true);
m_identity->SetValue(cred->UserName && cred->UserName[0] != 0 ? cred->UserName : _("<blank>"));
} else if ((dwResult = GetLastError()) == ERROR_NOT_FOUND) {
m_clear->Enable(false);
m_identity->Clear();
} else {
m_clear->Enable(true);
m_identity->SetValue(wxString::Format(_("<error %u>"), dwResult));
}
}
virtual void OnSet(wxCommandEvent& event)
{
UNREFERENCED_PARAMETER(event);
wxEAPCredentialsDialog dlg(this);
_Tpanel *panel = new _Tpanel(m_cred, m_target.c_str(), &dlg, true);
dlg.AddContents((wxPanel**)&panel, 1);
dlg.ShowModal();
}
virtual void OnClear(wxCommandEvent& event)
{
UNREFERENCED_PARAMETER(event);
if (!CredDelete(m_cred.target_name(m_target.c_str()).c_str(), CRED_TYPE_GENERIC, 0))
wxLogError(_("Deleting credentials failed (error %u)."), GetLastError());
}
/// \endcond
protected:
_Tcfg &m_cfg; ///< EAP configuration
winstd::library m_shell32; ///< shell32.dll resource library reference
wxIcon m_icon; ///< Panel icon
winstd::tstring m_target; ///< Credential Manager target
private:
_Tcred m_cred; ///< Temporary credential data
};
///
/// Base template for all credential panels
///
template <class _Tbase, class _Tcred>
class wxCredentialsPanel : public _Tbase
{
public:
///
/// Constructs a credentials panel
///
/// \param[inout] cred Credentials data
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
/// \param[in] parent Parent window
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
///
wxCredentialsPanel(_Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
m_cred(cred),
m_target(pszCredTarget),
_Tbase(parent)
{
if (is_config) {
// User is setting credentials via configuration UI.
// => Pointless if not stored to Credential Manager
m_remember->SetValue(true);
m_remember->Enable(false);
}
}
protected:
/// \cond internal
virtual bool TransferDataToWindow()
{
wxCHECK(_Tbase::TransferDataToWindow(), false);
// Read credentials from Credential Manager
EAP_ERROR *pEapError;
DWORD dwResult;
if ((dwResult = m_cred.retrieve(m_target.c_str(), &pEapError)) == ERROR_SUCCESS) {
m_remember->SetValue(true);
} else if (dwResult != ERROR_NOT_FOUND) {
if (pEapError) {
wxLogError(winstd::tstring_printf(_("Error reading credentials from Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
m_cred.m_module.free_error_memory(pEapError);
} else
wxLogError(_("Reading credentials failed (error %u)."), dwResult);
}
return true;
}
virtual bool TransferDataFromWindow()
{
// Write credentials to credential manager.
if (m_remember->GetValue()) {
EAP_ERROR *pEapError;
DWORD dwResult;
if ((dwResult = m_cred.store(m_target.c_str(), &pEapError)) != ERROR_SUCCESS) {
if (pEapError) {
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
m_cred.m_module.free_error_memory(pEapError);
} else
wxLogError(_("Writing credentials failed (error %u)."), dwResult);
}
}
return _Tbase::TransferDataFromWindow();
}
/// \endcond
protected:
_Tcred &m_cred; ///< Password credentials
winstd::tstring m_target; ///< Credential Manager target
};
///
/// Password credentials panel
///
class wxPasswordCredentialsPanel : public wxCredentialsPanel<wxPasswordCredentialsPanelBase, eap::credentials_pass>
{
public:
///
/// Constructs a password credentials panel
///
/// \param[inout] cred Credentials data
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
/// \param[in] parent Parent window
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
///
wxPasswordCredentialsPanel(eap::credentials_pass &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false);
protected:
/// \cond internal
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
/// \endcond
protected:
winstd::library m_shell32; ///< shell32.dll resource library reference
wxIcon m_icon; ///< Panel icon
private:
static const wxStringCharType *s_dummy_password;
};
///
/// Sets icon from resource
///
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName)
{
wxASSERT(bmp);
HICON hIcon;
if (SUCCEEDED(LoadIconWithScaleDown(hinst, pszName, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), &hIcon))) {
icon.CreateFromHICON(hIcon);
bmp->SetIcon(icon);
return true;
} else
return false;
}

View File

@@ -1,205 +0,0 @@
/*
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 "EAP.h"
namespace eap
{
class config_pap;
class credentials_pap;
}
namespace eapserial
{
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_pap &val);
inline size_t get_pk_size(const eap::config_pap &val);
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_pap &val);
}
#pragma once
namespace eap
{
///
/// PAP configuration
///
class config_pap : public config_pass
{
public:
///
/// Constructs configuration
///
/// \param[in] mod Reference of the EAP module to use for global services
///
config_pap(_In_ module &mod);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
config_pap(_In_ const config_pap &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
config_pap(_Inout_ config_pap &&other);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
/// \returns Reference to this object
///
config_pap& operator=(_In_ const config_pap &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
config_pap& operator=(_Inout_ config_pap &&other);
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const { return new config_pap(*this); }
///
/// Returns EAP method type of this configuration
///
/// \returns `eap::type_pap`
///
virtual eap::type_t get_method_id() { return eap::type_pap; }
};
///
/// PAP credentials
///
class credentials_pap : public credentials_pass
{
public:
///
/// Constructs credentials
///
/// \param[in] mod Reference of the EAP module to use for global services
///
credentials_pap(_In_ module &mod);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
credentials_pap(_In_ const credentials_pap &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
credentials_pap(_Inout_ credentials_pap &&other);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
credentials_pap& operator=(_In_ const credentials_pap &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
/// \returns Reference to this object
///
credentials_pap& operator=(_Inout_ credentials_pap &&other);
///
/// Clones credentials
///
/// \returns Pointer to cloned credentials
///
virtual config* clone() const { return new credentials_pap(*this); }
/// \name Storage
/// @{
///
/// Return target suffix for Windows Credential Manager credential name
///
virtual LPCTSTR target_suffix() const { return _T("PAP"); }
/// @}
};
}
namespace eapserial
{
///
/// Packs a PAP based method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Configuration to pack
///
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_pap &val)
{
pack(cursor, (const eap::config_pass&)val);
}
///
/// Returns packed size of a PAP based method configuration
///
/// \param[in] val Configuration to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t get_pk_size(const eap::config_pap &val)
{
return get_pk_size((const eap::config_pass&)val);
}
///
/// Unpacks a PAP based method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Configuration to unpack to
///
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_pap &val)
{
unpack(cursor, (eap::config_pass&)val);
}
}

View File

@@ -1,352 +0,0 @@
/*
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 "EAP.h"
#include "EAPSerial.h"
namespace eap
{
class config_tls;
class credentials_tls;
}
namespace eapserial
{
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_tls &val);
inline size_t get_pk_size(const eap::config_tls &val);
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_tls &val);
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::credentials_tls &val);
inline size_t get_pk_size(const eap::credentials_tls &val);
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::credentials_tls &val);
}
#pragma once
namespace eap
{
///
/// TLS configuration
///
class config_tls : public config_method
{
public:
///
/// Constructs configuration
///
/// \param[in] mod Reference of the EAP module to use for global services
///
config_tls(_In_ module &mod);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
config_tls(_In_ const config_tls &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
config_tls(_Inout_ config_tls &&other);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
/// \returns Reference to this object
///
config_tls& operator=(_In_ const config_tls &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
config_tls& operator=(_Inout_ config_tls &&other);
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const { return new config_tls(*this); }
/// \name XML configuration management
/// @{
///
/// Save configuration to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving configuration
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const;
///
/// Load configuration from XML document
///
/// \param[in] pConfigRoot Root element for loading configuration
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError);
/// @}
///
/// Returns EAP method type of this configuration
///
/// \returns `eap::type_tls`
///
virtual eap::type_t get_method_id() { return eap::type_tls; }
///
/// Adds CA to the list of trusted root CA's
///
/// \sa [CertCreateCertificateContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa376033.aspx)
///
bool add_trusted_ca(_In_ DWORD dwCertEncodingType, _In_ const BYTE *pbCertEncoded, _In_ DWORD cbCertEncoded);
public:
std::list<winstd::cert_context> m_trusted_root_ca; ///< Trusted root CAs
std::list<std::string> m_server_names; ///< Acceptable authenticating server names
};
///
/// TLS credentials
///
class credentials_tls : public credentials
{
public:
///
/// Constructs credentials
///
/// \param[in] mod Reference of the EAP module to use for global services
///
credentials_tls(_In_ module &mod);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
credentials_tls(_In_ const credentials_tls &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
credentials_tls(_Inout_ credentials_tls &&other);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
credentials_tls& operator=(_In_ const credentials_tls &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
/// \returns Reference to this object
///
credentials_tls& operator=(_Inout_ credentials_tls &&other);
///
/// Clones credentials
///
/// \returns Pointer to cloned credentials
///
virtual config* clone() const { return new credentials_tls(*this); }
///
/// Resets credentials
///
virtual void clear();
///
/// Test credentials if blank
///
virtual bool empty() const;
/// \name XML credentials management
/// @{
///
/// Load credentials from XML document
///
/// \param[in] pConfigRoot Root element for loading credentials
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError);
/// @}
/// \name Storage
/// @{
///
/// Save credentials to Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to store credentials as
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError) const;
///
/// Retrieve credentials from Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError);
///
/// Return target suffix for Windows Credential Manager credential name
///
virtual LPCTSTR target_suffix() const { return _T("TLS"); }
/// @}
public:
std::vector<unsigned char> m_cert_hash; ///< Client certificate hash (certificates are kept in Personal Certificate Storage)
};
}
namespace eapserial
{
///
/// Packs a TLS method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Configuration to pack
///
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_tls &val)
{
pack(cursor, (const eap::config_method&)val);
pack(cursor, val.m_trusted_root_ca );
pack(cursor, val.m_server_names );
}
///
/// Returns packed size of a TLS method configuration
///
/// \param[in] val Configuration to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t get_pk_size(const eap::config_tls &val)
{
return
get_pk_size((const eap::config_method&)val) +
get_pk_size(val.m_trusted_root_ca ) +
get_pk_size(val.m_server_names );
}
///
/// Unpacks a TLS method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Configuration to unpack to
///
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_tls &val)
{
unpack(cursor, (eap::config_method&)val );
unpack(cursor, val.m_trusted_root_ca);
unpack(cursor, val.m_server_names );
}
///
/// Packs a TLS method credentials
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Credentials to pack
///
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::credentials_tls &val)
{
pack(cursor, (const eap::credentials&)val);
pack(cursor, val.m_cert_hash );
}
///
/// Returns packed size of a TLS method credentials
///
/// \param[in] val Credentials to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t get_pk_size(const eap::credentials_tls &val)
{
return
get_pk_size((const eap::credentials&)val) +
get_pk_size(val.m_cert_hash );
}
///
/// Unpacks a TLS method credentials
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Credentials to unpack to
///
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::credentials_tls &val)
{
unpack(cursor, (eap::credentials&)val);
unpack(cursor, val.m_cert_hash );
}
}

View File

@@ -1,405 +0,0 @@
/*
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 "EAP.h"
#include "EAPSerial.h"
#include "TLS.h"
#include "PAP.h"
#include <WinStd/Crypt.h>
namespace eap
{
class config_ttls;
class credentials_ttls;
class session_ttls;
class peer_ttls;
}
namespace eapserial
{
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_ttls &val);
inline size_t get_pk_size(const eap::config_ttls &val);
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_ttls &val);
}
#pragma once
namespace eap
{
///
/// TTLS configuration
///
class config_ttls : public config_tls
{
public:
///
/// Constructs configuration
///
/// \param[in] mod Reference of the EAP module to use for global services
///
config_ttls(_In_ module &mod);
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
config_ttls(const _In_ config_ttls &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
config_ttls(_Inout_ config_ttls &&other);
///
/// Destructs configuration
///
virtual ~config_ttls();
///
/// Copies configuration
///
/// \param[in] other Configuration to copy from
///
/// \returns Reference to this object
///
config_ttls& operator=(const _In_ config_ttls &other);
///
/// Moves configuration
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
config_ttls& operator=(_Inout_ config_ttls &&other);
///
/// Clones configuration
///
/// \returns Pointer to cloned configuration
///
virtual config* clone() const { return new config_ttls(*this); }
/// \name XML configuration management
/// @{
///
/// Save configuration to XML document
///
/// \param[in] pDoc XML document
/// \param[in] pConfigRoot Suggested root element for saving configuration
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const;
///
/// Load configuration from XML document
///
/// \param[in] pConfigRoot Root element for loading configuration
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError);
/// @}
///
/// Returns EAP method type of this configuration
///
/// \returns `eap::type_ttls`
///
virtual eap::type_t get_method_id() { return eap::type_ttls; }
public:
config_method *m_inner; ///< Inner authentication configuration
};
///
/// TTLS credentials
///
class credentials_ttls : public credentials_tls
{
public:
///
/// Constructs credentials
///
/// \param[in] mod Reference of the EAP module to use for global services
///
credentials_ttls(_In_ module &mod);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
credentials_ttls(_In_ const credentials_ttls &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
credentials_ttls(_Inout_ credentials_ttls &&other);
///
/// Copies credentials
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
credentials_ttls& operator=(_In_ const credentials_ttls &other);
///
/// Moves credentials
///
/// \param[in] other Credentials to move from
///
/// \returns Reference to this object
///
credentials_ttls& operator=(_Inout_ credentials_ttls &&other);
///
/// Clones credentials
///
/// \returns Pointer to cloned credentials
///
virtual config* clone() const { return new credentials_ttls(*this); }
///
/// Resets credentials
///
virtual void clear();
///
/// Test credentials if blank
///
virtual bool empty() const;
/// \name XML credentials management
/// @{
///
/// Load credentials from XML document
///
/// \param[in] pConfigRoot Root element for loading credentials
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError);
/// @}
/// \name Storage
/// @{
///
/// Save credentials to Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to store credentials as
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError) const;
///
/// Retrieve credentials from Windows Credential Manager
///
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError);
/// @}
public:
credentials *m_inner; ///< Inner credentials
};
///
/// TTLS session
///
class session_ttls : public session
{
public:
///
/// Constructor
///
session_ttls();
};
///
/// TTLS peer
///
class peer_ttls : public peer<eap::config_ttls, eap::credentials_ttls, int, int>
{
public:
///
/// Constructor
///
peer_ttls();
///
/// Initializes an EAP peer method for EAPHost.
///
/// \sa [EapPeerGetInfo function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363613.aspx)
///
virtual DWORD initialize(_Out_ EAP_ERROR **ppEapError);
///
/// Shuts down the EAP method and prepares to unload its corresponding DLL.
///
/// \sa [EapPeerShutdown function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363627.aspx)
///
virtual DWORD shutdown(_Out_ EAP_ERROR **ppEapError);
///
/// Returns the user data and user identity after being called by EAPHost.
///
/// \sa [EapPeerGetIdentity function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363607.aspx)
///
virtual DWORD get_identity(
_In_ DWORD dwFlags,
_In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ HANDLE hTokenImpersonateUser,
_Out_ BOOL *pfInvokeUI,
_Out_ DWORD *pdwUserDataOutSize,
_Out_ BYTE **ppUserDataOut,
_Out_ WCHAR **ppwszIdentity,
_Out_ EAP_ERROR **ppEapError);
///
/// 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)
///
virtual DWORD get_method_properties(
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ HANDLE hUserImpersonationToken,
_In_ DWORD dwEapConnDataSize,
_In_count_(dwEapConnDataSize) const BYTE *pEapConnData,
_In_ DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData,
_Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray,
_Out_ EAP_ERROR **ppEapError) const;
};
}
namespace eapserial
{
///
/// Packs a TTLS based method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[in] val Configuration to pack
///
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_ttls &val)
{
pack(cursor, (const eap::config_tls&)val);
if (val.m_inner) {
if (dynamic_cast<eap::config_pap*>(val.m_inner)) {
pack(cursor, (unsigned char)eap::type_pap);
pack(cursor, (const eap::config_pap&)*val.m_inner);
} else {
assert(0); // Unsupported inner authentication method type.
pack(cursor, (unsigned char)0);
}
} else
pack(cursor, (unsigned char)0);
}
///
/// Returns packed size of a TTLS based method configuration
///
/// \param[in] val Configuration to pack
///
/// \returns Size of data when packed (in bytes)
///
inline size_t get_pk_size(const eap::config_ttls &val)
{
size_t size_inner = sizeof(unsigned char);
if (val.m_inner) {
if (dynamic_cast<eap::config_pap*>(val.m_inner))
size_inner += get_pk_size((const eap::config_pap&)*val.m_inner);
else
assert(0); // Unsupported inner authentication method type.
}
return
get_pk_size((const eap::config_tls&)val) +
size_inner;
}
///
/// Unpacks a TTLS based method configuration
///
/// \param[inout] cursor Memory cursor
/// \param[out] val Configuration to unpack to
///
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_ttls &val)
{
unpack(cursor, (eap::config_tls&)val);
assert(!val.m_inner);
unsigned char eap_type;
unpack(cursor, eap_type);
switch (eap_type) {
case eap::type_pap:
val.m_inner = new eap::config_pap(val.m_module);
unpack(cursor, (eap::config_pap&)*val.m_inner);
break;
case 0 : break;
default : assert(0); // Unsupported inner authentication method type.
}
}
}

View File

@@ -1,181 +0,0 @@
/*
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 "TTLS.h"
#include "EAP_UI.h"
#include "../res/wxEAP_UI.h"
#include "../res/wxTTLS_UI.h"
#include "../res/wxTLS_UI.h"
namespace eap
{
class peer_ttls_ui;
}
class wxEAPTTLSConfigPanel;
class wxEAPTTLSConfig;
#pragma once
#include <wx/icon.h>
#include <wx/scrolwin.h>
#include <wx/choicebk.h>
namespace eap
{
///
/// TTLS UI peer
///
class peer_ttls_ui : public peer_ui<eap::config_ttls, eap::credentials_ttls, int, int>
{
public:
///
/// Constructor
///
peer_ttls_ui();
///
/// Raises the EAP method's specific connection configuration user interface dialog on the client.
///
/// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx)
///
/// \param[in] hwndParent Parent window
/// \param[inout] cfg Configuration to edit
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_config_ui(
_In_ HWND hwndParent,
_Inout_ config_type &cfg,
_Out_ EAP_ERROR **ppEapError);
///
/// 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)
///
/// \param[in] hwndParent Parent window
/// \param[in] dwFlags Flags passed to `EapPeerInvokeIdentityUI()` call
/// \param[inout] cfg Configuration
/// \param[inout] usr User data to edit
/// \param[out] ppwszIdentity Pointer to user identity. Free using `module::free_memory()`.
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_identity_ui(
_In_ HWND hwndParent,
_In_ DWORD dwFlags,
_Inout_ config_type &cfg,
_Inout_ identity_type &usr,
_Out_ LPWSTR *ppwszIdentity,
_Out_ EAP_ERROR **ppEapError);
///
/// 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)
///
/// \param[in] hwndParent Parent window
/// \param[in] req Interactive request
/// \param[out] res Interactive response
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
///
virtual DWORD invoke_interactive_ui(
_In_ HWND hwndParent,
_In_ const interactive_request_type &req,
_Out_ interactive_response_type &res,
_Out_ EAP_ERROR **ppEapError);
};
}
///
/// EAPTTLS configuration panel
///
class wxEAPTTLSConfigPanel : public wxEAPTTLSConfigPanelBase
{
public:
///
/// Constructs a configuration panel
///
wxEAPTTLSConfigPanel(eap::config_ttls &cfg, wxWindow* parent);
protected:
/// \cond internal
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
virtual void OnOuterIdentityCustom(wxCommandEvent& event);
/// \endcond
protected:
eap::config_ttls &m_cfg; ///< TLS configuration
winstd::library m_shell32; ///< shell32.dll resource library reference
wxIcon m_icon; ///< Panel icon
};
///
/// EAPTTLS configuration
///
class wxEAPTTLSConfig : public wxScrolledWindow
{
public:
///
/// Constructs a configuration panel
///
/// \param[inout] cfg Configuration data
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
/// \param[in] parent Parent window
///
wxEAPTTLSConfig(eap::config_ttls &cfg, LPCTSTR pszCredTarget, wxWindow* parent);
///
/// Destructs the configuration panel
///
virtual ~wxEAPTTLSConfig();
protected:
/// \cond internal
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
virtual void OnInitDialog(wxInitDialogEvent& event);
/// \endcond
protected:
eap::config_ttls &m_cfg; ///< TTLS configuration
wxStaticText *m_outer_title; ///< Outer authentication title
wxEAPTTLSConfigPanel *m_outer_identity; ///< Outer identity configuration panel
wxEAPTLSConfigPanel *m_tls; ///< TLS configuration panel
wxStaticText *m_inner_title; ///< Inner authentication title
wxChoicebook *m_inner_type; ///< Inner authentication type
eap::config_pap m_cfg_pap; ///< Temporary PAP configuration
};

1
EAPMethods/locale/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/*.mo

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: EAPMethods\n"
"POT-Creation-Date: 2016-06-09 15:19+0200\n"
"POT-Creation-Date: 2016-08-25 10:43+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
@@ -10,295 +10,471 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: res\n"
"X-Poedit-SearchPath-1: MSIBuild\n"
"X-Poedit-SearchPath-2: src\n"
"X-Poedit-SearchPath-3: include\n"
"X-Poedit-SearchPath-0: lib/EAPBase_UI\n"
"X-Poedit-SearchPath-1: lib/PAP_UI\n"
"X-Poedit-SearchPath-2: lib/TLS_UI\n"
"X-Poedit-SearchPath-3: lib/TTLS_UI\n"
"X-Poedit-SearchPath-4: EAPMethods\n"
#: res/wxEAP_UI.cpp:123 res/wxEAP_UI.cpp:200
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:37
msgid "Advanced..."
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:38
msgid "Opens dialog with provider settings"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:174 lib/EAPBase_UI/res/wxEAP_UI.cpp:296
msgid "Client Credentials"
msgstr ""
#: res/wxEAP_UI.cpp:134
msgid "Manage your credentials stored in Windows Credential Manager."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:185
msgid "Manage credentials used to connect."
msgstr ""
#: res/wxEAP_UI.cpp:144
msgid "Identity:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:198
msgid "Use &own credentials:"
msgstr ""
#: res/wxEAP_UI.cpp:149
msgid "Enter your user name here (user@domain.org, DOMAINUser, etc.)"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:199
msgid "Select this option if you have your unique credentials to connect"
msgstr ""
#: res/wxEAP_UI.cpp:159
msgid "&Set Credentials..."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:204
msgid "Your credentials loaded from Windows Credential Manager"
msgstr ""
#: res/wxEAP_UI.cpp:160
msgid "Click here to set or modify your credentials"
msgstr ""
#: res/wxEAP_UI.cpp:164
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:214
msgid "&Clear Credentials"
msgstr ""
#: res/wxEAP_UI.cpp:165
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:215
msgid ""
"Click to clear your credentials from Credential Manager.\n"
"Note: You will be prompted to enter credentials when connecting."
msgstr ""
#: res/wxEAP_UI.cpp:211
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:219 lib/EAPBase_UI/res/wxEAP_UI.cpp:252
msgid "&Set Credentials..."
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:220 lib/EAPBase_UI/res/wxEAP_UI.cpp:253
msgid "Click here to set or modify your credentials"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:236
msgid "Use &pre-shared credentials:"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:237
msgid "Select this options if all clients connect using the same credentials"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:242
msgid "Common (pre-shared) credentials"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:307
msgid "Please provide your user ID and password."
msgstr ""
#: res/wxEAP_UI.cpp:221
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:317
msgid "User ID:"
msgstr ""
#: res/wxEAP_UI.cpp:226
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:322
msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)"
msgstr ""
#: res/wxEAP_UI.cpp:230
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:326
msgid "Password:"
msgstr ""
#: res/wxEAP_UI.cpp:235
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:331
msgid "Enter your password here"
msgstr ""
#: res/wxEAP_UI.cpp:242 res/wxTLS_UI.cpp:164
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:338 lib/TLS_UI/res/wxTLS_UI.cpp:183
msgid "&Remember"
msgstr ""
#: res/wxEAP_UI.cpp:243
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:339
msgid "Check if you would like to save username and password"
msgstr ""
#: res/wxTLS_UI.cpp:17
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:361
msgid "Your Organization"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:372
msgid "Describe your organization to customize user prompts. When organization is introduced, end-users find program messages easier to understand and act."
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:379
msgid "Your organization &name:"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:384
msgid "Your organization name as it will appear on helpdesk contact notifications"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:388
msgid "(Keep it short, please)"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:398
msgid "Helpdesk contact &information:"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:408
msgid "¶"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:415
msgid "Your helpdesk website address"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:419
msgid "*"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:426
msgid "Your helpdesk e-mail address"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:430
msgid ")"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:437
msgid "Your helpdesk phone number"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:471
msgid "Configuration Lock"
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:482
msgid "Your configuration can be locked to prevent accidental modification by end-users. Users will only be allowed to enter credentials."
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:489
msgid "&Lock this configuration and prevent any further modification via user interface."
msgstr ""
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:492
msgid "(Warning: Once locked, you can not revert using this dialog!)"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:88
#, c-format
msgid "%s Credentials"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:118
#, c-format
msgid "For additional help and instructions, please contact %s at:"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:120
#, c-format
msgid "your %ls provider"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:120
msgid "your provider"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:139
msgid "Open the default web browser"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:150
msgid "Open your e-mail program"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:161
msgid "Dial the phone number"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:180
#, c-format
msgid "%s has pre-set parts of this configuration. Those parts are locked to prevent accidental modification."
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:182
#, c-format
msgid "Your %ls provider"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:182
msgid "Your provider"
msgstr ""
#: lib/EAPBase_UI/src/EAP_UI.cpp:201
msgid "Previous attempt to connect failed. Please, make sure your credentials are correct, or try again later."
msgstr ""
#: lib/TLS_UI/res/wxTLS_UI.cpp:17
msgid "Server Trust"
msgstr ""
#: res/wxTLS_UI.cpp:28
#: lib/TLS_UI/res/wxTLS_UI.cpp:28
msgid "Describe the servers you trust to prevent credential interception in case of man-in-the-middle attacks."
msgstr ""
#: res/wxTLS_UI.cpp:35
#: lib/TLS_UI/res/wxTLS_UI.cpp:35
msgid "Acceptable Certificate Authorities:"
msgstr ""
#: res/wxTLS_UI.cpp:40
#: lib/TLS_UI/res/wxTLS_UI.cpp:40
msgid "List of certificate authorities server's certificate must be issued by"
msgstr ""
#: res/wxTLS_UI.cpp:47
#: lib/TLS_UI/res/wxTLS_UI.cpp:47
msgid "Add CA from Store..."
msgstr ""
#: res/wxTLS_UI.cpp:48
#: lib/TLS_UI/res/wxTLS_UI.cpp:48
msgid "Adds a new certificate authority from the certificate store to the list"
msgstr ""
#: res/wxTLS_UI.cpp:52
#: lib/TLS_UI/res/wxTLS_UI.cpp:52
msgid "Add CA from File..."
msgstr ""
#: res/wxTLS_UI.cpp:53
#: lib/TLS_UI/res/wxTLS_UI.cpp:53
msgid "Adds a new certificate authority from the file to the list"
msgstr ""
#: res/wxTLS_UI.cpp:57
#: lib/TLS_UI/res/wxTLS_UI.cpp:57
msgid "&Remove CA"
msgstr ""
#: res/wxTLS_UI.cpp:59
#: lib/TLS_UI/res/wxTLS_UI.cpp:59
msgid "Removes selected certificate authorities from the list"
msgstr ""
#: res/wxTLS_UI.cpp:72
#: lib/TLS_UI/res/wxTLS_UI.cpp:72
msgid "Acceptable server &names:"
msgstr ""
#: res/wxTLS_UI.cpp:77
msgid "A semicolon delimited list of acceptable server FQDN names; blank to skip name check; \"*\" wildchar allowed"
#: lib/TLS_UI/res/wxTLS_UI.cpp:77
msgid "A semicolon delimited list of acceptable server FQDN names; blank to skip name check; Unicode characters allowed"
msgstr ""
#: res/wxTLS_UI.cpp:81
msgid "(Example: foo.bar.com;*.domain.org)"
#: lib/TLS_UI/res/wxTLS_UI.cpp:81
msgid "(Example: foo.bar.com;server2.bar.com)"
msgstr ""
#: res/wxTLS_UI.cpp:120
#: lib/TLS_UI/res/wxTLS_UI.cpp:120
msgid "TLS Client Certificate"
msgstr ""
#: res/wxTLS_UI.cpp:131
#: lib/TLS_UI/res/wxTLS_UI.cpp:131
msgid "Please select your client certificate to use for authentication."
msgstr ""
#: res/wxTLS_UI.cpp:138
#: lib/TLS_UI/res/wxTLS_UI.cpp:138
msgid "Co&nnect without providing a client certificate"
msgstr ""
#: res/wxTLS_UI.cpp:139
#: lib/TLS_UI/res/wxTLS_UI.cpp:139
msgid "Select if your server does not require you to provide a client certificate"
msgstr ""
#: res/wxTLS_UI.cpp:146
#: lib/TLS_UI/res/wxTLS_UI.cpp:146
msgid "Use the following &certificate:"
msgstr ""
#: res/wxTLS_UI.cpp:147
#: lib/TLS_UI/res/wxTLS_UI.cpp:147
msgid "Select if you need to provide a client certificate when connecting"
msgstr ""
#: res/wxTLS_UI.cpp:154
#: lib/TLS_UI/res/wxTLS_UI.cpp:154
msgid "Client certificate to use for authentication"
msgstr ""
#: res/wxTLS_UI.cpp:165
#: lib/TLS_UI/res/wxTLS_UI.cpp:167
msgid "Custom &identity:"
msgstr ""
#: lib/TLS_UI/res/wxTLS_UI.cpp:172
msgid "Your identity (username@domain) to override one from certificate; or blank to use one provided in certificate"
msgstr ""
#: lib/TLS_UI/res/wxTLS_UI.cpp:176
msgid "(Example: user@contoso.com)"
msgstr ""
#: lib/TLS_UI/res/wxTLS_UI.cpp:184
msgid "Check if you would like to save certificate selection"
msgstr ""
#: res/wxTTLS_UI.cpp:17
msgid "Outer Identity"
msgstr ""
#: res/wxTTLS_UI.cpp:28
msgid "Select the user ID supplicant introduces itself as to authenticator:"
msgstr ""
#: res/wxTTLS_UI.cpp:35
msgid "&Same as inner identity"
msgstr ""
#: res/wxTTLS_UI.cpp:36
msgid "Use my true user name"
msgstr ""
#: res/wxTTLS_UI.cpp:40
msgid "Use &empty outer identity (RFC 4822)"
msgstr ""
#: res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only"
msgstr ""
#: res/wxTTLS_UI.cpp:48
msgid "&Custom outer identity:"
msgstr ""
#: res/wxTTLS_UI.cpp:49
msgid "Specify custom outer identity"
msgstr ""
#: res/wxTTLS_UI.cpp:54
msgid "Custom outer identity to use"
msgstr ""
#: src/PAP_UI.cpp:41
msgid "This method requires no additional settings."
msgstr ""
#: src/TLS_UI.cpp:198
#: lib/TLS_UI/src/TLS_UI.cpp:118
#, c-format
msgid "Invalid character in host name found: %c"
msgstr ""
#: src/TLS_UI.cpp:198
#: lib/TLS_UI/src/TLS_UI.cpp:118
msgid "Validation conflict"
msgstr ""
#: src/TLS_UI.cpp:550
#: lib/TLS_UI/src/TLS_UI.cpp:514
msgid "Add Certificate"
msgstr ""
#: src/TLS_UI.cpp:551
#: lib/TLS_UI/src/TLS_UI.cpp:515
msgid "Certificate Files (*.cer;*.crt;*.der;*.p7b;*.pem)"
msgstr ""
#: src/TLS_UI.cpp:552
#: lib/TLS_UI/src/TLS_UI.cpp:516
msgid "X.509 Certificate Files (*.cer;*.crt;*.der;*.pem)"
msgstr ""
#: src/TLS_UI.cpp:553
#: lib/TLS_UI/src/TLS_UI.cpp:517
msgid "PKCS #7 Certificate Files (*.p7b)"
msgstr ""
#: src/TLS_UI.cpp:554
#: lib/TLS_UI/src/TLS_UI.cpp:518
msgid "All Files (*.*)"
msgstr ""
#: src/TLS_UI.cpp:570
#: lib/TLS_UI/src/TLS_UI.cpp:534
#, c-format
msgid "Invalid or unsupported certificate file %s"
msgstr ""
#: src/TLS_UI.cpp:570
#, fuzzy
#: lib/TLS_UI/src/TLS_UI.cpp:534
msgid "Error"
msgstr "Napaka pri nalaganju knjižnice MSI.DLL (%1!ld!)."
#: src/TTLS_UI.cpp:172
msgid "Outer Authentication"
msgstr ""
#: src/TTLS_UI.cpp:185
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:17
msgid "Outer Identity"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:28
msgid "Select the user ID supplicant introduces itself as to authenticator:"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:35
msgid "&True identity"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:36
msgid "Use my true user name"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:40
msgid "Use &empty outer identity (RFC 4822)"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:48
msgid "&Custom outer identity:"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:49
msgid "Specify custom outer identity"
msgstr ""
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:54
msgid "Custom outer identity to use"
msgstr ""
#: lib/TTLS_UI/src/Module.cpp:231 lib/TTLS_UI/src/Module.cpp:241
#: lib/EAPBase_UI/include/EAP_UI.h:582
#, c-format
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
msgstr ""
#: lib/TTLS_UI/src/Module.cpp:233 lib/TTLS_UI/src/Module.cpp:243
#: lib/EAPBase_UI/include/EAP_UI.h:584
msgid "Writing credentials failed."
msgstr ""
#: lib/TTLS_UI/src/TTLS_UI.cpp:108 lib/TTLS_UI/src/TTLS_UI.cpp:215
msgid "Inner Authentication"
msgstr ""
#: src/TTLS_UI.cpp:191
#: lib/TTLS_UI/src/TTLS_UI.cpp:114
msgid "Select inner authentication method from the list"
msgstr ""
#: src/TTLS_UI.cpp:192
#: lib/TTLS_UI/src/TTLS_UI.cpp:116
msgid "PAP"
msgstr ""
#: include/EAP_UI.h:272
#: lib/TTLS_UI/src/TTLS_UI.cpp:121 lib/TTLS_UI/src/TTLS_UI.cpp:236
msgid "Outer Authentication"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:253
msgid "EAP Credentials"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:422
msgid "Provider Settings"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:502 lib/EAPBase_UI/include/EAP_UI.h:529
msgid "<blank>"
msgstr ""
#: include/EAP_UI.h:278
#: lib/EAPBase_UI/include/EAP_UI.h:508
#, c-format
msgid "<error %u>"
msgstr ""
#: include/EAP_UI.h:301
#: lib/EAPBase_UI/include/EAP_UI.h:568
#, c-format
msgid "Error reading credentials from Credential Manager: %hs (error %u)"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:570
msgid "Reading credentials failed."
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:595
#, c-format
msgid "Deleting credentials failed (error %u)."
msgstr ""
#: include/EAP_UI.h:358
#, c-format
msgid "Error reading credentials from Credential Manager: %ls (error %u)"
#: lib/EAPBase_UI/include/EAP_UI.h:817
msgid "<Your Organization>"
msgstr ""
#: include/EAP_UI.h:361
#, c-format
msgid "Reading credentials failed (error %u)."
msgstr ""
#: include/EAP_UI.h:376
#, c-format
msgid "Error writing credentials to Credential Manager: %ls (error %u)"
msgstr ""
#: include/EAP_UI.h:379
#, c-format
msgid "Writing credentials failed (error %u)."
msgstr ""
#: res/wxEAP_UI.h:56
#: lib/EAPBase_UI/res/wxEAP_UI.h:60
msgid "EAP Method Configuration"
msgstr ""
#: res/wxEAP_UI.h:81
msgid "EAP Credentials"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:3
msgid "1252"
msgstr ""
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "EAP Methods"
msgstr ""
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "Modules to support individual EAP methods"
msgstr ""
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
msgid "TTLS"
msgstr ""
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
msgid "Tunneled Transport Layer Security"
msgstr ""

532
EAPMethods/locale/sl_SI.po Normal file
View File

@@ -0,0 +1,532 @@
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: EAPMethods\n"
"POT-Creation-Date: 2016-08-25 10:43+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl_SI\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: lib/EAPBase_UI\n"
"X-Poedit-SearchPath-1: lib/PAP_UI\n"
"X-Poedit-SearchPath-2: lib/TLS_UI\n"
"X-Poedit-SearchPath-3: lib/TTLS_UI\n"
"X-Poedit-SearchPath-4: EAPMethods\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:37
msgid "Advanced..."
msgstr "Napredno ..."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:38
msgid "Opens dialog with provider settings"
msgstr "Odpre dialog z nastavitvami ponudnika"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:174 lib/EAPBase_UI/res/wxEAP_UI.cpp:296
msgid "Client Credentials"
msgstr "Odjemalčeve poverilnice"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:185
msgid "Manage credentials used to connect."
msgstr "Upravljajte s poverilnicami za povezovanje."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:198
msgid "Use &own credentials:"
msgstr "Uporabi sv&oje poverilnice:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:199
msgid "Select this option if you have your unique credentials to connect"
msgstr "Izberite to možnost, če imate svoje lastne poverilnice za povezovanje"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:204
msgid "Your credentials loaded from Windows Credential Manager"
msgstr "Vaše poverilnice naložene iz upravitelja poverilnic Windows"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:214
msgid "&Clear Credentials"
msgstr "Počisti poverilni&ce"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:215
msgid ""
"Click to clear your credentials from Credential Manager.\n"
"Note: You will be prompted to enter credentials when connecting."
msgstr ""
"Kliknite, da počistite svoje poverilnice iz upravitelja poverilnic.\n"
"Opomba: Za vnos poverilnic boste pozvani ob povezovanju."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:219 lib/EAPBase_UI/res/wxEAP_UI.cpp:252
msgid "&Set Credentials..."
msgstr "Na&stavi poverilnice ..."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:220 lib/EAPBase_UI/res/wxEAP_UI.cpp:253
msgid "Click here to set or modify your credentials"
msgstr "Kliknite tukaj, da nastavite ali spremenite svoje poverilnice"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:236
msgid "Use &pre-shared credentials:"
msgstr "Uporabi sku&pne poverilnice:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:237
msgid "Select this options if all clients connect using the same credentials"
msgstr ""
"Izberite to možnost, kadar se vsi odjemalci povezujejo z istimi "
"poverilnicami"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:242
msgid "Common (pre-shared) credentials"
msgstr "Skupne (deljene) poverilnice"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:307
msgid "Please provide your user ID and password."
msgstr "Vnesite svoj uporabniški ID in geslo."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:317
msgid "User ID:"
msgstr "Uporabniški ID:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:322
msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)"
msgstr "Tukaj vnesite svoje up. ime (up. ime@domena.si, DOMENA\\Uporabnik ipd.)"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:326
msgid "Password:"
msgstr "Geslo:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:331
msgid "Enter your password here"
msgstr "Tukaj vnesite svoje geslo"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:338 lib/TLS_UI/res/wxTLS_UI.cpp:183
msgid "&Remember"
msgstr "Za&pomni si"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:339
msgid "Check if you would like to save username and password"
msgstr "Odkljukajte, če želite shraniti up. ime in geslo"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:361
msgid "Your Organization"
msgstr "Vaša organizacija"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:372
msgid ""
"Describe your organization to customize user prompts. When organization is "
"introduced, end-users find program messages easier to understand and act."
msgstr ""
"Opišite svojo organizacijo za up. pozive po meri. Kadar se organizacija "
"predstavi, uporabniki lažje razumejo sporočila programa in ustrezneje "
"reagirajo."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:379
msgid "Your organization &name:"
msgstr "Ime vaše orga&nizacije:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:384
msgid ""
"Your organization name as it will appear on helpdesk contact notifications"
msgstr ""
"Ime vaše organizacije, kot bo nastopalo na obvestilih s stikom na center za "
"pomoč"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:388
msgid "(Keep it short, please)"
msgstr "(Naj bo kratko, prosim)"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:398
msgid "Helpdesk contact &information:"
msgstr "Podatk&i centra za pomoč:"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:408
msgid "¶"
msgstr "¶"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:415
msgid "Your helpdesk website address"
msgstr "Naslov spletne strani vašega centra za pomoč"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:419
msgid "*"
msgstr "*"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:426
msgid "Your helpdesk e-mail address"
msgstr "E-poštni naslov vašega centra za pomoč"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:430
msgid ")"
msgstr ")"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:437
msgid "Your helpdesk phone number"
msgstr "Telefonska številka vašega centra za pomoč"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:471
msgid "Configuration Lock"
msgstr "Zaklep konfiguracije"
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:482
msgid ""
"Your configuration can be locked to prevent accidental modification by end-"
"users. Users will only be allowed to enter credentials."
msgstr ""
"Svojo konfiguracijo lahko zaklenete in preprečite končnim uporabnikom "
"nenamerno spreminjanje. Uporabniki bodo lahko vnašali samo poverilnice."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:489
msgid ""
"&Lock this configuration and prevent any further modification via user "
"interface."
msgstr ""
"Zak&leni to konfiguracijo in prepreči vse nadaljnje spremembe preko up. "
"vmesnika."
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:492
msgid "(Warning: Once locked, you can not revert using this dialog!)"
msgstr "(Pozor: Ko zaklenete, vrnitev ne bo več možna preko tega dialoga!)"
#: lib/EAPBase_UI/src/EAP_UI.cpp:88
#, c-format
msgid "%s Credentials"
msgstr "Poverilnice za %s"
#: lib/EAPBase_UI/src/EAP_UI.cpp:118
#, c-format
msgid "For additional help and instructions, please contact %s at:"
msgstr "Za dodtano pomoč ali navodila se obrnite na %s na:"
#: lib/EAPBase_UI/src/EAP_UI.cpp:120
#, c-format
msgid "your %ls provider"
msgstr "vaš ponudnik %ls"
#: lib/EAPBase_UI/src/EAP_UI.cpp:120
msgid "your provider"
msgstr "vaš ponudnik"
#: lib/EAPBase_UI/src/EAP_UI.cpp:139
msgid "Open the default web browser"
msgstr "Odpre privzeto nastavljen spletni brskalnik"
#: lib/EAPBase_UI/src/EAP_UI.cpp:150
msgid "Open your e-mail program"
msgstr "Odpre vaš program za e-pošto"
#: lib/EAPBase_UI/src/EAP_UI.cpp:161
msgid "Dial the phone number"
msgstr "Pokliče telefonsko številko"
#: lib/EAPBase_UI/src/EAP_UI.cpp:180
#, c-format
msgid ""
"%s has pre-set parts of this configuration. Those parts are locked to "
"prevent accidental modification."
msgstr ""
"%s je prednastavil dele te konfiguracije. Ti deli so zaklenjeni zaradi "
"preprečevanja nenamernih sprememb."
#: lib/EAPBase_UI/src/EAP_UI.cpp:182
#, c-format
msgid "Your %ls provider"
msgstr "Vaš ponudnik %ls"
#: lib/EAPBase_UI/src/EAP_UI.cpp:182
msgid "Your provider"
msgstr "Vaš ponudnik"
#: lib/EAPBase_UI/src/EAP_UI.cpp:201
msgid ""
"Previous attempt to connect failed. Please, make sure your credentials are "
"correct, or try again later."
msgstr ""
"Prejšnji poskus povezave ni uspel. Preverite, ali so vaše poverilnice "
"pravilne ali poskusite kasneje."
#: lib/TLS_UI/res/wxTLS_UI.cpp:17
msgid "Server Trust"
msgstr "Zaupanje strežniku"
#: lib/TLS_UI/res/wxTLS_UI.cpp:28
msgid ""
"Describe the servers you trust to prevent credential interception in case of"
" man-in-the-middle attacks."
msgstr ""
"Opišite strežnike, ki jim zaupate in preprečite prestrezanje poverilnic v "
"primeru napada \"vmesnega člena\"."
#: lib/TLS_UI/res/wxTLS_UI.cpp:35
msgid "Acceptable Certificate Authorities:"
msgstr "Sprejemljivi izdajatelji potrdil:"
#: lib/TLS_UI/res/wxTLS_UI.cpp:40
msgid "List of certificate authorities server's certificate must be issued by"
msgstr ""
"Seznam izdajateljev potrdil, od katerih mora biti izdano strežnikovo "
"potrdilo"
#: lib/TLS_UI/res/wxTLS_UI.cpp:47
msgid "Add CA from Store..."
msgstr "Dodaj CA iz shrambe ..."
#: lib/TLS_UI/res/wxTLS_UI.cpp:48
msgid ""
"Adds a new certificate authority from the certificate store to the list"
msgstr "Doda novega izdajatelja potrdil iz shrambe potrdil na seznam"
#: lib/TLS_UI/res/wxTLS_UI.cpp:52
msgid "Add CA from File..."
msgstr "Dodaj CA iz datoteke ..."
#: lib/TLS_UI/res/wxTLS_UI.cpp:53
msgid "Adds a new certificate authority from the file to the list"
msgstr "Doda novega izdajatelja potrdil iz datoteke na seznam"
#: lib/TLS_UI/res/wxTLS_UI.cpp:57
msgid "&Remove CA"
msgstr "Odst&rani CA"
#: lib/TLS_UI/res/wxTLS_UI.cpp:59
msgid "Removes selected certificate authorities from the list"
msgstr "Odstrani izbrane izdajatelje potrdil s seznama"
#: lib/TLS_UI/res/wxTLS_UI.cpp:72
msgid "Acceptable server &names:"
msgstr "Sprejemljiva ime&na strežnika:"
#: lib/TLS_UI/res/wxTLS_UI.cpp:77
msgid ""
"A semicolon delimited list of acceptable server FQDN names; blank to skip "
"name check; Unicode characters allowed"
msgstr ""
"S podpičji ločen seznam sprejemljivih strežnikovih imen FQDN; prazno, da "
"izpusti preverjanje imena; znaki Unicode dovoljeni"
#: lib/TLS_UI/res/wxTLS_UI.cpp:81
msgid "(Example: foo.bar.com;server2.bar.com)"
msgstr "(Primer: vzo.rec.si;streznik2.rec.si)"
#: lib/TLS_UI/res/wxTLS_UI.cpp:120
msgid "TLS Client Certificate"
msgstr "Odjemalčevo potrdilo TLS"
#: lib/TLS_UI/res/wxTLS_UI.cpp:131
msgid "Please select your client certificate to use for authentication."
msgstr "Izberite svoje odjemalčevo potrdilo za uporabo med overovljanjem."
#: lib/TLS_UI/res/wxTLS_UI.cpp:138
msgid "Co&nnect without providing a client certificate"
msgstr "Poveži brez dostave &odjemalčevega potrdila"
#: lib/TLS_UI/res/wxTLS_UI.cpp:139
msgid ""
"Select if your server does not require you to provide a client certificate"
msgstr ""
"Izberite, če vaš strežnik ne zahteva, da mu dostavite odjemalčevo potrdilo"
#: lib/TLS_UI/res/wxTLS_UI.cpp:146
msgid "Use the following &certificate:"
msgstr "Uporabi naslednje &potrdilo:"
#: lib/TLS_UI/res/wxTLS_UI.cpp:147
msgid "Select if you need to provide a client certificate when connecting"
msgstr "Izberite, če morate dostaviti odjemalčevo potrdilo ob povezavi"
#: lib/TLS_UI/res/wxTLS_UI.cpp:154
msgid "Client certificate to use for authentication"
msgstr "Odjemalčevo potrdilo za overovljanje"
#: lib/TLS_UI/res/wxTLS_UI.cpp:167
msgid "Custom &identity:"
msgstr "&Identiteta po meri:"
#: lib/TLS_UI/res/wxTLS_UI.cpp:172
msgid ""
"Your identity (username@domain) to override one from certificate; or blank "
"to use one provided in certificate"
msgstr ""
"Vaša identiteta (up. ime@domena), ki bo nadomestila tisto s potrdila; ali "
"prazno, če želite uporabiti tisto s potrdila"
#: lib/TLS_UI/res/wxTLS_UI.cpp:176
msgid "(Example: user@contoso.com)"
msgstr "(Primer: uporabnik@vzorec.si)"
#: lib/TLS_UI/res/wxTLS_UI.cpp:184
msgid "Check if you would like to save certificate selection"
msgstr "Odkljukajte, če želite shraniti izbor potrdila"
#: lib/TLS_UI/src/TLS_UI.cpp:118
#, c-format
msgid "Invalid character in host name found: %c"
msgstr "Napačen znak v imenu gostitelja: %c"
#: lib/TLS_UI/src/TLS_UI.cpp:118
msgid "Validation conflict"
msgstr "Nesoglasje pri preverjanju"
#: lib/TLS_UI/src/TLS_UI.cpp:514
msgid "Add Certificate"
msgstr "Dodaj potrdilo"
#: lib/TLS_UI/src/TLS_UI.cpp:515
msgid "Certificate Files (*.cer;*.crt;*.der;*.p7b;*.pem)"
msgstr "Datoteke s potrdili (*.cer;*.crt;*.der;*.p7b;*.pem)"
#: lib/TLS_UI/src/TLS_UI.cpp:516
msgid "X.509 Certificate Files (*.cer;*.crt;*.der;*.pem)"
msgstr "Datoteke s potrdili X.509 (*.cer;*.crt;*.der;*.pem)"
#: lib/TLS_UI/src/TLS_UI.cpp:517
msgid "PKCS #7 Certificate Files (*.p7b)"
msgstr "Datoteke s potrdili PKCS #7 (*.p7b)"
#: lib/TLS_UI/src/TLS_UI.cpp:518
msgid "All Files (*.*)"
msgstr "Vse datoteke (*.*)"
#: lib/TLS_UI/src/TLS_UI.cpp:534
#, c-format
msgid "Invalid or unsupported certificate file %s"
msgstr "Napačna ali nepodprta datoteka s potrdilom %s"
#: lib/TLS_UI/src/TLS_UI.cpp:534
msgid "Error"
msgstr "Napaka"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:17
msgid "Outer Identity"
msgstr "Zunanja identiteta"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:28
msgid "Select the user ID supplicant introduces itself as to authenticator:"
msgstr ""
"Izberite uporabniško identiteto, s katerim se prosilec predstavi "
"overovitelju:"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:35
msgid "&True identity"
msgstr "Prava iden&titeta"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:36
msgid "Use my true user name"
msgstr "Uporabi moje pravo uporabniško ime"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:40
msgid "Use &empty outer identity (RFC 4822)"
msgstr "Uporabi prazno zunanjo id&entiteto (RFC 4822)"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:41
msgid "Ommit my user name and use @mydomain.org only"
msgstr "Izpusti moje uporabniško ime in uporabi samo @mojadomena.si"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:48
msgid "&Custom outer identity:"
msgstr "Zunanja identiteta po &meri:"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:49
msgid "Specify custom outer identity"
msgstr "Navedite zunanjo identiteto po meri"
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:54
msgid "Custom outer identity to use"
msgstr "Zunanja identiteta po meri za uporabo"
#: lib/TTLS_UI/src/Module.cpp:231 lib/TTLS_UI/src/Module.cpp:241
#: lib/EAPBase_UI/include/EAP_UI.h:582
#, c-format
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
msgstr ""
"Napaka pri zapisovanju poverilnic v upravitelja poverilnic: %hs (napaka %u)"
#: lib/TTLS_UI/src/Module.cpp:233 lib/TTLS_UI/src/Module.cpp:243
#: lib/EAPBase_UI/include/EAP_UI.h:584
msgid "Writing credentials failed."
msgstr "Zapisovanje poverilnic ni uspelo."
#: lib/TTLS_UI/src/TTLS_UI.cpp:108 lib/TTLS_UI/src/TTLS_UI.cpp:215
msgid "Inner Authentication"
msgstr "Notranje overovljanje"
#: lib/TTLS_UI/src/TTLS_UI.cpp:114
msgid "Select inner authentication method from the list"
msgstr "Izberite postopek notranjega overovljanja s seznama"
#: lib/TTLS_UI/src/TTLS_UI.cpp:116
msgid "PAP"
msgstr "PAP"
#: lib/TTLS_UI/src/TTLS_UI.cpp:121 lib/TTLS_UI/src/TTLS_UI.cpp:236
msgid "Outer Authentication"
msgstr "Zunanje overovljanje"
#: lib/EAPBase_UI/include/EAP_UI.h:253
msgid "EAP Credentials"
msgstr "Poverilnice EAP"
#: lib/EAPBase_UI/include/EAP_UI.h:422
msgid "Provider Settings"
msgstr "Nastavitve ponudnika"
#: lib/EAPBase_UI/include/EAP_UI.h:502 lib/EAPBase_UI/include/EAP_UI.h:529
msgid "<blank>"
msgstr "<prazno>"
#: lib/EAPBase_UI/include/EAP_UI.h:508
#, c-format
msgid "<error %u>"
msgstr "<napaka %u>"
#: lib/EAPBase_UI/include/EAP_UI.h:568
#, c-format
msgid "Error reading credentials from Credential Manager: %hs (error %u)"
msgstr ""
"Napaka pri branju poverilnic iz upravitelja poverilnic: %hs (napaka %u)"
#: lib/EAPBase_UI/include/EAP_UI.h:570
msgid "Reading credentials failed."
msgstr "Branje poverilnic ni uspelo."
#: lib/EAPBase_UI/include/EAP_UI.h:595
#, c-format
msgid "Deleting credentials failed (error %u)."
msgstr "Izbris poverilnic ni uspel (napaka %u)."
#: lib/EAPBase_UI/include/EAP_UI.h:817
msgid "<Your Organization>"
msgstr "<vaša organizacija>"
#: lib/EAPBase_UI/res/wxEAP_UI.h:60
msgid "EAP Method Configuration"
msgstr "Konfiguracija postopka EAP"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:3
msgid "1252"
msgstr "1250"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "EAP Methods"
msgstr "Postopki EAP"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "Modules to support individual EAP methods"
msgstr "Moduli, ki omogočajo posamezne postopke EAP"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
msgid "TTLS"
msgstr "TTLS"
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
msgid "Tunneled Transport Layer Security"
msgstr "Tunneled Transport Layer Security"

Binary file not shown.

View File

@@ -1,260 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include <StdAfx.h>
#include "wxEAP_UI.h"
///////////////////////////////////////////////////////////////////////////
wxEAPConfigDialogBase::wxEAPConfigDialogBase( 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, 5 );
m_providers = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
sb_content->Add( m_providers, 1, wxEXPAND|wxALL, 5 );
m_buttons = new wxStdDialogButtonSizer();
m_buttonsOK = new wxButton( this, wxID_OK );
m_buttons->AddButton( m_buttonsOK );
m_buttonsCancel = new wxButton( this, wxID_CANCEL );
m_buttons->AddButton( m_buttonsCancel );
m_buttons->Realize();
sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( sb_content );
this->Layout();
sb_content->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPConfigDialogBase::OnInitDialog ) );
}
wxEAPConfigDialogBase::~wxEAPConfigDialogBase()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPConfigDialogBase::OnInitDialog ) );
}
wxEAPCredentialsDialogBase::wxEAPCredentialsDialogBase( 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, 5 );
m_panels = new wxBoxSizer( wxVERTICAL );
sb_content->Add( m_panels, 1, wxEXPAND|wxALL, 5 );
m_buttons = new wxStdDialogButtonSizer();
m_buttonsOK = new wxButton( this, wxID_OK );
m_buttons->AddButton( m_buttonsOK );
m_buttonsCancel = new wxButton( this, wxID_CANCEL );
m_buttons->AddButton( m_buttonsCancel );
m_buttons->Realize();
sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( sb_content );
this->Layout();
sb_content->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPCredentialsDialogBase::OnInitDialog ) );
}
wxEAPCredentialsDialogBase::~wxEAPCredentialsDialogBase()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPCredentialsDialogBase::OnInitDialog ) );
}
wxEAPBannerPanelBase::wxEAPBannerPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
this->SetMinSize( wxSize( -1,48 ) );
wxBoxSizer* sc_content;
sc_content = new wxBoxSizer( wxVERTICAL );
m_title = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
m_title->Wrap( -1 );
m_title->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
m_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
sc_content->Add( m_title, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( sc_content );
this->Layout();
sc_content->Fit( this );
}
wxEAPBannerPanelBase::~wxEAPBannerPanelBase()
{
}
wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxStaticBoxSizer* sb_credentials;
sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Client Credentials") ), wxVERTICAL );
wxBoxSizer* sb_credentials_horiz;
sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL );
m_credentials_icon = new wxStaticBitmap( sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 );
wxBoxSizer* sb_credentials_vert;
sb_credentials_vert = new wxBoxSizer( wxVERTICAL );
m_credentials_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Manage your credentials stored in Windows Credential Manager."), wxDefaultPosition, wxDefaultSize, 0 );
m_credentials_label->Wrap( 446 );
sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* sb_credentials_tbl;
sb_credentials_tbl = new wxFlexGridSizer( 0, 2, 5, 5 );
sb_credentials_tbl->AddGrowableCol( 1 );
sb_credentials_tbl->SetFlexibleDirection( wxBOTH );
sb_credentials_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_identity_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Identity:"), wxDefaultPosition, wxDefaultSize, 0 );
m_identity_label->Wrap( -1 );
sb_credentials_tbl->Add( m_identity_label, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_identity = new wxTextCtrl( sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_identity->SetToolTip( _("Enter your user name here (user@domain.org, DOMAINUser, etc.)") );
sb_credentials_tbl->Add( m_identity, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, 5 );
wxBoxSizer* sb_buttons;
sb_buttons = new wxBoxSizer( wxHORIZONTAL );
m_set = new wxButton( sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 );
m_set->SetToolTip( _("Click here to set or modify your credentials") );
sb_buttons->Add( m_set, 0, wxRIGHT, 5 );
m_clear = new wxButton( sb_credentials->GetStaticBox(), wxID_ANY, _("&Clear Credentials"), wxDefaultPosition, wxDefaultSize, 0 );
m_clear->SetToolTip( _("Click to clear your credentials from Credential Manager.\nNote: You will be prompted to enter credentials when connecting.") );
sb_buttons->Add( m_clear, 0, wxLEFT, 5 );
sb_credentials_vert->Add( sb_buttons, 0, wxALIGN_RIGHT|wxALL, 5 );
sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, 5 );
sb_credentials->Add( sb_credentials_horiz, 1, wxEXPAND, 5 );
this->SetSizer( sb_credentials );
this->Layout();
// Connect Events
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPCredentialsConfigPanelBase::OnUpdateUI ) );
m_set->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSet ), NULL, this );
m_clear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnClear ), NULL, this );
}
wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase()
{
// Disconnect Events
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPCredentialsConfigPanelBase::OnUpdateUI ) );
m_set->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSet ), NULL, this );
m_clear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnClear ), NULL, this );
}
wxPasswordCredentialsPanelBase::wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxStaticBoxSizer* sb_credentials;
sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Client Credentials") ), wxVERTICAL );
wxBoxSizer* sb_credentials_horiz;
sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL );
m_credentials_icon = new wxStaticBitmap( sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 );
wxBoxSizer* sb_credentials_vert;
sb_credentials_vert = new wxBoxSizer( wxVERTICAL );
m_credentials_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Please provide your user ID and password."), wxDefaultPosition, wxDefaultSize, 0 );
m_credentials_label->Wrap( 446 );
sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* sb_credentials_tbl;
sb_credentials_tbl = new wxFlexGridSizer( 0, 2, 5, 5 );
sb_credentials_tbl->AddGrowableCol( 1 );
sb_credentials_tbl->SetFlexibleDirection( wxBOTH );
sb_credentials_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_identity_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("User ID:"), wxDefaultPosition, wxDefaultSize, 0 );
m_identity_label->Wrap( -1 );
sb_credentials_tbl->Add( m_identity_label, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_identity = new wxTextCtrl( 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, 5 );
m_password_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Password:"), wxDefaultPosition, wxDefaultSize, 0 );
m_password_label->Wrap( -1 );
sb_credentials_tbl->Add( m_password_label, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_password = new wxTextCtrl( sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
m_password->SetToolTip( _("Enter your password here") );
sb_credentials_tbl->Add( m_password, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, 5 );
m_remember = new wxCheckBox( sb_credentials->GetStaticBox(), wxID_ANY, _("&Remember"), wxDefaultPosition, wxDefaultSize, 0 );
m_remember->SetHelpText( _("Check if you would like to save username and password") );
sb_credentials_vert->Add( m_remember, 0, wxALL|wxEXPAND, 5 );
sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, 5 );
sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, 5 );
this->SetSizer( sb_credentials );
this->Layout();
}
wxPasswordCredentialsPanelBase::~wxPasswordCredentialsPanelBase()
{
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,727 +0,0 @@
/*
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::session
//////////////////////////////////////////////////////////////////////
eap::session::session()
{
}
eap::session::~session()
{
}
DWORD eap::session::begin(
_In_ DWORD dwFlags,
_In_ const EapAttributes *pAttributeArray,
_In_ HANDLE hTokenImpersonateUser,
_In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ DWORD dwMaxSendPacketSize,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(dwFlags);
UNREFERENCED_PARAMETER(pAttributeArray);
UNREFERENCED_PARAMETER(hTokenImpersonateUser);
UNREFERENCED_PARAMETER(dwConnectionDataSize);
UNREFERENCED_PARAMETER(pConnectionData);
UNREFERENCED_PARAMETER(dwUserDataSize);
UNREFERENCED_PARAMETER(pUserData);
UNREFERENCED_PARAMETER(dwMaxSendPacketSize);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_SUCCESS;
}
DWORD eap::session::end(_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_SUCCESS;
}
DWORD eap::session::process_request_packet(
_In_ DWORD dwReceivedPacketSize,
_In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket,
_Out_ EapPeerMethodOutput *pEapOutput,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(dwReceivedPacketSize);
UNREFERENCED_PARAMETER(pReceivedPacket);
UNREFERENCED_PARAMETER(pEapOutput);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::get_response_packet(
_Inout_ DWORD *pdwSendPacketSize,
_Inout_bytecap_(*dwSendPacketSize) EapPacket *pSendPacket,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(pdwSendPacketSize);
UNREFERENCED_PARAMETER(pSendPacket);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::get_result(_In_ EapPeerMethodResultReason reason, _Out_ EapPeerMethodResult *ppResult, _Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(reason);
UNREFERENCED_PARAMETER(ppResult);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::get_ui_context(
_Out_ DWORD *pdwUIContextDataSize,
_Out_ BYTE **ppUIContextData,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(pdwUIContextDataSize);
UNREFERENCED_PARAMETER(ppUIContextData);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::set_ui_context(
_In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EapPeerMethodOutput *pEapOutput,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(dwUIContextDataSize);
UNREFERENCED_PARAMETER(pUIContextData);
UNREFERENCED_PARAMETER(pEapOutput);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::get_response_attributes(_Out_ EapAttributes *pAttribs, _Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(pAttribs);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
DWORD eap::session::set_response_attributes(const _In_ EapAttributes *pAttribs, _Out_ EapPeerMethodOutput *pEapOutput, _Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(pAttribs);
UNREFERENCED_PARAMETER(pEapOutput);
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_NOT_SUPPORTED;
}
//////////////////////////////////////////////////////////////////////
// eap::config
//////////////////////////////////////////////////////////////////////
eap::config::config(_In_ module &mod) :
m_module(mod)
{
}
eap::config::config(_In_ const config &other) :
m_module(other.m_module)
{
}
eap::config::config(_Inout_ config &&other) :
m_module(other.m_module)
{
}
eap::config::~config()
{
}
eap::config& eap::config::operator=(_In_ const config &other)
{
UNREFERENCED_PARAMETER(other);
assert(&m_module == &other.m_module); // Copy configuration within same module only!
return *this;
}
eap::config& eap::config::operator=(_Inout_ config &&other)
{
UNREFERENCED_PARAMETER(other);
assert(&m_module == &other.m_module); // Copy configuration within same module only!
return *this;
}
//////////////////////////////////////////////////////////////////////
// eap::config_method
//////////////////////////////////////////////////////////////////////
eap::config_method::config_method(_In_ module &mod) :
m_allow_save(true),
config(mod)
{
}
eap::config_method::config_method(_In_ const config_method &other) :
m_allow_save(other.m_allow_save),
m_anonymous_identity(other.m_anonymous_identity),
config(other)
{
}
eap::config_method::config_method(_Inout_ config_method &&other) :
m_allow_save(std::move(other.m_allow_save)),
m_anonymous_identity(std::move(other.m_anonymous_identity)),
config(std::move(other))
{
}
eap::config_method& eap::config_method::operator=(_In_ const config_method &other)
{
if (this != &other) {
(config&)*this = other;
m_allow_save = other.m_allow_save;
m_anonymous_identity = other.m_anonymous_identity;
}
return *this;
}
eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other)
{
if (this != &other) {
(config&&)*this = std::move(other);
m_allow_save = std::move(other.m_allow_save);
m_anonymous_identity = std::move(other.m_anonymous_identity);
}
return *this;
}
DWORD eap::config_method::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
{
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
DWORD dwResult;
// <ClientSideCredential>
com_obj<IXMLDOMElement> pXmlElClientSideCredential;
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ClientSideCredential"), bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <ClientSideCredential> element."), NULL);
return dwResult;
}
// <ClientSideCredential>/<allow-save>
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, bstr(L"allow-save"), bstrNamespace, m_allow_save)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <allow-save> element."), NULL);
return dwResult;
}
// <ClientSideCredential>/<AnonymousIdentity>
if (!m_anonymous_identity.empty())
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, bstr(L"AnonymousIdentity"), bstrNamespace, bstr(m_anonymous_identity))) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <AnonymousIdentity> element."), NULL);
return dwResult;
}
return ERROR_SUCCESS;
}
DWORD eap::config_method::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(ppEapError);
m_allow_save = true;
m_anonymous_identity.clear();
// <ClientSideCredential>
com_obj<IXMLDOMElement> pXmlElClientSideCredential;
if (eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ClientSideCredential"), &pXmlElClientSideCredential) == ERROR_SUCCESS) {
// <allow-save>
eapxml::get_element_value(pXmlElClientSideCredential, bstr(L"eap-metadata:allow-save"), &m_allow_save);
// <AnonymousIdentity>
eapxml::get_element_value(pXmlElClientSideCredential, bstr(L"eap-metadata:AnonymousIdentity"), m_anonymous_identity);
}
return ERROR_SUCCESS;
}
//////////////////////////////////////////////////////////////////////
// eap::credentials
//////////////////////////////////////////////////////////////////////
eap::credentials::credentials(_In_ module &mod) : config(mod)
{
}
eap::credentials::credentials(_In_ const credentials &other) :
m_identity(other.m_identity),
config(other)
{
}
eap::credentials::credentials(_Inout_ credentials &&other) :
m_identity(std::move(other.m_identity)),
config(std::move(other))
{
}
eap::credentials& eap::credentials::operator=(_In_ const credentials &other)
{
if (this != &other) {
(config&)*this = other;
m_identity = other.m_identity;
}
return *this;
}
eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other)
{
if (this != &other) {
(config&)*this = std::move(other);
m_identity = std::move(other.m_identity);
}
return *this;
}
void eap::credentials::clear()
{
m_identity.clear();
}
bool eap::credentials::empty() const
{
return m_identity.empty();
}
DWORD eap::credentials::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
{
UNREFERENCED_PARAMETER(pDoc);
UNREFERENCED_PARAMETER(pConfigRoot);
UNREFERENCED_PARAMETER(ppEapError);
// Yeah, right!? Credentials are non-exportable!
return ERROR_NOT_SUPPORTED;
}
//////////////////////////////////////////////////////////////////////
// eap::credentials_pass
//////////////////////////////////////////////////////////////////////
eap::credentials_pass::credentials_pass(_In_ module &mod) : credentials(mod)
{
}
eap::credentials_pass::credentials_pass(_In_ const credentials_pass &other) :
m_password(other.m_password),
credentials(other)
{
}
eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) :
m_password(std::move(other.m_password)),
credentials(std::move(other))
{
}
eap::credentials_pass& eap::credentials_pass::operator=(_In_ const credentials_pass &other)
{
if (this != &other) {
(credentials&)*this = other;
m_password = other.m_password;
}
return *this;
}
eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass &&other)
{
if (this != &other) {
(credentials&)*this = std::move(other);
m_password = std::move(other.m_password);
}
return *this;
}
void eap::credentials_pass::clear()
{
credentials::clear();
m_password.clear();
}
bool eap::credentials_pass::empty() const
{
return credentials::empty() && m_password.empty();
}
DWORD eap::credentials_pass::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
assert(pConfigRoot);
UNREFERENCED_PARAMETER(ppEapError);
eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity);
bstr pass;
if ((eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:Password"), &pass)) == ERROR_SUCCESS)
m_password = pass;
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
return ERROR_SUCCESS;
}
DWORD eap::credentials_pass::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError) const
{
assert(pszTargetName);
assert(ppEapError);
DWORD dwResult;
string password_enc;
// Prepare cryptographics provider.
crypt_prov cp;
if (!cp.create(NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CryptAcquireContext failed."), NULL);
return dwResult;
}
// Import the public key.
HRSRC res = FindResource(m_module.m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PUBLIC), RT_RCDATA);
assert(res);
HGLOBAL res_handle = LoadResource(m_module.m_instance, res);
assert(res_handle);
crypt_key key;
unique_ptr<CERT_PUBLIC_KEY_INFO, LocalFree_delete<CERT_PUBLIC_KEY_INFO> > keyinfo_data;
DWORD keyinfo_size = 0;
if (!CryptDecodeObjectEx(X509_ASN_ENCODING, X509_PUBLIC_KEY_INFO, (const BYTE*)::LockResource(res_handle), ::SizeofResource(m_module.m_instance, res), CRYPT_DECODE_ALLOC_FLAG, NULL, &keyinfo_data, &keyinfo_size)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CryptDecodeObjectEx failed."), NULL);
return dwResult;
}
if (!key.import_public(cp, X509_ASN_ENCODING, keyinfo_data.get())) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Public key import failed."), NULL);
return dwResult;
}
// Convert password to UTF-8.
sanitizing_string password_utf8;
WideCharToMultiByte(CP_UTF8, 0, m_password.c_str(), (int)m_password.length(), password_utf8, NULL, NULL);
// Pre-allocate memory to allow space, as encryption will grow the data, and we need additional 16B at the end for MD5 hash.
DWORD dwBlockLen;
vector<char, sanitizing_allocator<char> > password(password_utf8.length());
memcpy(password.data(), password_utf8.c_str(), sizeof(char)*password_utf8.length());
if (!CryptGetKeyParam(key, KP_BLOCKLEN, dwBlockLen, 0)) dwBlockLen = 0;
password.reserve((password.size() + dwBlockLen - 1) / dwBlockLen * dwBlockLen + 16);
// Encrypt the password using our public key. Calculate MD5 hash and append it.
crypt_hash hash;
if (!hash.create(cp, CALG_MD5)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Creating MD5 hash failed."), NULL);
return dwResult;
}
if (!CryptEncrypt(key, hash, TRUE, 0, password)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Encrypting password failed."), NULL);
return dwResult;
}
vector<char> hash_bin;
CryptGetHashParam(hash, HP_HASHVAL, hash_bin, 0);
password.insert(password.end(), hash_bin.begin(), hash_bin.end());
// Convert encrypted password to Base64, since CredProtectA() fail for binary strings.
string password_base64;
base64_enc enc;
enc.encode(password_base64, password.data(), password.size());
// Encrypt the password using user's key.
CRED_PROTECTION_TYPE cpt;
if (!CredProtectA(TRUE, password_base64.c_str(), (DWORD)password_base64.length(), password_enc, &cpt)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredProtect failed."), NULL);
return dwResult;
}
tstring target(target_name(pszTargetName));
// Write credentials.
assert(password_enc.size()*sizeof(char) < CRED_MAX_CREDENTIAL_BLOB_SIZE);
assert(m_identity.length() < CRED_MAX_USERNAME_LENGTH );
CREDENTIAL cred = {
0, // Flags
CRED_TYPE_GENERIC, // Type
(LPTSTR)target.c_str(), // TargetName
_T(""), // Comment
{ 0, 0 }, // LastWritten
(DWORD)password_enc.size()*sizeof(char), // CredentialBlobSize
(LPBYTE)password_enc.data(), // CredentialBlob
CRED_PERSIST_ENTERPRISE, // Persist
0, // AttributeCount
NULL, // Attributes
NULL, // TargetAlias
(LPTSTR)m_identity.c_str() // UserName
};
if (!CredWrite(&cred, 0)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredWrite failed."), NULL);
return dwResult;
}
return ERROR_SUCCESS;
}
DWORD eap::credentials_pass::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError)
{
assert(pszTargetName);
DWORD dwResult;
// Read credentials.
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredRead failed."), NULL);
return dwResult;
}
m_identity = cred->UserName;
// Decrypt the password using user's key.
string password_base64;
if (!CredUnprotectA(TRUE, (LPCSTR)(cred->CredentialBlob), cred->CredentialBlobSize/sizeof(char), password_base64)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredUnprotect failed."), NULL);
return dwResult;
}
// Convert Base64 to binary encrypted password, since CredProtectA() fail for binary strings.
vector<char, sanitizing_allocator<char> > password;
base64_dec dec;
bool is_last;
dec.decode(password, is_last, password_base64.c_str(), password_base64.length());
// Prepare cryptographics provider.
crypt_prov cp;
if (!cp.create(NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CryptAcquireContext failed."), NULL);
return dwResult;
}
// Create hash.
crypt_hash hash;
if (!hash.create(cp, CALG_MD5)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Creating MD5 hash failed."), NULL);
return dwResult;
}
DWORD dwHashSize, dwHashSizeSize = sizeof(dwHashSize);
CryptGetHashParam(hash, HP_HASHSIZE, (LPBYTE)&dwHashSize, &dwHashSizeSize, 0);
if (password.size() < dwHashSize) {
*ppEapError = m_module.make_error(dwResult = ERROR_INVALID_DATA, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Encrypted password too short."), NULL);
return dwResult;
}
// Truncate hash from encrypted password.
vector<char> hash_bin;
size_t enc_size = password.size() - dwHashSize;
hash_bin.assign(password.begin() + enc_size, password.end());
password.resize(enc_size);
// Import the private key.
HRSRC res = FindResource(m_module.m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PRIVATE), RT_RCDATA);
assert(res);
HGLOBAL res_handle = LoadResource(m_module.m_instance, res);
assert(res_handle);
crypt_key key;
unique_ptr<unsigned char[], LocalFree_delete<unsigned char[]> > keyinfo_data;
DWORD keyinfo_size = 0;
if (!CryptDecodeObjectEx(X509_ASN_ENCODING, PKCS_RSA_PRIVATE_KEY, (const BYTE*)::LockResource(res_handle), ::SizeofResource(m_module.m_instance, res), CRYPT_DECODE_ALLOC_FLAG, NULL, &keyinfo_data, &keyinfo_size)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CryptDecodeObjectEx failed."), NULL);
return dwResult;
}
if (!key.import(cp, keyinfo_data.get(), keyinfo_size, NULL, 0)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Private key import failed."), NULL);
return dwResult;
}
// Decrypt the password using our private key. Calculate MD5 hash and verify it.
if (!CryptDecrypt(key, hash, TRUE, 0, password)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Decrypting password failed."), NULL);
return dwResult;
}
vector<char> hash2_bin;
CryptGetHashParam(hash, HP_HASHVAL, hash2_bin, 0);
if (hash_bin != hash2_bin) {
*ppEapError = m_module.make_error(dwResult = ERROR_INVALID_DATA, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Invalid password data."), NULL);
return dwResult;
}
// Convert password from UTF-8.
MultiByteToWideChar(CP_UTF8, 0, password.data(), (int)password.size(), m_password);
return ERROR_SUCCESS;
}
//////////////////////////////////////////////////////////////////////
// eap::module
//////////////////////////////////////////////////////////////////////
eap::module::module() :
m_instance(NULL)
{
m_ep.create(&EAPMETHOD_TRACE_EVENT_PROVIDER);
m_ep.write(&EAPMETHOD_TRACE_EVT_MODULE_LOAD, event_data((BYTE)EAPMETHOD_TYPE), event_data::blank);
m_heap.create(0, 0, 0);
}
eap::module::~module()
{
m_ep.write(&EAPMETHOD_TRACE_EVT_MODULE_UNLOAD, event_data((BYTE)EAPMETHOD_TYPE), event_data::blank);
}
EAP_ERROR* eap::module::make_error(_In_ DWORD dwErrorCode, _In_ DWORD dwReasonCode, _In_ LPCGUID pRootCauseGuid, _In_ LPCGUID pRepairGuid, _In_ LPCGUID pHelpLinkGuid, _In_z_ LPCWSTR pszRootCauseString, _In_z_ LPCWSTR pszRepairString) const
{
// Calculate memory size requirement.
SIZE_T
nRootCauseSize = pszRootCauseString != NULL && pszRootCauseString[0] ? (wcslen(pszRootCauseString) + 1)*sizeof(WCHAR) : 0,
nRepairStringSize = pszRepairString != NULL && pszRepairString [0] ? (wcslen(pszRepairString ) + 1)*sizeof(WCHAR) : 0,
nEapErrorSize = sizeof(EAP_ERROR) + nRootCauseSize + nRepairStringSize;
EAP_ERROR *pError = (EAP_ERROR*)HeapAlloc(m_heap, 0, nEapErrorSize);
if (!pError)
return NULL;
BYTE *p = (BYTE*)(pError + 1);
// Fill the error descriptor.
pError->dwWinError = dwErrorCode;
pError->type.eapType.type = EAPMETHOD_TYPE;
pError->type.eapType.dwVendorId = 0;
pError->type.eapType.dwVendorType = 0;
pError->type.dwAuthorId = 67532;
pError->dwReasonCode = dwReasonCode;
pError->rootCauseGuid = pRootCauseGuid != NULL ? *pRootCauseGuid : GUID_NULL;
pError->repairGuid = pRepairGuid != NULL ? *pRepairGuid : GUID_NULL;
pError->helpLinkGuid = pHelpLinkGuid != NULL ? *pHelpLinkGuid : GUID_NULL;
if (nRootCauseSize) {
pError->pRootCauseString = (LPWSTR)p;
memcpy(pError->pRootCauseString, pszRootCauseString, nRootCauseSize);
p += nRootCauseSize;
} else
pError->pRootCauseString = NULL;
if (nRepairStringSize) {
pError->pRepairString = (LPWSTR)p;
memcpy(pError->pRepairString, pszRepairString, nRepairStringSize);
p += nRepairStringSize;
} else
pError->pRepairString = NULL;
// Write trace event.
vector<EVENT_DATA_DESCRIPTOR> evt_desc;
evt_desc.reserve(8);
evt_desc.push_back(event_data(pError->dwWinError));
evt_desc.push_back(event_data(pError->type.eapType.type));
evt_desc.push_back(event_data(pError->dwReasonCode));
evt_desc.push_back(event_data(&(pError->rootCauseGuid), sizeof(GUID)));
evt_desc.push_back(event_data(&(pError->repairGuid), sizeof(GUID)));
evt_desc.push_back(event_data(&(pError->helpLinkGuid), sizeof(GUID)));
evt_desc.push_back(event_data(pError->pRootCauseString));
evt_desc.push_back(event_data(pError->pRepairString));
m_ep.write(&EAPMETHOD_TRACE_EAP_ERROR, (ULONG)evt_desc.size(), evt_desc.data());
return pError;
}
BYTE* eap::module::alloc_memory(_In_ size_t size)
{
return (BYTE*)HeapAlloc(m_heap, 0, size);
}
void eap::module::free_memory(_In_ BYTE *ptr)
{
ETW_FN_VOID;
// Since we do security here and some of the BLOBs contain credentials, sanitize every memory block before freeing.
SecureZeroMemory(ptr, HeapSize(m_heap, 0, ptr));
HeapFree(m_heap, 0, ptr);
}
void eap::module::free_error_memory(_In_ EAP_ERROR *err)
{
ETW_FN_VOID;
// pRootCauseString and pRepairString always trail the ppEapError to reduce number of (de)allocations.
HeapFree(m_heap, 0, err);
}

View File

@@ -1,106 +0,0 @@
/*
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>
//////////////////////////////////////////////////////////////////////
// wxEAPCredentialsDialog
//////////////////////////////////////////////////////////////////////
wxEAPCredentialsDialog::wxEAPCredentialsDialog(wxWindow* parent) : wxEAPCredentialsDialogBase(parent)
{
// Set extra style here, as wxFormBuilder overrides all default flags.
this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
m_buttonsOK->SetDefault();
}
void wxEAPCredentialsDialog::AddContents(wxPanel **contents, size_t content_count)
{
if (content_count) {
for (size_t i = 0; i < content_count; i++)
m_panels->Add(contents[i], 0, wxALL|wxEXPAND, 5);
this->Layout();
this->GetSizer()->Fit(this);
contents[0]->SetFocusFromKbd();
}
}
void wxEAPCredentialsDialog::OnInitDialog(wxInitDialogEvent& event)
{
for (wxSizerItemList::compatibility_iterator panel = m_panels->GetChildren().GetFirst(); panel; panel = panel->GetNext())
panel->GetData()->GetWindow()->GetEventHandler()->ProcessEvent(event);
}
//////////////////////////////////////////////////////////////////////
// wxEAPBannerPanel
//////////////////////////////////////////////////////////////////////
wxEAPBannerPanel::wxEAPBannerPanel(wxWindow* parent) : wxEAPBannerPanelBase(parent)
{
m_title->SetLabelText(wxT(PRODUCT_NAME_STR));
}
//////////////////////////////////////////////////////////////////////
// wxPasswordCredentialsPanel
//////////////////////////////////////////////////////////////////////
const wxStringCharType *wxPasswordCredentialsPanel::s_dummy_password = wxT("dummypass");
wxPasswordCredentialsPanel::wxPasswordCredentialsPanel(eap::credentials_pass &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config) :
wxCredentialsPanel<wxPasswordCredentialsPanelBase, eap::credentials_pass>(cred, pszCredTarget, parent, is_config)
{
// Load and set icon.
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
wxSetIconFromResource(m_credentials_icon, m_icon, m_shell32, MAKEINTRESOURCE(269));
}
bool wxPasswordCredentialsPanel::TransferDataToWindow()
{
wxCHECK(__super::TransferDataToWindow(), false);
m_identity->SetValue(m_cred.m_identity);
m_identity->SetSelection(0, -1);
m_password->SetValue(m_cred.m_password.empty() ? wxEmptyString : s_dummy_password);
return true;
}
bool wxPasswordCredentialsPanel::TransferDataFromWindow()
{
m_cred.m_identity = m_identity->GetValue();
wxString pass = m_password->GetValue();
if (pass.compare(s_dummy_password) != 0) {
m_cred.m_password = pass;
pass.assign(pass.length(), wxT('*'));
}
return __super::TransferDataFromWindow();
}

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,11 @@
#include <StdAfx.h>
#pragma comment(lib, "msxml6.lib")
using namespace std;
using namespace winstd;
#if EAPMETHOD_TYPE==21
#define _EAPMETHOD_PEER_UI eap::peer_ttls_ui
@@ -68,6 +73,8 @@ BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID l
///
VOID WINAPI EapPeerFreeMemory(_In_ void *pUIContextData)
{
event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__));
if (pUIContextData)
g_peer.free_memory((BYTE*)pUIContextData);
}
@@ -80,6 +87,8 @@ VOID WINAPI EapPeerFreeMemory(_In_ void *pUIContextData)
///
VOID WINAPI EapPeerFreeErrorMemory(_In_ EAP_ERROR *ppEapError)
{
event_fn_auto event_auto(g_peer.get_event_fn_auto(__FUNCTION__));
if (ppEapError)
g_peer.free_error_memory(ppEapError);
}
@@ -94,58 +103,51 @@ DWORD WINAPI EapPeerConfigXml2Blob(
_In_ DWORD dwFlags,
_In_ EAP_METHOD_TYPE eapMethodType,
_In_ IXMLDOMDocument2 *pConfigDoc,
_Out_ BYTE **ppConfigOut,
_Out_ DWORD *pdwConfigOutSize,
_Out_ BYTE **pConnectionDataOut,
_Out_ DWORD *pdwConnectionDataOutSize,
_Out_ EAP_ERROR **ppEapError)
{
DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
#ifdef _DEBUG
//Sleep(10000);
#endif
// Parameter check
if (!ppEapError)
dwResult = ERROR_INVALID_PARAMETER;
else if (eapMethodType.eapType.type != EAPMETHOD_TYPE)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::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(), NULL);
return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError);
if (eapMethodType.eapType.type != EAPMETHOD_TYPE)
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()));
else if (eapMethodType.dwAuthorId != 67532)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)eapMethodType.dwAuthorId, (int)67532).c_str(), NULL);
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()));
else if (!pConfigDoc)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pConfigDoc is NULL."), NULL);
else if (!ppConfigOut)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppConfigOut is NULL."), NULL);
else if (!pdwConfigOutSize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pdwConfigOutSize is NULL."), NULL);
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 {
UNREFERENCED_PARAMETER(dwFlags);
// <Config>
pConfigDoc->setProperty(winstd::bstr(L"SelectionNamespaces"), winstd::variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
winstd::com_obj<IXMLDOMElement> pXmlElConfig;
if ((dwResult = eapxml::select_element(pConfigDoc, winstd::bstr(L"//eaphostconfig:Config"), &pXmlElConfig)) != ERROR_SUCCESS)
return dwResult;
// Load configuration.
pConfigDoc->setProperty(winstd::bstr(L"SelectionNamespaces"), winstd::variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
_EAPMETHOD_PEER_UI::config_type cfg(g_peer);
dwResult = cfg.load(pXmlElConfig, ppEapError);
if (dwResult != ERROR_SUCCESS)
return dwResult;
// Allocate BLOB for configuration.
assert(ppConfigOut);
assert(pdwConfigOutSize);
*pdwConfigOutSize = (DWORD)eapserial::get_pk_size(cfg);
*ppConfigOut = g_peer.alloc_memory(*pdwConfigOutSize);
if (!*ppConfigOut) {
*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, 0, NULL, NULL, NULL, winstd::tstring_printf(_T(__FUNCTION__) _T(" Error allocating memory for configuration BLOB (%uB)."), *pdwConfigOutSize).c_str(), NULL);
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
com_obj<IXMLDOMElement> pXmlElConfig;
if (FAILED(eapxml::select_element(pConfigDoc, bstr(L"//eaphostconfig:Config"), &pXmlElConfig))) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" Error reading <Config> element.")));
return dwResult;
}
// Pack BLOB to output.
unsigned char *cursor = *ppConfigOut;
eapserial::pack(cursor, cfg);
assert(cursor - *ppConfigOut <= (ptrdiff_t)*pdwConfigOutSize);
// Load configuration.
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
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;
@@ -160,45 +162,40 @@ DWORD WINAPI EapPeerConfigXml2Blob(
/// \sa [EapPeerConfigBlob2Xml function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363601.aspx)
///
DWORD WINAPI EapPeerConfigBlob2Xml(
_In_ DWORD dwFlags,
_In_ EAP_METHOD_TYPE eapMethodType,
_In_count_(dwConfigInSize) const BYTE *pConfigIn,
_In_ DWORD dwConfigInSize,
_Out_ IXMLDOMDocument2 **ppConfigDoc,
_Out_ EAP_ERROR **ppEapError)
_In_ DWORD dwFlags,
_In_ EAP_METHOD_TYPE eapMethodType,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwConnectionDataSize,
_Out_ IXMLDOMDocument2 **ppConfigDoc,
_Out_ EAP_ERROR **ppEapError)
{
DWORD dwResult = ERROR_SUCCESS;
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
#ifdef _DEBUG
//Sleep(10000);
#endif
// Parameter check
if (!ppEapError)
dwResult = ERROR_INVALID_PARAMETER;
else if (eapMethodType.eapType.type != EAPMETHOD_TYPE)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::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(), NULL);
return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError);
if (eapMethodType.eapType.type != EAPMETHOD_TYPE)
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()));
else if (eapMethodType.dwAuthorId != 67532)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)eapMethodType.dwAuthorId, (int)67532).c_str(), NULL);
else if (!pConfigIn && dwConfigInSize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pConfigIn is NULL."), NULL);
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()));
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)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppConfigDoc is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConfigDoc is NULL.")));
else {
UNREFERENCED_PARAMETER(dwFlags);
HRESULT hr;
// Unpack configuration.
_EAPMETHOD_PEER_UI::config_type cfg(g_peer);
if (pConfigIn || !dwConfigInSize) {
const unsigned char *cursor = pConfigIn;
eapserial::unpack(cursor, cfg);
assert(cursor - pConfigIn <= (ptrdiff_t)dwConfigInSize);
}
// Create configuration XML document.
winstd::com_obj<IXMLDOMDocument2> pDoc;
com_obj<IXMLDOMDocument2> pDoc;
if (FAILED(hr = pDoc.create(CLSID_DOMDocument60, NULL, CLSCTX_INPROC_SERVER))) {
*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating XML document."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error creating XML document.")));
return dwResult;
}
@@ -206,25 +203,33 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
// Load empty XML configuration.
VARIANT_BOOL isSuccess = VARIANT_FALSE;
if (FAILED((hr = pDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"><EAPIdentityProviderList xmlns=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"></EAPIdentityProviderList></Config>", &isSuccess))))
return dwResult = HRESULT_CODE(hr);
if (FAILED((hr = pDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"><EAPIdentityProviderList xmlns=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"></EAPIdentityProviderList></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) {
*ppEapError = g_peer.make_error(dwResult = ERROR_XML_PARSE_ERROR, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Loading XML template failed."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_XML_PARSE_ERROR, _T(__FUNCTION__) _T(" Loading XML template failed.")));
return dwResult;
}
// Select <Config> node.
winstd::com_obj<IXMLDOMNode> pXmlElConfig;
pDoc->setProperty(winstd::bstr(L"SelectionNamespaces"), winstd::variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
if ((dwResult = eapxml::select_node(pDoc, winstd::bstr(L"eaphostconfig:Config"), &pXmlElConfig)) != ERROR_SUCCESS) {
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_FOUND, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error selecting <Config> element."), NULL);
com_obj<IXMLDOMNode> pXmlElConfig;
pDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
if (FAILED(eapxml::select_node(pDoc, bstr(L"eaphostconfig:Config"), &pXmlElConfig))) {
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <Config> element.")));
return dwResult;
}
// Save all providers.
pDoc->setProperty(winstd::bstr(L"SelectionNamespaces"), winstd::variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
if ((dwResult = cfg.save(pDoc, pXmlElConfig, ppEapError)) != ERROR_SUCCESS)
return dwResult;
// Save configuration.
pDoc->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, pDoc, 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 = pDoc.detach();
}
@@ -250,52 +255,39 @@ DWORD WINAPI EapPeerInvokeConfigUI(
{
UNREFERENCED_PARAMETER(dwFlags);
DWORD dwResult = ERROR_SUCCESS;
winstd::actctx_activator actctx(g_act_ctx);
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
actctx_activator actctx(g_act_ctx);
#ifdef _DEBUG
//Sleep(10000);
#endif
// Parameter check
if (!ppEapError)
dwResult = ERROR_INVALID_PARAMETER;
else if (!pEapType)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pEapType is NULL."), NULL);
return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError);
if (!pEapType)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL.")));
else if (pEapType->eapType.type != EAPMETHOD_TYPE)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::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(), NULL);
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()));
else if (pEapType->dwAuthorId != 67532)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str(), NULL);
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)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pConnectionDataIn is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionDataIn is NULL.")));
else if (!pdwConnectionDataOutSize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pdwConnectionDataOutSize is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwConnectionDataOutSize is NULL.")));
else if (!ppConnectionDataOut)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL.")));
else {
// Unpack configuration.
_EAPMETHOD_PEER_UI::config_type cfg(g_peer);
if (pConnectionDataIn || !dwConnectionDataInSize) {
const unsigned char *cursor = pConnectionDataIn;
eapserial::unpack(cursor, cfg);
assert(cursor - pConnectionDataIn <= (ptrdiff_t)dwConnectionDataInSize);
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;
}
if ((dwResult = g_peer.invoke_config_ui(hwndParent, cfg, ppEapError)) != ERROR_SUCCESS)
return dwResult;
// Allocate BLOB for configuration.
assert(ppConnectionDataOut);
assert(pdwConnectionDataOutSize);
*pdwConnectionDataOutSize = (DWORD)eapserial::get_pk_size(cfg);
*ppConnectionDataOut = g_peer.alloc_memory(*pdwConnectionDataOutSize);
if (!*ppConnectionDataOut) {
*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, 0, NULL, NULL, NULL, winstd::tstring_printf(_T(__FUNCTION__) _T(" Error allocating memory for configuration BLOB (%uB)."), *pdwConnectionDataOutSize).c_str(), NULL);
return dwResult;
}
// Pack BLOB to output.
unsigned char *cursor = *ppConnectionDataOut;
eapserial::pack(cursor, cfg);
assert(cursor - *ppConnectionDataOut <= (ptrdiff_t)*pdwConnectionDataOutSize);
}
return dwResult;
@@ -321,7 +313,8 @@ DWORD WINAPI EapPeerInvokeIdentityUI(
_Out_ EAP_ERROR **ppEapError)
{
DWORD dwResult = ERROR_SUCCESS;
winstd::actctx_activator actctx(g_act_ctx);
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
actctx_activator actctx(g_act_ctx);
#ifdef _DEBUG
//Sleep(10000);
#endif
@@ -329,56 +322,34 @@ DWORD WINAPI EapPeerInvokeIdentityUI(
// Parameter check
if (!ppEapError)
dwResult = ERROR_INVALID_PARAMETER;
else if (!pEapType)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pEapType is NULL."), NULL);
assert(!*ppEapError);
if (!pEapType)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL.")));
else if (pEapType->eapType.type != EAPMETHOD_TYPE)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::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(), NULL);
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()));
else if (pEapType->dwAuthorId != 67532)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str(), NULL);
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)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pConnectionData is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pConnectionData is NULL.")));
else if (!pUserData && dwUserDataSize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pUserData is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pUserData is NULL.")));
else if (!pdwUserDataOutSize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pdwUserDataOutSize is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwUserDataOutSize is NULL.")));
else if (!ppUserDataOut)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppUserDataOut is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppUserDataOut is NULL.")));
else if (!ppwszIdentity)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppwszIdentity is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
else {
// Unpack configuration.
_EAPMETHOD_PEER_UI::config_type cfg(g_peer);
if (pConnectionData || !dwConnectionDataSize) {
const unsigned char *cursor = pConnectionData;
eapserial::unpack(cursor, cfg);
assert(cursor - pConnectionData <= (ptrdiff_t)dwConnectionDataSize);
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;
}
// Unpack configuration.
_EAPMETHOD_PEER_UI::identity_type usr(g_peer);
if (pUserData || !dwUserDataSize) {
const unsigned char *cursor = pUserData;
eapserial::unpack(cursor, usr);
assert(cursor - pUserData <= (ptrdiff_t)dwUserDataSize);
}
if ((dwResult = g_peer.invoke_identity_ui(hwndParent, dwFlags, cfg, usr, ppwszIdentity, ppEapError)) != ERROR_SUCCESS)
return dwResult;
// Allocate BLOB for user data.
assert(ppUserDataOut);
assert(pdwUserDataOutSize);
*pdwUserDataOutSize = (DWORD)eapserial::get_pk_size(usr);
*ppUserDataOut = g_peer.alloc_memory(*pdwUserDataOutSize);
if (!*ppUserDataOut) {
*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, 0, NULL, NULL, NULL, winstd::tstring_printf(_T(__FUNCTION__) _T(" Error allocating memory for configuration BLOB (%uB)."), *pdwUserDataOutSize).c_str(), NULL);
return dwResult;
}
// Pack BLOB to output.
unsigned char *cursor = *ppUserDataOut;
eapserial::pack(cursor, usr);
assert(cursor - *ppUserDataOut <= (ptrdiff_t)*pdwUserDataOutSize);
}
return dwResult;
@@ -400,53 +371,39 @@ DWORD WINAPI EapPeerInvokeInteractiveUI(
_Out_ EAP_ERROR **ppEapError)
{
DWORD dwResult = ERROR_SUCCESS;
winstd::actctx_activator actctx(g_act_ctx);
event_fn_auto_ret<DWORD> event_auto(g_peer.get_event_fn_auto(__FUNCTION__, dwResult));
actctx_activator actctx(g_act_ctx);
#ifdef _DEBUG
//Sleep(10000);
#endif
// Parameter check
if (!ppEapError)
dwResult = ERROR_INVALID_PARAMETER;
else if (!pEapType)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pEapType is NULL."), NULL);
return dwResult = ERROR_INVALID_PARAMETER;
assert(!*ppEapError);
if (!pEapType)
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pEapType is NULL.")));
else if (pEapType->eapType.type != EAPMETHOD_TYPE)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::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(), NULL);
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()));
else if (pEapType->dwAuthorId != 67532)
*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, winstd::wstring_printf(_T(__FUNCTION__) _T(" EAP author (%d) does not match the supported author (%d)."), (int)pEapType->dwAuthorId, (int)67532).c_str(), NULL);
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)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pUIContextData is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pUIContextData is NULL.")));
else if (!pdwDataFromInteractiveUISize)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" pdwDataFromInteractiveUISize is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwDataFromInteractiveUISize is NULL.")));
else if (!ppDataFromInteractiveUI)
*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" ppDataFromInteractiveUI is NULL."), NULL);
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppDataFromInteractiveUI is NULL.")));
else {
// Unpack request.
_EAPMETHOD_PEER_UI::interactive_request_type req;
if (pUIContextData || !dwUIContextDataSize) {
const unsigned char *cursor = pUIContextData;
eapserial::unpack(cursor, req);
assert(cursor - pUIContextData <= (ptrdiff_t)dwUIContextDataSize);
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;
}
_EAPMETHOD_PEER_UI::interactive_response_type res;
if ((dwResult = g_peer.invoke_interactive_ui(hwndParent, req, res, ppEapError)) != ERROR_SUCCESS)
return dwResult;
// Allocate BLOB for user data.
assert(ppDataFromInteractiveUI);
assert(pdwDataFromInteractiveUISize);
*pdwDataFromInteractiveUISize = (DWORD)eapserial::get_pk_size(res);
*ppDataFromInteractiveUI = g_peer.alloc_memory(*pdwDataFromInteractiveUISize);
if (!*ppDataFromInteractiveUI) {
*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, 0, NULL, NULL, NULL, winstd::tstring_printf(_T(__FUNCTION__) _T(" Error allocating memory for interactive response (%uB)."), *pdwDataFromInteractiveUISize).c_str(), NULL);
return dwResult;
}
// Pack BLOB to output.
unsigned char *cursor = *ppDataFromInteractiveUI;
eapserial::pack(cursor, res);
assert(cursor - *ppDataFromInteractiveUI <= (ptrdiff_t)*pdwDataFromInteractiveUISize);
}
return dwResult;

View File

@@ -1,329 +0,0 @@
/*
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::config_tls
//////////////////////////////////////////////////////////////////////
eap::config_tls::config_tls(_In_ module &mod) : config_method(mod)
{
}
eap::config_tls::config_tls(_In_ const config_tls &other) :
m_trusted_root_ca(other.m_trusted_root_ca),
m_server_names(other.m_server_names),
config_method(other)
{
}
eap::config_tls::config_tls(_Inout_ config_tls &&other) :
m_trusted_root_ca(std::move(other.m_trusted_root_ca)),
m_server_names(std::move(other.m_server_names)),
config_method(std::move(other))
{
}
eap::config_tls& eap::config_tls::operator=(_In_ const eap::config_tls &other)
{
if (this != &other) {
(config_method&)*this = other;
m_trusted_root_ca = other.m_trusted_root_ca;
m_server_names = other.m_server_names;
}
return *this;
}
eap::config_tls& eap::config_tls::operator=(_Inout_ eap::config_tls &&other)
{
if (this != &other) {
(config_method&&)*this = std::move(other);
m_trusted_root_ca = std::move(other.m_trusted_root_ca);
m_server_names = std::move(other.m_server_names);
}
return *this;
}
DWORD eap::config_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
{
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
DWORD dwResult;
HRESULT hr;
// <ServerSideCredential>
com_obj<IXMLDOMElement> pXmlElServerSideCredential;
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ServerSideCredential"), bstr(L"ServerSideCredential"), bstrNamespace, &pXmlElServerSideCredential)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <ServerSideCredential> element."), NULL);
return dwResult;
}
for (list<cert_context>::const_iterator i = m_trusted_root_ca.begin(), i_end = m_trusted_root_ca.end(); i != i_end; ++i) {
// <CA>
com_obj<IXMLDOMElement> pXmlElCA;
if ((dwResult = eapxml::create_element(pDoc, bstr(L"CA"), bstrNamespace, &pXmlElCA))) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <CA> element."), NULL);
return dwResult;
}
// <CA>/<format>
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElCA, bstr(L"format"), bstrNamespace, bstr(L"PEM"))) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <format> element."), NULL);
return dwResult;
}
// <CA>/<cert-data>
const cert_context &cc = *i;
if ((dwResult = eapxml::put_element_base64(pDoc, pXmlElCA, bstr(L"cert-data"), bstrNamespace, cc->pbCertEncoded, cc->cbCertEncoded)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <cert-data> element."), NULL);
return dwResult;
}
if (FAILED(hr = pXmlElServerSideCredential->appendChild(pXmlElCA, NULL))) {
*ppEapError = m_module.make_error(dwResult = HRESULT_CODE(hr), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error appending <CA> element."), NULL);
return dwResult;
}
}
// <ServerName>
for (list<string>::const_iterator i = m_server_names.begin(), i_end = m_server_names.end(); i != i_end; ++i) {
wstring str;
MultiByteToWideChar(CP_UTF8, 0, i->c_str(), (int)i->length(), str);
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElServerSideCredential, bstr(L"ServerName"), bstrNamespace, bstr(str))) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <ServerName> element."), NULL);
return dwResult;
}
}
return config_method::save(pDoc, pConfigRoot, ppEapError);
}
DWORD eap::config_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
m_trusted_root_ca.clear();
m_server_names.clear();
// <ServerSideCredential>
com_obj<IXMLDOMElement> pXmlElServerSideCredential;
if (eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ServerSideCredential"), &pXmlElServerSideCredential) == ERROR_SUCCESS) {
// <CA>
com_obj<IXMLDOMNodeList> pXmlListCAs;
long lCACount = 0;
if (eapxml::select_nodes(pXmlElServerSideCredential, bstr(L"eap-metadata:CA"), &pXmlListCAs) == ERROR_SUCCESS && SUCCEEDED(pXmlListCAs->get_length(&lCACount))) {
for (long j = 0; j < lCACount; j++) {
// Load CA certificate.
com_obj<IXMLDOMNode> pXmlElCA;
pXmlListCAs->get_item(j, &pXmlElCA);
bstr bstrFormat;
if (eapxml::get_element_value(pXmlElCA, bstr(L"eap-metadata:format"), &bstrFormat) == ERROR_SUCCESS) {
if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrFormat, bstrFormat.length(), L"PEM", -1, NULL, NULL, 0) == CSTR_EQUAL) {
vector<unsigned char> aData;
if (eapxml::get_element_base64(pXmlElCA, bstr(L"eap-metadata:cert-data"), aData) == ERROR_SUCCESS)
add_trusted_ca(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, aData.data(), (DWORD)aData.size());
}
}
}
}
// <ServerName>
com_obj<IXMLDOMNodeList> pXmlListServerIDs;
long lServerIDCount = 0;
if (eapxml::select_nodes(pXmlElServerSideCredential, bstr(L"eap-metadata:ServerName"), &pXmlListServerIDs) == ERROR_SUCCESS && SUCCEEDED(pXmlListServerIDs->get_length(&lServerIDCount))) {
for (long j = 0; j < lServerIDCount; j++) {
// Load server name (<ServerName>).
com_obj<IXMLDOMNode> pXmlElServerID;
pXmlListServerIDs->get_item(j, &pXmlElServerID);
bstr bstrServerID;
pXmlElServerID->get_text(&bstrServerID);
// Server names (FQDNs) are always ASCII. Hopefully. Convert them to UTF-8 anyway for consistent comparison. CP_ANSI varies.
string str;
WideCharToMultiByte(CP_UTF8, 0, bstrServerID, bstrServerID.length(), str, NULL, NULL);
m_server_names.push_back(str);
}
}
}
return config_method::load(pConfigRoot, ppEapError);
}
bool eap::config_tls::add_trusted_ca(_In_ DWORD dwCertEncodingType, _In_ const BYTE *pbCertEncoded, _In_ DWORD cbCertEncoded)
{
cert_context cert;
if (!cert.create(dwCertEncodingType, pbCertEncoded, cbCertEncoded)) {
// Invalid or unsupported certificate.
return false;
}
for (list<cert_context>::const_iterator i = m_trusted_root_ca.cbegin(), i_end = m_trusted_root_ca.cend();; ++i) {
if (i != i_end) {
if (*i == cert) {
// This certificate is already on the list.
return false;
}
} else {
// End of list reached. Append certificate.
m_trusted_root_ca.push_back(std::move(cert));
return true;
}
}
}
//////////////////////////////////////////////////////////////////////
// eap::credentials_tls
//////////////////////////////////////////////////////////////////////
eap::credentials_tls::credentials_tls(_In_ module &mod) : credentials(mod)
{
}
eap::credentials_tls::credentials_tls(_In_ const credentials_tls &other) :
m_cert_hash(other.m_cert_hash),
credentials(other)
{
}
eap::credentials_tls::credentials_tls(_Inout_ credentials_tls &&other) :
m_cert_hash(std::move(m_cert_hash)),
credentials(std::move(other))
{
}
eap::credentials_tls& eap::credentials_tls::operator=(_In_ const credentials_tls &other)
{
if (this != &other) {
(credentials&)*this = other;
m_cert_hash = other.m_cert_hash;
}
return *this;
}
eap::credentials_tls& eap::credentials_tls::operator=(_Inout_ credentials_tls &&other)
{
if (this != &other) {
(credentials&)*this = std::move(other);
m_cert_hash = std::move(other.m_cert_hash);
}
return *this;
}
void eap::credentials_tls::clear()
{
credentials::clear();
m_cert_hash.clear();
}
bool eap::credentials_tls::empty() const
{
return credentials::empty() && m_cert_hash.empty();
}
DWORD eap::credentials_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
assert(pConfigRoot);
UNREFERENCED_PARAMETER(ppEapError);
eapxml::get_element_hex(pConfigRoot, bstr(L"CertHash"), m_cert_hash);
return ERROR_SUCCESS;
}
DWORD eap::credentials_tls::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError) const
{
assert(pszTargetName);
assert(ppEapError);
DWORD dwResult;
tstring target(target_name(pszTargetName));
// Write credentials.
assert(m_cert_hash.size()*sizeof(char) < CRED_MAX_CREDENTIAL_BLOB_SIZE);
assert(m_identity.length() < CRED_MAX_USERNAME_LENGTH );
CREDENTIAL cred = {
0, // Flags
CRED_TYPE_GENERIC, // Type
(LPTSTR)target.c_str(), // TargetName
_T(""), // Comment
{ 0, 0 }, // LastWritten
(DWORD)m_cert_hash.size()*sizeof(char), // CredentialBlobSize
(LPBYTE)m_cert_hash.data(), // CredentialBlob
CRED_PERSIST_ENTERPRISE, // Persist
0, // AttributeCount
NULL, // Attributes
NULL, // TargetAlias
(LPTSTR)m_identity.c_str() // UserName
};
if (!CredWrite(&cred, 0)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredWrite failed."), NULL);
return dwResult;
}
return ERROR_SUCCESS;
}
DWORD eap::credentials_tls::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError)
{
assert(pszTargetName && _tcslen(pszTargetName) < CRED_MAX_GENERIC_TARGET_NAME_LENGTH);
DWORD dwResult;
// Read credentials.
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
*ppEapError = m_module.make_error(dwResult = GetLastError(), 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" CredRead failed."), NULL);
return dwResult;
}
if (cred->UserName)
m_identity = cred->UserName;
else
m_identity.clear();
m_cert_hash.assign(cred->CredentialBlob, cred->CredentialBlob + cred->CredentialBlobSize);
return ERROR_SUCCESS;
}

View File

@@ -1,375 +0,0 @@
/*
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>
#pragma comment(lib, "Msi.lib")
#pragma comment(lib, "msxml6.lib")
using namespace std;
using namespace winstd;
//////////////////////////////////////////////////////////////////////
// eap::config_ttls
//////////////////////////////////////////////////////////////////////
eap::config_ttls::config_ttls(_In_ module &mod) :
m_inner(NULL),
config_tls(mod)
{
}
eap::config_ttls::config_ttls(const _In_ config_ttls &other) :
m_inner(other.m_inner ? (config_method*)other.m_inner->clone() : NULL),
config_tls(other)
{
}
eap::config_ttls::config_ttls(_Inout_ config_ttls &&other) :
m_inner(other.m_inner),
config_tls(std::move(other))
{
other.m_inner = NULL;
}
eap::config_ttls::~config_ttls()
{
if (m_inner)
delete m_inner;
}
eap::config_ttls& eap::config_ttls::operator=(const _In_ config_ttls &other)
{
if (this != &other) {
(config_tls&)*this = other;
if (m_inner) delete m_inner;
m_inner = other.m_inner ? (config_method*)other.m_inner->clone() : NULL;
}
return *this;
}
eap::config_ttls& eap::config_ttls::operator=(_Inout_ config_ttls &&other)
{
if (this != &other) {
(config_tls&&)*this = std::move(other);
if (m_inner) delete m_inner;
m_inner = other.m_inner;
other.m_inner = NULL;
}
return *this;
}
DWORD eap::config_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
{
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
DWORD dwResult;
// <InnerAuthenticationMethod>
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), bstr(L"InnerAuthenticationMethod"), bstrNamespace, &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <InnerAuthenticationMethod> element."), NULL);
return dwResult;
}
if (dynamic_cast<const config_pap*>(m_inner)) {
// <InnerAuthenticationMethod>/<NonEAPAuthMethod>
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElInnerAuthenticationMethod, bstr(L"NonEAPAuthMethod"), bstrNamespace, bstr(L"PAP"))) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error creating <NonEAPAuthMethod> element."), NULL);
return dwResult;
}
// <InnerAuthenticationMethod>/...
if ((dwResult = m_inner->save(pDoc, pXmlElInnerAuthenticationMethod, ppEapError)) != ERROR_SUCCESS)
return dwResult;
} else
return dwResult = ERROR_NOT_SUPPORTED;
return config_tls::save(pDoc, pConfigRoot, ppEapError);
}
DWORD eap::config_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
assert(ppEapError);
DWORD dwResult;
// Load inner authentication configuration (<InnerAuthenticationMethod>).
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
if ((dwResult = eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), NULL);
return dwResult;
}
// Determine inner authentication type (<EAPMethod> and <NonEAPAuthMethod>).
//DWORD dwMethodID;
bstr bstrMethod;
/*if (eapxml::get_element_value(pXmlElInnerAuthenticationMethod, bstr(L"eap-metadata:EAPMethod"), &dwMethodID) == ERROR_SUCCESS &&
dwMethodID == EAP_TYPE_MSCHAPV2)
{
// MSCHAPv2
// TODO: Add MSCHAPv2 support.
return ERROR_NOT_SUPPORTED;
} else*/ if (eapxml::get_element_value(pXmlElInnerAuthenticationMethod, bstr(L"eap-metadata:NonEAPAuthMethod"), &bstrMethod) == ERROR_SUCCESS &&
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrMethod, bstrMethod.length(), L"PAP", -1, NULL, NULL, 0) == CSTR_EQUAL)
{
// PAP
assert(!m_inner);
m_inner = new eap::config_pap(m_module);
if ((dwResult = m_inner->load(pXmlElInnerAuthenticationMethod, ppEapError)) != ERROR_SUCCESS)
return dwResult;
} else {
*ppEapError = m_module.make_error(dwResult = ERROR_NOT_SUPPORTED, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Unsupported inner authentication method."), NULL);
return dwResult;
}
return config_tls::load(pConfigRoot, ppEapError);
}
//////////////////////////////////////////////////////////////////////
// eap::credentials_ttls
//////////////////////////////////////////////////////////////////////
eap::credentials_ttls::credentials_ttls(_In_ module &mod) : credentials_tls(mod)
{
}
eap::credentials_ttls::credentials_ttls(_In_ const credentials_ttls &other) :
m_inner(other.m_inner ? (credentials*)other.m_inner->clone() : NULL),
credentials_tls(other)
{
}
eap::credentials_ttls::credentials_ttls(_Inout_ credentials_ttls &&other) :
m_inner(other.m_inner),
credentials_tls(std::move(other))
{
other.m_inner = NULL;
}
eap::credentials_ttls& eap::credentials_ttls::operator=(_In_ const credentials_ttls &other)
{
if (this != &other) {
(credentials_tls&)*this = other;
if (m_inner) delete m_inner;
m_inner = other.m_inner ? (credentials*)other.m_inner->clone() : NULL;
}
return *this;
}
eap::credentials_ttls& eap::credentials_ttls::operator=(_Inout_ credentials_ttls &&other)
{
if (this != &other) {
(credentials_tls&)*this = std::move(other);
if (m_inner) delete m_inner;
m_inner = other.m_inner;
other.m_inner = NULL;
}
return *this;
}
void eap::credentials_ttls::clear()
{
credentials_tls::clear();
if (m_inner)
m_inner->clear();
}
bool eap::credentials_ttls::empty() const
{
return credentials_tls::empty() && (!m_inner || m_inner->empty());
}
DWORD eap::credentials_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
{
assert(pConfigRoot);
DWORD dwResult;
if ((dwResult = credentials_tls::load(pConfigRoot, ppEapError)) != ERROR_SUCCESS)
return dwResult;
if (m_inner) {
com_obj<IXMLDOMNode> pXmlElInnerAuthenticationMethod;
if ((dwResult = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
*ppEapError = m_module.make_error(dwResult = ERROR_NOT_FOUND, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), NULL);
return dwResult;
}
if ((dwResult = m_inner->load(pXmlElInnerAuthenticationMethod, ppEapError)) != ERROR_SUCCESS)
return dwResult;
}
return ERROR_SUCCESS;
}
DWORD eap::credentials_ttls::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError) const
{
DWORD dwResult;
if ((dwResult = credentials_tls::store(pszTargetName, ppEapError)) != ERROR_SUCCESS)
return dwResult;
if (m_inner) {
if ((dwResult = m_inner->store(pszTargetName, ppEapError)) != ERROR_SUCCESS)
return dwResult;
}
return ERROR_SUCCESS;
}
DWORD eap::credentials_ttls::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError)
{
DWORD dwResult;
if ((dwResult = credentials_tls::retrieve(pszTargetName, ppEapError)) != ERROR_SUCCESS)
return dwResult;
if (m_inner) {
if ((dwResult = m_inner->retrieve(pszTargetName, ppEapError)) != ERROR_SUCCESS)
return dwResult;
}
return ERROR_SUCCESS;
}
//////////////////////////////////////////////////////////////////////
// eap::session_ttls
//////////////////////////////////////////////////////////////////////
eap::session_ttls::session_ttls() : session()
{
}
//////////////////////////////////////////////////////////////////////
// eap::peer_ttls
//////////////////////////////////////////////////////////////////////
eap::peer_ttls::peer_ttls() : peer()
{
}
DWORD eap::peer_ttls::initialize(_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(ppEapError);
// MSI's feature completeness check removed: It might invoke UI (prompt user for missing MSI),
// which would be disasterous in EapHost system service.
#if 0
// Perform the Microsoft Installer's feature completeness check manually.
// If execution got this far in the first place (dependent DLLs are present and loadable).
// Furthermore, this increments program usage counter.
if (MsiQueryFeatureState(_T(PRODUCT_VERSION_GUID), _T("featEAPTTLS")) != INSTALLSTATE_UNKNOWN)
MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featEAPTTLS"));
#endif
return ERROR_SUCCESS;
}
DWORD eap::peer_ttls::shutdown(_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(ppEapError);
return ERROR_SUCCESS;
}
DWORD eap::peer_ttls::get_identity(
_In_ DWORD dwFlags,
_In_ DWORD dwConnectionDataSize,
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
_In_ DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData,
_In_ HANDLE hTokenImpersonateUser,
_Out_ BOOL *pfInvokeUI,
_Out_ DWORD *pdwUserDataOutSize,
_Out_ BYTE **ppUserDataOut,
_Out_ WCHAR **ppwszIdentity,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(dwFlags);
UNREFERENCED_PARAMETER(dwConnectionDataSize);
UNREFERENCED_PARAMETER(pConnectionData);
UNREFERENCED_PARAMETER(dwUserDataSize);
UNREFERENCED_PARAMETER(pUserData);
UNREFERENCED_PARAMETER(hTokenImpersonateUser);
UNREFERENCED_PARAMETER(pfInvokeUI);
UNREFERENCED_PARAMETER(pdwUserDataOutSize);
UNREFERENCED_PARAMETER(ppUserDataOut);
UNREFERENCED_PARAMETER(ppwszIdentity);
UNREFERENCED_PARAMETER(ppEapError);
DWORD dwResult = ERROR_NOT_SUPPORTED;
ETW_FN_DWORD(dwResult);
return dwResult;
}
DWORD eap::peer_ttls::get_method_properties(
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ HANDLE hUserImpersonationToken,
_In_ DWORD dwEapConnDataSize,
_In_count_(dwEapConnDataSize) const BYTE *pEapConnData,
_In_ DWORD dwUserDataSize,
_In_count_(dwUserDataSize) const BYTE *pUserData,
_Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray,
_Out_ EAP_ERROR **ppEapError) const
{
UNREFERENCED_PARAMETER(dwVersion);
UNREFERENCED_PARAMETER(dwFlags);
UNREFERENCED_PARAMETER(hUserImpersonationToken);
UNREFERENCED_PARAMETER(dwEapConnDataSize);
UNREFERENCED_PARAMETER(pEapConnData);
UNREFERENCED_PARAMETER(dwUserDataSize);
UNREFERENCED_PARAMETER(pUserData);
UNREFERENCED_PARAMETER(pMethodPropertyArray);
UNREFERENCED_PARAMETER(ppEapError);
DWORD dwResult = ERROR_NOT_SUPPORTED;
ETW_FN_DWORD(dwResult);
return dwResult;
}

View File

@@ -1,259 +0,0 @@
/*
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>
//////////////////////////////////////////////////////////////////////
// eap::peer_ttls_ui
//////////////////////////////////////////////////////////////////////
eap::peer_ttls_ui::peer_ttls_ui() : peer_ui<eap::config_ttls, eap::credentials_ttls, int, int>()
{
}
DWORD eap::peer_ttls_ui::invoke_config_ui(
_In_ HWND hwndParent,
_Inout_ config_type &cfg,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(ppEapError);
// Initialize application.
new wxApp();
wxEntryStart(m_instance);
int result;
{
// Create wxWidget-approved parent window.
wxWindow parent;
parent.SetHWND((WXHWND)hwndParent);
parent.AdoptAttributesFromHWND();
wxTopLevelWindows.Append(&parent);
// Create and launch configuration dialog.
wxEAPConfigDialog<config_ttls, wxEAPTTLSConfig> dlg(cfg, &parent);
result = dlg.ShowModal();
wxTopLevelWindows.DeleteObject(&parent);
parent.SetHWND((WXHWND)NULL);
}
// Clean-up and return.
wxEntryCleanup();
return result == wxID_OK ? ERROR_SUCCESS : ERROR_CANCELLED;
}
DWORD eap::peer_ttls_ui::invoke_identity_ui(
_In_ HWND hwndParent,
_In_ DWORD dwFlags,
_Inout_ config_type &cfg,
_Inout_ identity_type &usr,
_Out_ LPWSTR *ppwszIdentity,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(dwFlags);
UNREFERENCED_PARAMETER(cfg);
UNREFERENCED_PARAMETER(usr);
UNREFERENCED_PARAMETER(ppwszIdentity);
UNREFERENCED_PARAMETER(ppEapError);
InitCommonControls();
MessageBox(hwndParent, _T(PRODUCT_NAME_STR) _T(" credential prompt goes here!"), _T(PRODUCT_NAME_STR) _T(" Credentials"), MB_OK);
return ERROR_SUCCESS;
}
DWORD eap::peer_ttls_ui::invoke_interactive_ui(
_In_ HWND hwndParent,
_In_ const interactive_request_type &req,
_Out_ interactive_response_type &res,
_Out_ EAP_ERROR **ppEapError)
{
UNREFERENCED_PARAMETER(req);
UNREFERENCED_PARAMETER(res);
UNREFERENCED_PARAMETER(ppEapError);
InitCommonControls();
MessageBox(hwndParent, _T(PRODUCT_NAME_STR) _T(" interactive UI goes here!"), _T(PRODUCT_NAME_STR) _T(" Prompt"), MB_OK);
return ERROR_SUCCESS;
}
//////////////////////////////////////////////////////////////////////
// wxEAPTTLSConfigPanel
//////////////////////////////////////////////////////////////////////
wxEAPTTLSConfigPanel::wxEAPTTLSConfigPanel(eap::config_ttls &cfg, wxWindow* parent) :
m_cfg(cfg),
wxEAPTTLSConfigPanelBase(parent)
{
// Load and set icon.
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
wxSetIconFromResource(m_outer_identity_icon, m_icon, m_shell32, MAKEINTRESOURCE(265));
}
bool wxEAPTTLSConfigPanel::TransferDataToWindow()
{
wxCHECK(wxEAPTTLSConfigPanelBase::TransferDataToWindow(), false);
// Populate identity controls.
if (m_cfg.m_anonymous_identity.empty()) {
m_outer_identity_same->SetValue(true);
m_outer_identity_custom_val->Enable(false);
} else if (m_cfg.m_anonymous_identity == L"@") {
m_outer_identity_empty->SetValue(true);
m_outer_identity_custom_val->Enable(false);
} else {
m_outer_identity_custom->SetValue(true);
m_outer_identity_custom_val->Enable(true);
m_outer_identity_custom_val->SetValue(m_cfg.m_anonymous_identity);
}
return true;
}
bool wxEAPTTLSConfigPanel::TransferDataFromWindow()
{
if (m_outer_identity_same->GetValue())
m_cfg.m_anonymous_identity.clear();
else if (m_outer_identity_empty->GetValue())
m_cfg.m_anonymous_identity = L"@";
else
m_cfg.m_anonymous_identity = m_outer_identity_custom_val->GetValue();
return wxEAPTTLSConfigPanelBase::TransferDataFromWindow();
}
void wxEAPTTLSConfigPanel::OnOuterIdentityCustom(wxCommandEvent& event)
{
UNREFERENCED_PARAMETER(event);
m_outer_identity_custom_val->Enable(m_outer_identity_custom->GetValue());
}
//////////////////////////////////////////////////////////////////////
// wxEAPTTLSConfig
//////////////////////////////////////////////////////////////////////
wxEAPTTLSConfig::wxEAPTTLSConfig(eap::config_ttls &cfg, LPCTSTR pszCredTarget, wxWindow* parent) :
m_cfg(cfg),
m_cfg_pap(cfg.m_module),
wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL)
{
wxBoxSizer* sb_content;
sb_content = new wxBoxSizer( wxVERTICAL );
m_outer_title = new wxStaticText(this, wxID_ANY, _("Outer Authentication"), wxDefaultPosition, wxDefaultSize, 0);
m_outer_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
m_outer_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) );
sb_content->Add(m_outer_title, 0, wxALL|wxALIGN_RIGHT, 5);
m_outer_identity = new wxEAPTTLSConfigPanel(m_cfg, this);
sb_content->Add(m_outer_identity, 0, wxALL|wxEXPAND, 5);
m_tls = new wxEAPTLSConfigPanel(m_cfg, pszCredTarget, this);
sb_content->Add(m_tls, 0, wxALL|wxEXPAND, 5);
sb_content->Add(20, 20, 1, wxEXPAND, 5);
m_inner_title = new wxStaticText(this, wxID_ANY, _("Inner Authentication"), wxDefaultPosition, wxDefaultSize, 0);
m_inner_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
m_inner_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) );
sb_content->Add(m_inner_title, 0, wxALL|wxALIGN_RIGHT, 5);
m_inner_type = new wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT);
m_inner_type->SetToolTip( _("Select inner authentication method from the list") );
m_inner_type->AddPage(new wxPAPConfigPanel(m_cfg_pap, pszCredTarget, m_inner_type), _("PAP"));
sb_content->Add(m_inner_type, 0, wxALL|wxEXPAND, 5);
wxSize size = sb_content->CalcMin();
if (size.y > 500) {
// Increase the width to allow space for vertical scroll bar (to prevent horizontal one) and truncate the height.
size.x += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this);
size.y = 500;
}
this->SetMinSize(size);
this->SetScrollRate(5, 5);
this->SetSizer(sb_content);
this->Layout();
m_outer_identity->SetFocusFromKbd();
// Connect Events
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPTTLSConfig::OnInitDialog));
}
wxEAPTTLSConfig::~wxEAPTTLSConfig()
{
// Disconnect Events
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPTTLSConfig::OnInitDialog));
}
bool wxEAPTTLSConfig::TransferDataToWindow()
{
eap::config_pap *cfg_pap = dynamic_cast<eap::config_pap*>(m_cfg.m_inner);
if (cfg_pap) {
m_cfg_pap = *cfg_pap;
m_inner_type->SetSelection(0); // 0=PAP
} else
wxFAIL_MSG(wxT("Unsupported inner authentication method type."));
return wxScrolledWindow::TransferDataToWindow();
}
bool wxEAPTTLSConfig::TransferDataFromWindow()
{
wxCHECK(wxScrolledWindow::TransferDataFromWindow(), false);
switch (m_inner_type->GetSelection()) {
case 0: // 0=PAP
delete m_cfg.m_inner;
m_cfg.m_inner = new eap::config_pap(m_cfg_pap);
break;
default:
wxFAIL_MSG(wxT("Unsupported inner authentication method type."));
}
return true;
}
void wxEAPTTLSConfig::OnInitDialog(wxInitDialogEvent& event)
{
// Forward the event to child panels.
m_outer_identity->GetEventHandler()->ProcessEvent(event);
m_tls->GetEventHandler()->ProcessEvent(event);
for (wxWindowList::compatibility_iterator inner = m_inner_type->GetChildren().GetFirst(); inner; inner = inner->GetNext())
inner->GetData()->GetEventHandler()->ProcessEvent(event);
}

78
EventMonitor/App.cpp Normal file
View File

@@ -0,0 +1,78 @@
/*
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"
#if defined(__WXMSW__)
#pragma comment(lib, "msi.lib")
#endif
//////////////////////////////////////////////////////////////////////////
// wxEventMonitorApp
//////////////////////////////////////////////////////////////////////////
wxIMPLEMENT_APP(wxEventMonitorApp);
wxEventMonitorApp::wxEventMonitorApp() : wxApp()
{
}
bool wxEventMonitorApp::OnInit()
{
#if defined(__WXMSW__)
// To compensate migration to non-advertised shortcut, do the Microsoft Installer's feature completeness check manually.
// If execution got this far in the first place (EXE and dependent DLLs are present and loadable).
// Furthermore, this increments program usage counter.
if (::MsiQueryFeatureState(_T(PRODUCT_VERSION_GUID), _T("featEventMonitor")) != INSTALLSTATE_UNKNOWN)
::MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featEventMonitor"));
#endif
wxInitializeConfig();
if (!wxApp::OnInit())
return false;
if (wxInitializeLocale(m_locale)) {
//wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("EventMonitor")));
}
#ifdef __WXMSW__
// Find EventMonitor window if already running.
HWND hWnd = ::FindWindow(_T("wxWindowNR"), _("Event Monitor"));
if (hWnd) {
if (::IsIconic(hWnd))
::SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(hWnd);
::SetForegroundWindow(hWnd);
// Not an error condition actually; Just nothing else to do...
return false;
}
#endif
m_mainWnd = new wxEventMonitorFrame(NULL);
wxPersistentRegisterAndRestore<wxEventMonitorFrame>(m_mainWnd);
m_mainWnd->Show();
return true;
}

61
EventMonitor/App.h Normal file
View File

@@ -0,0 +1,61 @@
/*
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/>.
*/
///
/// EventMonitor application
///
class wxEventMonitorApp;
#pragma once
#include "Frame.h"
#include <wx/app.h>
#include <wx/config.h>
#include <wx/intl.h>
class wxEventMonitorApp : public wxApp
{
public:
wxEventMonitorApp();
///
/// Called when application initializes.
///
/// \returns
/// - \c true if initialization succeeded
/// - \c false otherwise
///
virtual bool OnInit();
///
/// Called when application uninitializes.
///
/// \returns Result code to return to OS
///
//virtual int OnExit();
public:
wxEventMonitorFrame *m_mainWnd; ///< Main window
wxLocale m_locale; ///< Current locale
};
wxDECLARE_APP(wxEventMonitorApp);

1129
EventMonitor/ETWLog.cpp Normal file

File diff suppressed because it is too large Load Diff

226
EventMonitor/ETWLog.h Normal file
View File

@@ -0,0 +1,226 @@
/*
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 <wx/event.h>
///
/// Maximum number of event records kept
///
#define wxETWEVENT_RECORDS_MAX 1000000
///
/// ETW event
///
class wxETWEvent;
wxDECLARE_EVENT(wxEVT_ETW_EVENT, wxETWEvent);
#define wxETWEventHandler(func) wxEVENT_HANDLER_CAST(wxETWEventFunction, func)
#define EVT_ETW_EVENT(func) wx__DECLARE_EVT0(wxEVT_ETW_EVENT, wxETWEventHandler(func))
///
/// Event trace processor
///
class wxEventTraceProcessorThread;
///
/// Event list control
///
class wxETWListCtrl;
///
/// Supports saving/restoring wxETWListCtrl state
///
class wxPersistentETWListCtrl;
#pragma once
#include <wx/listctrl.h>
#include <wx/persist/window.h>
#include <wx/thread.h>
#include <WinStd/ETW.h>
#include <memory>
#include <vector>
#include <set>
class wxETWEvent : public wxEvent
{
public:
wxETWEvent(wxEventType type = wxEVT_NULL, const EVENT_RECORD &record = s_record_null);
wxETWEvent(const wxETWEvent& event);
virtual wxEvent *Clone() const { return new wxETWEvent(*this); }
inline const winstd::event_rec& GetRecord() const { return m_record; }
inline winstd::event_rec& GetRecord() { return m_record; }
protected:
bool DoSetExtendedData(size_t extended_data_count, const EVENT_HEADER_EXTENDED_DATA_ITEM *extended_data);
bool DoSetUserData(size_t user_data_length, const void *user_data);
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxETWEvent)
public:
static const EVENT_RECORD s_record_null;
protected:
winstd::event_rec m_record; ///< ETW event record
};
typedef void (wxEvtHandler::*wxETWEventFunction)(wxETWEvent&);
class wxEventTraceProcessorThread : public wxThread
{
public:
wxEventTraceProcessorThread(wxEvtHandler *parent, const wxArrayString &sessions);
virtual ~wxEventTraceProcessorThread();
void Abort();
protected:
virtual ExitCode Entry();
private:
static VOID WINAPI EventRecordCallback(PEVENT_RECORD pEvent);
protected:
std::vector<TRACEHANDLE> m_traces; ///< An array of tracing sessions this thread is monitoring
wxEvtHandler *m_parent; ///< Pointer to the event handler this thread is sending record notifications
};
class wxETWListCtrl : public wxListCtrl
{
protected:
///
/// Functor for GUID comparison
///
struct less_guid : public std::binary_function<GUID, GUID, bool>
{
bool operator()(const GUID &a, const GUID &b) const
{
if (a.Data1 < b.Data1) return true;
if (a.Data1 > b.Data1) return false;
if (a.Data2 < b.Data2) return true;
if (a.Data2 > b.Data2) return false;
if (a.Data3 < b.Data3) return true;
if (a.Data3 > b.Data3) return false;
if (memcmp(a.Data4, b.Data4, sizeof(a.Data4)) < 0) return true;
return false;
}
};
///
/// A set of GUIDs
///
typedef std::set<GUID, less_guid> guidset;
public:
wxETWListCtrl(
wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = wxListCtrlNameStr);
virtual ~wxETWListCtrl();
inline bool IsEmpty() const { return m_rec_db.empty(); }
void CopySelected() const;
void CopyAll() const;
void ClearAll();
void SelectAll();
void SelectNone();
void RebuildItems();
inline bool IsSourceEnabled(const GUID &guid) const
{
return m_sources.find(guid) != m_sources.end();
}
inline void EnableSource(const GUID &guid, bool enable = true)
{
guidset::iterator s = m_sources.find(guid);
if (enable) {
if (s == m_sources.end()) {
m_sources.insert(guid);
RebuildItems();
}
} else {
if (s != m_sources.end()) {
m_sources.erase(s);
RebuildItems();
}
}
}
friend class wxPersistentETWListCtrl; // Allow saving/restoring window state.
protected:
bool IsVisible(const EVENT_RECORD &rec) const;
void FormatRow(const winstd::event_rec &rec, std::string &rowA, std::wstring &rowW) const;
bool CopyToClipboard(const std::string &dataA, const std::wstring &dataW) const;
virtual wxListItemAttr *OnGetItemAttr(long item) const;
virtual wxString OnGetItemText(long item, long column) const;
virtual wxString OnGetItemText(const winstd::event_rec &rec, long column) const;
void OnETWEvent(wxETWEvent& event);
DECLARE_EVENT_TABLE()
public:
bool m_scroll_auto; ///< Is autoscrolling enabled?
UCHAR m_level; ///< Shows messages up to this level of verboseness
static const GUID s_provider_eaphost; ///< EapHost event provider ID
static const GUID s_provider_schannel; ///< Schannel event provider ID
protected:
winstd::event_session m_session; ///< Event session
wxEventTraceProcessorThread *m_proc; ///< Processor thread
guidset m_sources; ///< Set of enabled sources
wxListItemAttr m_item_attr[2][4]; ///< Current item attributes
winstd::vector_queue<winstd::event_rec> m_rec_db; ///< Event record database
winstd::vector_queue<size_t> m_rec_idx; ///< Event record database indices of shown records
size_t m_col_format_width[5]; ///< Column widths for pre-formatted row display (0 = unlimited)
};
class wxPersistentETWListCtrl : public wxPersistentWindow<wxETWListCtrl>
{
public:
wxPersistentETWListCtrl(wxETWListCtrl *wnd);
virtual wxString GetKind() const;
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxETWListCtrl *wnd)
{
return new wxPersistentETWListCtrl(wnd);
}

View File

@@ -0,0 +1,17 @@
<?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>
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\lib\WinStd\include;..\lib\wxExtend\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Binary file not shown.

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<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|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EventMonitor</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</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\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="EventMonitor.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\x64.props" />
<Import Project="..\include\Debug.props" />
<Import Project="EventMonitor.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\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="EventMonitor.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\x64.props" />
<Import Project="..\include\Release.props" />
<Import Project="EventMonitor.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemGroup>
<ResourceCompile Include="EventMonitor.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.h" />
<ClInclude Include="ETWLog.h" />
<ClInclude Include="Frame.h" />
<ClInclude Include="LogPanel.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="wxEventMonitor_UI.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="App.cpp" />
<ClCompile Include="ETWLog.cpp" />
<ClCompile Include="Frame.cpp" />
<ClCompile Include="LogPanel.cpp" />
<ClCompile Include="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)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="wxEventMonitor_UI.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\Events\build\Events.vcxproj">
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib.vcxproj">
<Project>{d3e29951-d9f5-486d-a167-20ae8e90b1fa}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="locale\EventMonitor.pot" />
<None Include="res\EventMonitor.ico" />
<None Include="wxEventMonitor_UI.fbp" />
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\include\xgettext.targets" />
</ImportGroup>
</Project>

View File

@@ -0,0 +1,82 @@
<?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>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Resource Files\Localization">
<UniqueIdentifier>{e43059ae-37ac-4b28-84fb-18d1b3972b30}</UniqueIdentifier>
<Extensions>po;pot</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EventMonitor.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="App.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="wxEventMonitor_UI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Frame.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="LogPanel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ETWLog.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="App.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wxEventMonitor_UI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Frame.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LogPanel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ETWLog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="wxEventMonitor_UI.fbp">
<Filter>Resource Files</Filter>
</None>
<None Include="locale\EventMonitor.pot">
<Filter>Resource Files\Localization</Filter>
</None>
<None Include="res\EventMonitor.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
</Project>

439
EventMonitor/Frame.cpp Normal file
View File

@@ -0,0 +1,439 @@
/*
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"
//////////////////////////////////////////////////////////////////////////
// wxEventMonitorFrame
//////////////////////////////////////////////////////////////////////////
wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) :
wxFrame(parent, id, title, pos, size, style, name)
{
this->SetSizeHints(wxSize(150,150), wxDefaultSize);
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
// Load main window icons.
#ifdef __WINDOWS__
wxIconBundle icons;
icons.AddIcon(wxIcon(wxT("00_EventMonitor.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
icons.AddIcon(wxIcon(wxT("00_EventMonitor.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
this->SetIcons(icons);
#else
this->SetIcon(wxIcon(wxICON(00_EventMonitor.ico)));
#endif
wxString prod_name(wxT(PRODUCT_NAME_STR));
wxString prod_status_bar;
prod_status_bar.Printf(_("Toggles display of %s records"), wxT(PRODUCT_NAME_STR));
winstd::library lib_comres;
lib_comres.load(_T("comres.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);
winstd::library lib_ieframe;
lib_ieframe.load(_T("ieframe.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);
winstd::library lib_shell32;
lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);
wxSize size_menu(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
wxSize size_tool(size_menu);
m_menubar = new wxMenuBar(0);
m_menuProgram = new wxMenu();
wxMenuItem* m_menuItemExit;
m_menuItemExit = new wxMenuItem(m_menuProgram, wxID_EXIT, _("E&xit") + wxT('\t') + wxT("Alt+F4"), _("Quits this program"), wxITEM_NORMAL);
m_menuItemExit->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(240), size_menu));
m_menuProgram->Append(m_menuItemExit);
m_menubar->Append(m_menuProgram, _("&Program"));
m_menuEdit = new wxMenu();
wxMenuItem* m_menuEditCopy;
m_menuEditCopy = new wxMenuItem(m_menuEdit, wxID_COPY, wxEmptyString , wxEmptyString, wxITEM_NORMAL);
m_menuEditCopy->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(243), size_menu));
m_menuEdit->Append(m_menuEditCopy);
wxMenuItem* m_menuEditCopyAll;
m_menuEditCopyAll = new wxMenuItem(m_menuEdit, wxID_COPY_ALL, _("Copy A&ll") + wxT('\t') + wxT("Ctrl+Shift+C"), _("Copies all records to clipboard (including hidden)"), wxITEM_NORMAL);
m_menuEditCopyAll->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(133), size_menu));
m_menuEdit->Append(m_menuEditCopyAll);
wxMenuItem* m_menuEditClear;
m_menuEditClear = new wxMenuItem(m_menuEdit, wxID_CLEAR, _("Clear"), _("Clears all records from the log"), wxITEM_NORMAL);
m_menuEditClear->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(200), size_menu));
m_menuEdit->Append(m_menuEditClear);
m_menuEdit->AppendSeparator();
wxMenuItem* m_menuEditSelectAll;
m_menuEditSelectAll = new wxMenuItem(m_menuEdit, wxID_SELECT_ALL, _("Select &All") + wxT('\t') + wxT("Ctrl+A"), _("Selects all visible records"), wxITEM_NORMAL);
m_menuEdit->Append(m_menuEditSelectAll);
wxMenuItem* m_menuEditSelectNone;
m_menuEditSelectNone = new wxMenuItem(m_menuEdit, wxID_SELECT_NONE, _("Select &None") , _("Clears record selection"), wxITEM_NORMAL);
m_menuEdit->Append(m_menuEditSelectNone);
m_menubar->Append(m_menuEdit, _("&Edit"));
m_menuView = new wxMenu();
wxMenuItem* m_menuViewScrollAuto;
m_menuViewScrollAuto = new wxMenuItem(m_menuView, wxID_VIEW_SCROLL_AUTO, _("Auto &Scroll") + wxT('\t') + wxT("Ctrl+S"), _("Automatically scrolls to the most recent records as they come-in"), wxITEM_CHECK);
//m_menuViewScrollAuto->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(231), size_menu));
m_menuView->Append(m_menuViewScrollAuto);
m_menuView->AppendSeparator();
wxMenuItem* m_menuViewSourceEapHost;
m_menuViewSourceEapHost = new wxMenuItem(m_menuView, wxID_VIEW_SOURCE_EAPHOST, wxT("EapHost"), wxString::Format(_("Toggles display of %s records"), wxT("EapHost")), wxITEM_CHECK);
//m_menuViewSourceEapHost->SetBitmaps(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(273), size_menu));
m_menuView->Append(m_menuViewSourceEapHost);
wxMenuItem* m_menuViewSourceSchannel;
m_menuViewSourceSchannel = new wxMenuItem(m_menuView, wxID_VIEW_SOURCE_SCHANNEL, wxT("Schannel"), wxString::Format(_("Toggles display of %s records"), wxT("Schannel")), wxITEM_CHECK);
//m_menuViewSourceSchannel->SetBitmaps(wxLoadIconFromResource(lib_ieframe, MAKEINTRESOURCE(36870), size_menu));
m_menuView->Append(m_menuViewSourceSchannel);
m_menuViewSourceProduct = new wxMenuItem(m_menuView, wxID_VIEW_SOURCE_PRODUCT, prod_name , prod_status_bar, wxITEM_CHECK);
//m_menuViewSourceProduct->SetBitmaps(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, size_menu.GetWidth(), size_menu.GetHeight()));
m_menuView->Append(m_menuViewSourceProduct);
m_menuView->AppendSeparator();
m_menuViewLevelVerbose = new wxMenuItem(m_menuView, wxID_VIEW_LEVEL_VERBOSE, _("Verbose") + wxT('\t') + wxT("Ctrl+1"), _("Displays all levels of records"), wxITEM_RADIO);
//m_menuViewLevelVerbose->SetBitmaps(wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2863), size_menu));
m_menuView->Append(m_menuViewLevelVerbose);
m_menuViewLevelInformation = new wxMenuItem(m_menuView, wxID_VIEW_LEVEL_INFORMATION, _("Informational") + wxT('\t') + wxT("Ctrl+2"), _("Displays all records up to informational level"), wxITEM_RADIO);
//m_menuViewLevelInformation->SetBitmaps(wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2859), size_menu));
m_menuView->Append(m_menuViewLevelInformation);
m_menuViewLevelWarning = new wxMenuItem(m_menuView, wxID_VIEW_LEVEL_WARNING, _("Warning") + wxT('\t') + wxT("Ctrl+3"), _("Displays all records up to warning level"), wxITEM_RADIO);
//m_menuViewLevelWarning->SetBitmaps(wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2865), size_menu));
m_menuView->Append(m_menuViewLevelWarning);
m_menuViewLevelError = new wxMenuItem(m_menuView, wxID_VIEW_LEVEL_ERROR, _("Error") + wxT('\t') + wxT("Ctrl+4"), _("Displays error level records only"), wxITEM_RADIO);
//m_menuViewLevelError->SetBitmaps(wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2861), size_menu));
m_menuView->Append(m_menuViewLevelError);
m_menuView->AppendSeparator();
wxMenuItem* m_menuViewToolbarEdit;
m_menuViewToolbarEdit = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_EDIT, wxString::Format(_("%s toolbar"), _("&Edit")), wxString::Format(_("Toggles display of %s toolbar"), _("View")), wxITEM_CHECK);
m_menuView->Append(m_menuViewToolbarEdit);
wxMenuItem* m_menuViewToolbarView;
m_menuViewToolbarView = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_VIEW, wxString::Format(_("%s toolbar"), _("&View")), wxString::Format(_("Toggles display of %s toolbar"), _("View")), wxITEM_CHECK);
m_menuView->Append(m_menuViewToolbarView);
m_menubar->Append(m_menuView, _("&View"));
this->SetMenuBar(m_menubar);
m_toolbarEdit = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT);
m_toolEditCopy = m_toolbarEdit->AddTool(wxID_COPY, _("Copy"), wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(243), size_tool), _("Copies selected records to clipboard") + wxT(" (") + wxT("Ctrl+C") + wxT(")"), wxITEM_NORMAL);
m_toolEditCopyAll = m_toolbarEdit->AddTool(wxID_COPY_ALL, _("Copy All"), wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(133), size_tool), _("Copies all records to clipboard (including hidden)") + wxT(" (") + wxT("Ctrl+Shift+C") + wxT(")"), wxITEM_NORMAL);
m_toolEditClear = m_toolbarEdit->AddTool(wxID_CLEAR, _("Clear"), wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(200), size_tool), _("Clears all records from the log"), wxITEM_NORMAL);
m_toolbarEdit->Realize();
m_mgr.AddPane(m_toolbarEdit, wxAuiPaneInfo().Name(wxT("ToolbarEdit")).Top().Caption(_("Edit")).PinButton(true).Dock().Resizable().FloatingSize(wxDefaultSize).LeftDockable(false).RightDockable(false).Layer(1).ToolbarPane());
m_toolbarView = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT);
m_toolViewScrollAuto = m_toolbarView->AddTool(wxID_VIEW_SCROLL_AUTO, _("Auto Scroll"), wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(231), size_tool), _("Automatically scrolls to the most recent records as they come-in") + wxT(" (") + wxT("Ctrl+S") + wxT(")"), wxITEM_CHECK);
m_toolbarView->AddSeparator();
m_toolViewSourceEapHost = m_toolbarView->AddTool(wxID_VIEW_SOURCE_EAPHOST, "EapHost", wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(273), size_tool), wxString::Format(_("Toggles display of %s records"), wxT("EapHost")), wxITEM_CHECK);
m_toolViewSourceSchannel = m_toolbarView->AddTool(wxID_VIEW_SOURCE_SCHANNEL, "Schannel", wxLoadIconFromResource(lib_ieframe, MAKEINTRESOURCE(36870), size_tool), wxString::Format(_("Toggles display of %s records"), wxT("Schannel")), wxITEM_CHECK);
m_toolViewSourceProduct = m_toolbarView->AddTool(wxID_VIEW_SOURCE_PRODUCT, prod_name, wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, size_tool.GetWidth(), size_tool.GetHeight()), prod_status_bar, wxITEM_CHECK);
m_toolbarView->AddSeparator();
m_toolViewLevelVerbose = m_toolbarView->AddTool(wxID_VIEW_LEVEL_VERBOSE, _("Verbose"), wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2863), size_tool), _("Displays all levels of records") + wxT(" (") + wxT("Ctrl+1") + wxT(")"), wxITEM_RADIO);
m_toolViewLevelInformation = m_toolbarView->AddTool(wxID_VIEW_LEVEL_INFORMATION, _("Informational"), wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2859), size_tool), _("Displays all records up to informational level") + wxT(" (") + wxT("Ctrl+2") + wxT(")"), wxITEM_RADIO);
m_toolViewLevelWarning = m_toolbarView->AddTool(wxID_VIEW_LEVEL_WARNING, _("Warning"), wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2865), size_tool), _("Displays all records up to warning level") + wxT(" (") + wxT("Ctrl+3") + wxT(")"), wxITEM_RADIO);
m_toolViewLevelError = m_toolbarView->AddTool(wxID_VIEW_LEVEL_ERROR, _("Error"), wxLoadIconFromResource(lib_comres, MAKEINTRESOURCE(2861), size_tool), _("Displays error level records only") + wxT(" (") + wxT("Ctrl+4") + wxT(")"), wxITEM_RADIO);
m_toolbarView->Realize();
m_mgr.AddPane(m_toolbarView, wxAuiPaneInfo().Name(wxT("ToolbarView")).Top().Caption(_("View")).PinButton(true).Dock().Resizable().FloatingSize(wxDefaultSize).LeftDockable(false).RightDockable(false).Layer(1).ToolbarPane());
m_panel = new wxEventMonitorLogPanel(this);
m_mgr.AddPane(m_panel, wxAuiPaneInfo() .Name(wxT("LogPanel")).Center() .Caption(_("Trace Log")).CaptionVisible(false).CloseButton(false).PaneBorder(false).Dock().Resizable().FloatingSize(wxDefaultSize).Floatable(false));
m_statusBar = this->CreateStatusBar(1, wxST_SIZEGRIP, wxID_ANY);
m_mgr.Update();
this->Centre(wxBOTH);
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
// Connect Events
this->Connect(wxID_EXIT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnExit ));
this->Connect(wxID_COPY , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditCopyUpdate ));
this->Connect(wxID_COPY , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditCopy ));
this->Connect(wxID_COPY_ALL , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditCopyAllUpdate ));
this->Connect(wxID_COPY_ALL , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditCopyAll ));
this->Connect(wxID_CLEAR , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditClearUpdate ));
this->Connect(wxID_CLEAR , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditClear ));
this->Connect(wxID_SELECT_ALL , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditSelectAllUpdate ));
this->Connect(wxID_SELECT_ALL , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditSelectAll ));
this->Connect(wxID_SELECT_NONE , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditSelectNoneUpdate));
this->Connect(wxID_SELECT_NONE , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditSelectNone ));
this->Connect(wxID_VIEW_SCROLL_AUTO , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewScrollUpdate ));
this->Connect(wxID_VIEW_SCROLL_AUTO , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewScroll ));
this->Connect(wxID_VIEW_SOURCE_EAPHOST , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ), new wxObjectWithData<GUID>(wxETWListCtrl::s_provider_eaphost ));
this->Connect(wxID_VIEW_SOURCE_EAPHOST , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ), new wxObjectWithData<GUID>(wxETWListCtrl::s_provider_eaphost ));
this->Connect(wxID_VIEW_SOURCE_SCHANNEL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ), new wxObjectWithData<GUID>(wxETWListCtrl::s_provider_schannel));
this->Connect(wxID_VIEW_SOURCE_SCHANNEL, wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ), new wxObjectWithData<GUID>(wxETWListCtrl::s_provider_schannel));
this->Connect(wxID_VIEW_SOURCE_PRODUCT , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ), new wxObjectWithData<GUID>(EAPMETHOD_TRACE_EVENT_PROVIDER ));
this->Connect(wxID_VIEW_SOURCE_PRODUCT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ), new wxObjectWithData<GUID>(EAPMETHOD_TRACE_EVENT_PROVIDER ));
this->Connect(wxID_VIEW_LEVEL_VERBOSE , wxID_VIEW_LEVEL_ERROR, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewLevelUpdate ));
this->Connect(wxID_VIEW_LEVEL_VERBOSE , wxID_VIEW_LEVEL_ERROR, wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewLevel ));
this->Connect(wxID_VIEW_TOOLBAR_EDIT , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewToolbarUpdate ), new wxObjectWithData<wxAuiPaneInfo*>(&m_mgr.GetPane(m_toolbarEdit)));
this->Connect(wxID_VIEW_TOOLBAR_EDIT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewToolbar ), new wxObjectWithData<wxAuiPaneInfo*>(&m_mgr.GetPane(m_toolbarEdit)));
this->Connect(wxID_VIEW_TOOLBAR_VIEW , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewToolbarUpdate ), new wxObjectWithData<wxAuiPaneInfo*>(&m_mgr.GetPane(m_toolbarView)));
this->Connect(wxID_VIEW_TOOLBAR_VIEW , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewToolbar ), new wxObjectWithData<wxAuiPaneInfo*>(&m_mgr.GetPane(m_toolbarView)));
}
wxEventMonitorFrame::~wxEventMonitorFrame()
{
// Disconnect Events
this->Disconnect(wxID_EXIT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnExit ));
this->Disconnect(wxID_COPY , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditCopyUpdate ));
this->Disconnect(wxID_COPY , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditCopy ));
this->Disconnect(wxID_COPY_ALL , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditCopyAllUpdate ));
this->Disconnect(wxID_COPY_ALL , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditCopyAll ));
this->Disconnect(wxID_CLEAR , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditClearUpdate ));
this->Disconnect(wxID_CLEAR , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditClear ));
this->Disconnect(wxID_SELECT_ALL , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditSelectAllUpdate ));
this->Disconnect(wxID_SELECT_ALL , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditSelectAll ));
this->Disconnect(wxID_SELECT_NONE , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnEditSelectNoneUpdate));
this->Disconnect(wxID_SELECT_NONE , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnEditSelectNone ));
this->Disconnect(wxID_VIEW_SCROLL_AUTO , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewScrollUpdate ));
this->Disconnect(wxID_VIEW_SCROLL_AUTO , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewScroll ));
this->Disconnect(wxID_VIEW_SOURCE_EAPHOST , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ));
this->Disconnect(wxID_VIEW_SOURCE_EAPHOST , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ));
this->Disconnect(wxID_VIEW_SOURCE_SCHANNEL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ));
this->Disconnect(wxID_VIEW_SOURCE_SCHANNEL, wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ));
this->Disconnect(wxID_VIEW_SOURCE_PRODUCT , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewSourceUpdate ));
this->Disconnect(wxID_VIEW_SOURCE_PRODUCT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewSource ));
this->Disconnect(wxID_VIEW_LEVEL_VERBOSE , wxID_VIEW_LEVEL_ERROR, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewLevelUpdate ));
this->Disconnect(wxID_VIEW_LEVEL_VERBOSE , wxID_VIEW_LEVEL_ERROR, wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewLevel ));
this->Disconnect(wxID_VIEW_TOOLBAR_EDIT , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewToolbarUpdate ));
this->Disconnect(wxID_VIEW_TOOLBAR_EDIT , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewToolbar ));
this->Disconnect(wxID_VIEW_TOOLBAR_VIEW , wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEventMonitorFrame::OnViewToolbarUpdate ));
this->Disconnect(wxID_VIEW_TOOLBAR_VIEW , wxEVT_MENU , wxCommandEventHandler (wxEventMonitorFrame::OnViewToolbar ));
// Save wxAuiManager's state.
wxPersistentAuiManager(&m_mgr).Save();
m_mgr.UnInit();
}
void wxEventMonitorFrame::OnExit(wxCommandEvent& /*event*/)
{
Close();
}
void wxEventMonitorFrame::OnEditCopyUpdate(wxUpdateUIEvent& event)
{
event.Enable(m_panel->m_log->GetSelectedItemCount() != 0);
}
void wxEventMonitorFrame::OnEditCopy(wxCommandEvent& /*event*/)
{
m_panel->m_log->CopySelected();
}
void wxEventMonitorFrame::OnEditCopyAllUpdate(wxUpdateUIEvent& event)
{
event.Enable(!m_panel->m_log->IsEmpty());
}
void wxEventMonitorFrame::OnEditCopyAll(wxCommandEvent& /*event*/)
{
m_panel->m_log->CopyAll();
}
void wxEventMonitorFrame::OnEditClearUpdate(wxUpdateUIEvent& event)
{
event.Enable(!m_panel->m_log->IsEmpty());
}
void wxEventMonitorFrame::OnEditClear(wxCommandEvent& /*event*/)
{
m_panel->m_log->ClearAll();
}
void wxEventMonitorFrame::OnEditSelectAllUpdate(wxUpdateUIEvent& event)
{
event.Enable(m_panel->m_log->GetSelectedItemCount() != m_panel->m_log->GetItemCount());
}
void wxEventMonitorFrame::OnEditSelectAll(wxCommandEvent& /*event*/)
{
m_panel->m_log->SelectAll();
}
void wxEventMonitorFrame::OnEditSelectNoneUpdate(wxUpdateUIEvent& event)
{
event.Enable(m_panel->m_log->GetSelectedItemCount() != 0);
}
void wxEventMonitorFrame::OnEditSelectNone(wxCommandEvent& /*event*/)
{
m_panel->m_log->SelectNone();
}
void wxEventMonitorFrame::OnViewScrollUpdate(wxUpdateUIEvent& event)
{
event.Check(m_panel->m_log->m_scroll_auto);
}
void wxEventMonitorFrame::OnViewScroll(wxCommandEvent& event)
{
m_panel->m_log->m_scroll_auto = event.IsChecked();
if (m_panel->m_log->m_scroll_auto) {
// Scroll to the last record.
long count = m_panel->m_log->GetItemCount();
if (count)
m_panel->m_log->EnsureVisible(count - 1);
}
}
void wxEventMonitorFrame::OnViewSourceUpdate(wxUpdateUIEvent& event)
{
wxObjectWithData<GUID> *source = dynamic_cast<wxObjectWithData<GUID>*>(event.m_callbackUserData);
if (source) {
// Update GUI control according to event source state.
event.Check(m_panel->m_log->IsSourceEnabled(source->m_data));
event.Enable(true);
} else
event.Enable(false);
}
void wxEventMonitorFrame::OnViewSource(wxCommandEvent& event)
{
wxObjectWithData<GUID> *source = dynamic_cast<wxObjectWithData<GUID>*>(event.m_callbackUserData);
if (source) {
// Enable event source.
m_panel->m_log->EnableSource(source->m_data, event.IsChecked());
}
}
void wxEventMonitorFrame::OnViewLevelUpdate(wxUpdateUIEvent& event)
{
// Update GUI control according to log level.
event.Check(TRACE_LEVEL_ERROR + wxID_VIEW_LEVEL_ERROR - event.GetId() == m_panel->m_log->m_level);
}
void wxEventMonitorFrame::OnViewLevel(wxCommandEvent& event)
{
UCHAR state_new = TRACE_LEVEL_ERROR + wxID_VIEW_LEVEL_ERROR - event.GetId();
if (m_panel->m_log->m_level != state_new) {
// Set new log level.
m_panel->m_log->m_level = state_new;
m_panel->m_log->RebuildItems();
}
}
void wxEventMonitorFrame::OnViewToolbarUpdate(wxUpdateUIEvent& event)
{
wxObjectWithData<wxAuiPaneInfo*> *source = dynamic_cast<wxObjectWithData<wxAuiPaneInfo*>*>(event.m_callbackUserData);
if (source && source->m_data) {
// Update GUI control according to toolbar/panel visibility.
event.Check(source->m_data->IsShown());
event.Enable(true);
} else
event.Enable(false);
}
void wxEventMonitorFrame::OnViewToolbar(wxCommandEvent& event)
{
wxObjectWithData<wxAuiPaneInfo*> *source = dynamic_cast<wxObjectWithData<wxAuiPaneInfo*>*>(event.m_callbackUserData);
if (source && source->m_data) {
// Toggle toolbar/panel visibility.
source->m_data->Show(!source->m_data->IsShown());
m_mgr.Update();
}
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentEventMonitorFrame
//////////////////////////////////////////////////////////////////////////
wxPersistentEventMonitorFrame::wxPersistentEventMonitorFrame(wxEventMonitorFrame *wnd) : wxPersistentTLW(wnd)
{
}
void wxPersistentEventMonitorFrame::Save() const
{
const wxEventMonitorFrame * const wnd = static_cast<const wxEventMonitorFrame*>(GetWindow());
wxPersistentEventMonitorLogPanel(wnd->m_panel).Save();
wxPersistentTLW::Save();
}
bool wxPersistentEventMonitorFrame::Restore()
{
const bool r = wxPersistentTLW::Restore();
wxEventMonitorFrame * const wnd = static_cast<wxEventMonitorFrame*>(GetWindow());
wxPersistentEventMonitorLogPanel(wnd->m_panel).Restore();
return r;
}

135
EventMonitor/Frame.h Normal file
View File

@@ -0,0 +1,135 @@
/*
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/>.
*/
///
/// EventMonitor main frame
///
class wxEventMonitorFrame;
///
/// Supports saving/restoring wxEventMonitorFrame GUI state
///
class wxPersistentEventMonitorFrame;
#pragma once;
#include "LogPanel.h"
#include "wxEventMonitor_UI.h"
#include <wx/frame.h>
#include <wx/menu.h>
#include <wx/statusbr.h>
#include <wx/aui/auibar.h>
#include <wx/aui/framemanager.h>
#include <wx/persist/toplevel.h>
#include <WinStd/Win.h>
class wxEventMonitorFrame : public wxFrame
{
protected:
enum {
wxID_COPY_ALL = 1000,
wxID_SELECT_ALL,
wxID_SELECT_NONE,
wxID_VIEW_SCROLL_AUTO,
wxID_VIEW_SOURCE_EAPHOST,
wxID_VIEW_SOURCE_SCHANNEL,
wxID_VIEW_SOURCE_PRODUCT,
wxID_VIEW_LEVEL_VERBOSE,
wxID_VIEW_LEVEL_INFORMATION,
wxID_VIEW_LEVEL_WARNING,
wxID_VIEW_LEVEL_ERROR,
wxID_VIEW_TOOLBAR_EDIT,
wxID_VIEW_TOOLBAR_VIEW,
};
public:
wxEventMonitorFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Event Monitor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,400), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("EventMonitor"));
~wxEventMonitorFrame();
friend class wxPersistentEventMonitorFrame;
protected:
void OnExit(wxCommandEvent& event);
void OnEditCopyUpdate(wxUpdateUIEvent& event);
void OnEditCopy(wxCommandEvent& event);
void OnEditCopyAllUpdate(wxUpdateUIEvent& event);
void OnEditCopyAll(wxCommandEvent& event);
void OnEditClearUpdate(wxUpdateUIEvent& event);
void OnEditClear(wxCommandEvent& event);
void OnEditSelectAllUpdate(wxUpdateUIEvent& event);
void OnEditSelectAll(wxCommandEvent& event);
void OnEditSelectNoneUpdate(wxUpdateUIEvent& event);
void OnEditSelectNone(wxCommandEvent& event);
void OnViewScrollUpdate(wxUpdateUIEvent& event);
void OnViewScroll(wxCommandEvent& event);
void OnViewSourceUpdate(wxUpdateUIEvent& event);
void OnViewSource(wxCommandEvent& event);
void OnViewLevelUpdate(wxUpdateUIEvent& event);
void OnViewLevel(wxCommandEvent& event);
void OnViewToolbarUpdate(wxUpdateUIEvent& event);
void OnViewToolbar(wxCommandEvent& event);
protected:
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenu* m_menuView;
wxMenuItem* m_menuViewSourceProduct;
wxMenuItem* m_menuViewLevelVerbose;
wxMenuItem* m_menuViewLevelInformation;
wxMenuItem* m_menuViewLevelWarning;
wxMenuItem* m_menuViewLevelError;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditCopyAll;
wxAuiToolBarItem* m_toolEditClear;
wxAuiToolBar* m_toolbarView;
wxAuiToolBarItem* m_toolViewScrollAuto;
wxAuiToolBarItem* m_toolViewSourceEapHost;
wxAuiToolBarItem* m_toolViewSourceSchannel;
wxAuiToolBarItem* m_toolViewSourceProduct;
wxAuiToolBarItem* m_toolViewLevelVerbose;
wxAuiToolBarItem* m_toolViewLevelInformation;
wxAuiToolBarItem* m_toolViewLevelWarning;
wxAuiToolBarItem* m_toolViewLevelError;
wxStatusBar* m_statusBar;
wxEventMonitorLogPanel* m_panel;
wxAuiManager m_mgr;
};
class wxPersistentEventMonitorFrame : public wxPersistentTLW
{
public:
wxPersistentEventMonitorFrame(wxEventMonitorFrame *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxEventMonitorFrame *wnd)
{
return new wxPersistentEventMonitorFrame(wnd);
}

65
EventMonitor/LogPanel.cpp Normal file
View File

@@ -0,0 +1,65 @@
/*
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"
//////////////////////////////////////////////////////////////////////////
// wxEventMonitorLogPanel
//////////////////////////////////////////////////////////////////////////
wxEventMonitorLogPanel::wxEventMonitorLogPanel(wxWindow* parent) : wxEventMonitorLogPanelBase(parent)
{
// Set focus.
m_log->SetFocus();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentEventMonitorLogPanel
//////////////////////////////////////////////////////////////////////////
wxPersistentEventMonitorLogPanel::wxPersistentEventMonitorLogPanel(wxEventMonitorLogPanel *wnd) : wxPersistentWindow<wxEventMonitorLogPanel>(wnd)
{
}
wxString wxPersistentEventMonitorLogPanel::GetKind() const
{
return wxT(wxPERSIST_TLW_KIND);
}
void wxPersistentEventMonitorLogPanel::Save() const
{
const wxEventMonitorLogPanel * const wnd = static_cast<const wxEventMonitorLogPanel*>(GetWindow());
wxPersistentETWListCtrl(wnd->m_log).Save();
}
bool wxPersistentEventMonitorLogPanel::Restore()
{
wxEventMonitorLogPanel * const wnd = static_cast<wxEventMonitorLogPanel*>(GetWindow());
wxPersistentETWListCtrl(wnd->m_log).Restore();
return true;
}

60
EventMonitor/LogPanel.h Normal file
View File

@@ -0,0 +1,60 @@
/*
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/>.
*/
///
/// EventMonitor trace log panel
///
class wxEventMonitorLogPanel;
///
/// Supports saving/restoring wxEventMonitorLogPanel state
///
class wxPersistentEventMonitorLogPanel;
#pragma once
#include "wxEventMonitor_UI.h"
#include <wx/persist/window.h>
class wxEventMonitorLogPanel : public wxEventMonitorLogPanelBase
{
public:
wxEventMonitorLogPanel(wxWindow* parent);
friend class wxPersistentEventMonitorLogPanel; // Allow saving/restoring window state.
};
class wxPersistentEventMonitorLogPanel : public wxPersistentWindow<wxEventMonitorLogPanel>
{
public:
wxPersistentEventMonitorLogPanel(wxEventMonitorLogPanel *wnd);
virtual wxString GetKind() const;
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxEventMonitorLogPanel *wnd)
{
return new wxPersistentEventMonitorLogPanel(wnd);
}

9
EventMonitor/MSIBuild/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
/*-1.idt
/*-2.idt
/*-2.idtx
/*.Binary-1
/*.Binary-2
/*.Icon-1
/*.Icon-2
/*.lst
/*.msm

Binary file not shown.

21
EventMonitor/StdAfx.cpp Normal file
View File

@@ -0,0 +1,21 @@
/*
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"

53
EventMonitor/StdAfx.h Normal file
View File

@@ -0,0 +1,53 @@
/*
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/>.
*/
#pragma once
#include "App.h"
#include "ETWLog.h"
#include "Frame.h"
#include "LogPanel.h"
#include "../lib/EAPBase_UI/include/EAP_UI.h"
#include "../include/Version.h"
#include <wxex/common.h>
#include <wxex/object.h>
#include <wxex/persist/auimanager.h>
#include <WinStd/COM.h>
#include <WinStd/ETW.h>
#include <WinStd/Win.h>
#include <Windows.h>
#include <Msi.h>
#include <tchar.h>
#include <in6addr.h>
#include <MSTcpIP.h>
#include <Sddl.h>
#include <tchar.h>
#include <utility>
#include <vector>
#include <set>
#include <EventsETW.h> // Must include after <Windows.h>

1
EventMonitor/locale/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/*.mo

View File

@@ -0,0 +1,220 @@
msgid ""
msgstr ""
"Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2016-08-27 14:20+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.8\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-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: App.cpp:69 Frame.h:67 MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "Event Monitor"
msgstr ""
#: ETWLog.cpp:83
#, c-format
msgid "Error opening event trace (error %u)."
msgstr ""
#: ETWLog.cpp:167
msgid "Time"
msgstr ""
#: ETWLog.cpp:168
msgid "PID"
msgstr ""
#: ETWLog.cpp:169
msgid "TID"
msgstr ""
#: ETWLog.cpp:170
msgid "Source"
msgstr ""
#: ETWLog.cpp:171
msgid "Event"
msgstr ""
#: ETWLog.cpp:228
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 ""
#: ETWLog.cpp:231
#, c-format
msgid "The %s event session already exists."
msgstr ""
#: ETWLog.cpp:235
#, c-format
msgid "Error creating event session (error %u)."
msgstr ""
#: ETWLog.cpp:251 ETWLog.cpp:267 ETWLog.cpp:281
#, c-format
msgid "Error enabling %s event provider (error %u)."
msgstr ""
#: Frame.cpp:48 Frame.cpp:108 Frame.cpp:113 Frame.cpp:168 Frame.cpp:170
#, c-format
msgid "Toggles display of %s records"
msgstr ""
#: Frame.cpp:65
msgid "E&xit"
msgstr ""
#: Frame.cpp:65
msgid "Quits this program"
msgstr ""
#: Frame.cpp:69
msgid "&Program"
msgstr ""
#: Frame.cpp:78
msgid "Copy A&ll"
msgstr ""
#: Frame.cpp:78 Frame.cpp:156
msgid "Copies all records to clipboard (including hidden)"
msgstr ""
#: Frame.cpp:83 Frame.cpp:158
msgid "Clear"
msgstr ""
#: Frame.cpp:83 Frame.cpp:158
msgid "Clears all records from the log"
msgstr ""
#: Frame.cpp:90
msgid "Select &All"
msgstr ""
#: Frame.cpp:90
msgid "Selects all visible records"
msgstr ""
#: Frame.cpp:94
msgid "Select &None"
msgstr ""
#: Frame.cpp:94
msgid "Clears record selection"
msgstr ""
#: Frame.cpp:97 Frame.cpp:142
msgid "&Edit"
msgstr ""
#: Frame.cpp:101
msgid "Auto &Scroll"
msgstr ""
#: Frame.cpp:101 Frame.cpp:164
msgid "Automatically scrolls to the most recent records as they come-in"
msgstr ""
#: Frame.cpp:123 Frame.cpp:176
msgid "Verbose"
msgstr ""
#: Frame.cpp:123 Frame.cpp:176
msgid "Displays all levels of records"
msgstr ""
#: Frame.cpp:127 Frame.cpp:178
msgid "Informational"
msgstr ""
#: Frame.cpp:127 Frame.cpp:178
msgid "Displays all records up to informational level"
msgstr ""
#: Frame.cpp:131 Frame.cpp:180
msgid "Warning"
msgstr ""
#: Frame.cpp:131 Frame.cpp:180
msgid "Displays all records up to warning level"
msgstr ""
#: Frame.cpp:135 Frame.cpp:182
msgid "Error"
msgstr ""
#: Frame.cpp:135 Frame.cpp:182
msgid "Displays error level records only"
msgstr ""
#: Frame.cpp:142 Frame.cpp:146
#, c-format
msgid "%s toolbar"
msgstr ""
#: Frame.cpp:142 Frame.cpp:146
#, c-format
msgid "Toggles display of %s toolbar"
msgstr ""
#: Frame.cpp:142 Frame.cpp:146 Frame.cpp:185
msgid "View"
msgstr ""
#: Frame.cpp:146 Frame.cpp:149
msgid "&View"
msgstr ""
#: Frame.cpp:154
msgid "Copy"
msgstr ""
#: Frame.cpp:154
msgid "Copies selected records to clipboard"
msgstr ""
#: Frame.cpp:156
msgid "Copy All"
msgstr ""
#: Frame.cpp:161
msgid "Edit"
msgstr ""
#: Frame.cpp:164
msgid "Auto Scroll"
msgstr ""
#: Frame.cpp:189
msgid "Trace Log"
msgstr ""
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:3
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:3
msgid "1252"
msgstr ""
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
msgid "EVENTM~1|GÉANTLink Event Monitor"
msgstr ""
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
msgid "Real-time display of internal events"
msgstr ""

View File

@@ -0,0 +1,228 @@
# Translators:
# Simon Rozman <simon@rozman.si>, 2016
msgid ""
msgstr ""
"Project-Id-Version: EventMonitor\n"
"POT-Creation-Date: 2016-08-27 14:20+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl_SI\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: App.cpp:69 Frame.h:67 MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "Event Monitor"
msgstr "Nadzornik dogodkov"
#: ETWLog.cpp:83
#, c-format
msgid "Error opening event trace (error %u)."
msgstr "Napaka pri odpiranju sledenja dogodkom (napaka %u)."
#: ETWLog.cpp:167
msgid "Time"
msgstr "Čas"
#: ETWLog.cpp:168
msgid "PID"
msgstr "PID"
#: ETWLog.cpp:169
msgid "TID"
msgstr "TID"
#: ETWLog.cpp:170
msgid "Source"
msgstr "Vir"
#: ETWLog.cpp:171
msgid "Event"
msgstr "Dogodek"
#: ETWLog.cpp:228
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 ""
"Dostop pri ustvarjanju seje dogodkov zavrnjen: potrebujete skrbniške pravice"
" (Zaženi kot skrbnik) ali biti član skupine »Performance Log Users« za zagon"
" seje sledenja dogodkov."
#: ETWLog.cpp:231
#, c-format
msgid "The %s event session already exists."
msgstr "Seja dogodkov %s že obstaja."
#: ETWLog.cpp:235
#, c-format
msgid "Error creating event session (error %u)."
msgstr "Napaka pri ustvarjanju seje dogodkov (napaka %u)."
#: ETWLog.cpp:251 ETWLog.cpp:267 ETWLog.cpp:281
#, c-format
msgid "Error enabling %s event provider (error %u)."
msgstr "Napaka pri omogočanju ponudnika dogodkov %s (napaka %u)."
#: Frame.cpp:48 Frame.cpp:108 Frame.cpp:113 Frame.cpp:168 Frame.cpp:170
#, c-format
msgid "Toggles display of %s records"
msgstr "Obrne prikaz zapisov %s"
#: Frame.cpp:65
msgid "E&xit"
msgstr "I&zhod"
#: Frame.cpp:65
msgid "Quits this program"
msgstr "Konča ta program"
#: Frame.cpp:69
msgid "&Program"
msgstr "&Program"
#: Frame.cpp:78
msgid "Copy A&ll"
msgstr "Kopiraj &vse"
#: Frame.cpp:78 Frame.cpp:156
msgid "Copies all records to clipboard (including hidden)"
msgstr "Kopira vse zapise na odložišče (tudi skrite)"
#: Frame.cpp:83 Frame.cpp:158
msgid "Clear"
msgstr "Počisti"
#: Frame.cpp:83 Frame.cpp:158
msgid "Clears all records from the log"
msgstr "Počisti vse zapise iz dnevnika"
#: Frame.cpp:90
msgid "Select &All"
msgstr "Izberi &vse"
#: Frame.cpp:90
msgid "Selects all visible records"
msgstr "Izbere vse vidne zapise"
#: Frame.cpp:94
msgid "Select &None"
msgstr "Izberi &nič"
#: Frame.cpp:94
msgid "Clears record selection"
msgstr "Počisti izbor zapisov"
#: Frame.cpp:97 Frame.cpp:142
msgid "&Edit"
msgstr "Ur&edi"
#: Frame.cpp:101
msgid "Auto &Scroll"
msgstr "&Samodrsenje"
#: Frame.cpp:101 Frame.cpp:164
msgid "Automatically scrolls to the most recent records as they come-in"
msgstr "Samodejno pomikaj do najbolj zadnjega zapisa, ko prihajajo"
#: Frame.cpp:123 Frame.cpp:176
msgid "Verbose"
msgstr "Podrobno"
#: Frame.cpp:123 Frame.cpp:176
msgid "Displays all levels of records"
msgstr "Prikaže vse ravni zapisov"
#: Frame.cpp:127 Frame.cpp:178
msgid "Informational"
msgstr "Informativno"
#: Frame.cpp:127 Frame.cpp:178
msgid "Displays all records up to informational level"
msgstr "Prikaže vse zapise do informativne ravni"
#: Frame.cpp:131 Frame.cpp:180
msgid "Warning"
msgstr "Opozorilo"
#: Frame.cpp:131 Frame.cpp:180
msgid "Displays all records up to warning level"
msgstr "Prikaže vse zapise do opozorilne ravni"
#: Frame.cpp:135 Frame.cpp:182
msgid "Error"
msgstr "Napaka"
#: Frame.cpp:135 Frame.cpp:182
msgid "Displays error level records only"
msgstr "Prikaže samo zapise ravni napak"
#: Frame.cpp:142 Frame.cpp:146
#, c-format
msgid "%s toolbar"
msgstr "Orodna vrstica %s"
#: Frame.cpp:142 Frame.cpp:146
#, c-format
msgid "Toggles display of %s toolbar"
msgstr "Obrne prikaz orodne vrstice %s"
#: Frame.cpp:142 Frame.cpp:146 Frame.cpp:185
msgid "View"
msgstr "Pogled"
#: Frame.cpp:146 Frame.cpp:149
msgid "&View"
msgstr "Po&gled"
#: Frame.cpp:154
msgid "Copy"
msgstr "Kopiraj"
#: Frame.cpp:154
msgid "Copies selected records to clipboard"
msgstr "Kopira izbrane zapise na odložišče"
#: Frame.cpp:156
msgid "Copy All"
msgstr "Kopiraj vse"
#: Frame.cpp:161
msgid "Edit"
msgstr "Uredi"
#: Frame.cpp:164
msgid "Auto Scroll"
msgstr "Samodrsenje"
#: Frame.cpp:189
msgid "Trace Log"
msgstr "Dnevnik sledenja"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:3
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:3
msgid "1252"
msgstr "1250"
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
msgid "EVENTM~1|GÉANTLink Event Monitor"
msgstr "EVENTM~1|Nadzornik dogodkov GÉANTLink"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
msgid "Real-time display of internal events"
msgstr "Prikazovalnik notranjih dogodkov v realnem času"

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,32 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "ETWLog.h"
#include "wxEventMonitor_UI.h"
///////////////////////////////////////////////////////////////////////////
wxEventMonitorLogPanelBase::wxEventMonitorLogPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER, wxDefaultValidator, wxT("EventMonitorLog") );
bSizerMain->Add( m_log, 1, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
}
wxEventMonitorLogPanelBase::~wxEventMonitorLogPanelBase()
{
}

View File

@@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">.</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">wxEventMonitor_UI</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">wxEventMonitor_UI</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header">#include &quot;StdAfx.h&quot;</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">1</property>
<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">wxEventMonitorLogPanelBase</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name">EventMonitorLogPanel</property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</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</property>
<property name="proportion">1</property>
<object class="wxListCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_log</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</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">wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL</property>
<property name="subclass">wxETWListCtrl; ETWLog.h</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></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="window_extra_style"></property>
<property name="window_name">EventMonitorLog</property>
<property name="window_style">wxNO_BORDER</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBeginDrag"></event>
<event name="OnListBeginLabelEdit"></event>
<event name="OnListBeginRDrag"></event>
<event name="OnListCacheHint"></event>
<event name="OnListColBeginDrag"></event>
<event name="OnListColClick"></event>
<event name="OnListColDragging"></event>
<event name="OnListColEndDrag"></event>
<event name="OnListColRightClick"></event>
<event name="OnListDeleteAllItems"></event>
<event name="OnListDeleteItem"></event>
<event name="OnListEndLabelEdit"></event>
<event name="OnListInsertItem"></event>
<event name="OnListItemActivated"></event>
<event name="OnListItemDeselected"></event>
<event name="OnListItemFocused"></event>
<event name="OnListItemMiddleClick"></event>
<event name="OnListItemRightClick"></event>
<event name="OnListItemSelected"></event>
<event name="OnListKeyDown"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@@ -0,0 +1,44 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __WXEVENTMONITOR_UI_H__
#define __WXEVENTMONITOR_UI_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class wxETWListCtrl;
#include <wx/listctrl.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class wxEventMonitorLogPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxEventMonitorLogPanelBase : public wxPanel
{
private:
protected:
public:
wxETWListCtrl* m_log;
wxEventMonitorLogPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("EventMonitorLogPanel") );
~wxEventMonitorLogPanelBase();
};
#endif //__WXEVENTMONITOR_UI_H__

Binary file not shown.

View File

@@ -0,0 +1,41 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: GÉANTLink MSI\n"
"POT-Creation-Date: 2016-07-15 10:51+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-Basepath: ../Main\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: En.Win32.Release.Property-2.idtx:6 En.x64.Release.Property-2.idtx:6
msgid "+386 1 8311 035"
msgstr ""
#: En.Win32.Release.Property-2.idtx:3 En.x64.Release.Property-2.idtx:3
#, fuzzy
msgid "1252"
msgstr "1250"
#: En.Win32.Release.Property-2.idtx:5 En.x64.Release.Property-2.idtx:5
msgid "Amebis, p. p. 69, SI-1241 Kamnik, Slovenia, E.U."
msgstr ""
#: En.Win32.Release.Property-2.idtx:4 En.x64.Release.Property-2.idtx:4
msgid "Amebis, Slovenia, E.U."
msgstr ""
#: En.Win32.Release.Property-2.idtx:7 En.Win32.Release.Property-2.idtx:8
#: En.Win32.Release.Property-2.idtx:9 En.x64.Release.Property-2.idtx:7
#: En.x64.Release.Property-2.idtx:8 En.x64.Release.Property-2.idtx:9
msgid "http://www.amebis.si/"
msgstr ""

BIN
Makefile

Binary file not shown.

2
MsiUseFeature/.gitignore vendored Normal file
View File

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

69
MsiUseFeature/Main.cpp Normal file
View File

@@ -0,0 +1,69 @@
/*
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"
#pragma comment(lib, "Msi.lib")
using namespace std;
using namespace winstd;
static int MsiUseFeature()
{
int nArgs;
unique_ptr<LPWSTR[], LocalFree_delete<LPWSTR[]> > pwcArglist(CommandLineToArgvW(GetCommandLineW(), &nArgs));
if (pwcArglist == NULL) {
OutputDebugStr(_T("CommandLineToArgvW failed (error %u).\n"), GetLastError());
return 1;
}
if (nArgs < 2) {
OutputDebugStr(_T("Not enough parameters.\n"));
return -1;
}
// Query the feature state.
if (MsiQueryFeatureStateW(_L(PRODUCT_VERSION_GUID), pwcArglist[1]) == INSTALLSTATE_UNKNOWN) {
OutputDebugStr(_T("The product is not installed or feature state is unknown.\n"));
return 1;
}
// Perform the Microsoft Installer's feature completeness check.
if (MsiUseFeatureW(_L(PRODUCT_VERSION_GUID), pwcArglist[1]) != INSTALLSTATE_LOCAL) {
OutputDebugStr(_T("The feature is not installed locally.\n"));
return 2;
}
return 0;
}
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
int res = MsiUseFeature();
assert(!_CrtDumpMemoryLeaks());
return res;
}

View File

@@ -0,0 +1,14 @@
<?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>
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Binary file not shown.

View File

@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<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|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{679D03C5-CD70-4FFA-93F8-A4AB3637509B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MsiUseFeature</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</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\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="MsiUseFeature.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\x64.props" />
<Import Project="..\include\Debug.props" />
<Import Project="MsiUseFeature.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\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="MsiUseFeature.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\x64.props" />
<Import Project="..\include\Release.props" />
<Import Project="MsiUseFeature.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemGroup>
<ClInclude Include="StdAfx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="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)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MsiUseFeature.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,38 @@
<?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>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MsiUseFeature.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

17
MsiUseFeature/README.md Normal file
View File

@@ -0,0 +1,17 @@
#MsiUseFeature
Checks the installation state of the given feature of G<>ANTLink product
##Usage
```
MsiUseFeature <feature name>
```
- `feature name` - The name of the feature to check (i.e. "featEAPTTLS"; see Feature table of product MSI file)
Note: The MSI product code changes on every release. Therefore, `MsiUseFeature` utility with identical version should be used.
Return codes:
- -1 = Invalid parameters
- 0 = Success
- 1 = The product is not installed or feature state is unknown
- 2 = The feature is not installed locally

21
MsiUseFeature/StdAfx.cpp Normal file
View File

@@ -0,0 +1,21 @@
/*
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"

32
MsiUseFeature/StdAfx.h Normal file
View File

@@ -0,0 +1,32 @@
/*
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/>.
*/
#pragma once
#include "../include/Version.h"
#include <WinStd/Common.h>
#include <WinStd/Win.h>
#include <Windows.h>
#include <Msi.h>
#include <tchar.h>
#include <memory>

View File

@@ -18,10 +18,34 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CredWrite", "CredWrite\CredWrite.vcxproj", "{2D3CE079-7EB1-4F47-B79E-F0310671ECCB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPMethodEvents", "EAPMethods\EAPMethodEvents\EAPMethodEvents.vcxproj", "{D63F24BD-92A0-4D6B-8B69-ED947E4D2B1B}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Events", "lib\Events\build\Events.vcxproj", "{D63F24BD-92A0-4D6B-8B69-ED947E4D2B1B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPTTLSUI", "EAPMethods\EAPTTLSUI\EAPTTLSUI.vcxproj", "{DD7A97CA-F18E-43B7-95C4-D06E6A291624}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPBase", "lib\EAPBase\build\EAPBase.vcxproj", "{AD6816A0-9600-4E01-8C49-39D03D1E791F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPBase_UI", "lib\EAPBase_UI\build\EAPBase_UI.vcxproj", "{D4B54856-BE1F-4937-A8F7-495125BE76BE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PAP", "lib\PAP\build\PAP.vcxproj", "{36B0CF8A-7794-46C3-8099-825BA962B4C7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLS", "lib\TLS\build\TLS.vcxproj", "{4D40CB8A-812E-4F12-B23A-31AF743878E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TTLS", "lib\TTLS\build\TTLS.vcxproj", "{EE0EF0D9-A475-4038-8637-5754724F65B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PAP_UI", "lib\PAP_UI\build\PAP_UI.vcxproj", "{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLS_UI", "lib\TLS_UI\build\TLS_UI.vcxproj", "{9A25C261-8ADE-4938-8393-E857EF0E37E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TTLS_UI", "lib\TTLS_UI\build\TTLS_UI.vcxproj", "{42F0F0F4-C928-4860-A4E4-94991C2C3D90}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MsiUseFeature", "MsiUseFeature\MsiUseFeature.vcxproj", "{679D03C5-CD70-4FFA-93F8-A4AB3637509B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventMonitor", "EventMonitor\EventMonitor.vcxproj", "{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WLANManager", "WLANManager\WLANManager.vcxproj", "{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -70,15 +94,123 @@ Global
{DD7A97CA-F18E-43B7-95C4-D06E6A291624}.Release|Win32.Build.0 = Release|Win32
{DD7A97CA-F18E-43B7-95C4-D06E6A291624}.Release|x64.ActiveCfg = Release|x64
{DD7A97CA-F18E-43B7-95C4-D06E6A291624}.Release|x64.Build.0 = Release|x64
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Debug|Win32.ActiveCfg = Debug|Win32
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Debug|Win32.Build.0 = Debug|Win32
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Debug|x64.ActiveCfg = Debug|x64
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Debug|x64.Build.0 = Debug|x64
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Release|Win32.ActiveCfg = Release|Win32
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Release|Win32.Build.0 = Release|Win32
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Release|x64.ActiveCfg = Release|x64
{AD6816A0-9600-4E01-8C49-39D03D1E791F}.Release|x64.Build.0 = Release|x64
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Debug|Win32.ActiveCfg = Debug|Win32
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Debug|Win32.Build.0 = Debug|Win32
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Debug|x64.ActiveCfg = Debug|x64
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Debug|x64.Build.0 = Debug|x64
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Release|Win32.ActiveCfg = Release|Win32
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Release|Win32.Build.0 = Release|Win32
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Release|x64.ActiveCfg = Release|x64
{D4B54856-BE1F-4937-A8F7-495125BE76BE}.Release|x64.Build.0 = Release|x64
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Debug|Win32.ActiveCfg = Debug|Win32
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Debug|Win32.Build.0 = Debug|Win32
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Debug|x64.ActiveCfg = Debug|x64
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Debug|x64.Build.0 = Debug|x64
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Release|Win32.ActiveCfg = Release|Win32
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Release|Win32.Build.0 = Release|Win32
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Release|x64.ActiveCfg = Release|x64
{36B0CF8A-7794-46C3-8099-825BA962B4C7}.Release|x64.Build.0 = Release|x64
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Debug|Win32.ActiveCfg = Debug|Win32
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Debug|Win32.Build.0 = Debug|Win32
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Debug|x64.ActiveCfg = Debug|x64
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Debug|x64.Build.0 = Debug|x64
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Release|Win32.ActiveCfg = Release|Win32
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Release|Win32.Build.0 = Release|Win32
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Release|x64.ActiveCfg = Release|x64
{4D40CB8A-812E-4F12-B23A-31AF743878E8}.Release|x64.Build.0 = Release|x64
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Debug|Win32.ActiveCfg = Debug|Win32
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Debug|Win32.Build.0 = Debug|Win32
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Debug|x64.ActiveCfg = Debug|x64
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Debug|x64.Build.0 = Debug|x64
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Release|Win32.ActiveCfg = Release|Win32
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Release|Win32.Build.0 = Release|Win32
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Release|x64.ActiveCfg = Release|x64
{EE0EF0D9-A475-4038-8637-5754724F65B0}.Release|x64.Build.0 = Release|x64
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Debug|Win32.ActiveCfg = Debug|Win32
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Debug|Win32.Build.0 = Debug|Win32
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Debug|x64.ActiveCfg = Debug|x64
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Debug|x64.Build.0 = Debug|x64
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Release|Win32.ActiveCfg = Release|Win32
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Release|Win32.Build.0 = Release|Win32
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Release|x64.ActiveCfg = Release|x64
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A}.Release|x64.Build.0 = Release|x64
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Debug|Win32.ActiveCfg = Debug|Win32
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Debug|Win32.Build.0 = Debug|Win32
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Debug|x64.ActiveCfg = Debug|x64
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Debug|x64.Build.0 = Debug|x64
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Release|Win32.ActiveCfg = Release|Win32
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Release|Win32.Build.0 = Release|Win32
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Release|x64.ActiveCfg = Release|x64
{9A25C261-8ADE-4938-8393-E857EF0E37E9}.Release|x64.Build.0 = Release|x64
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Debug|Win32.ActiveCfg = Debug|Win32
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Debug|Win32.Build.0 = Debug|Win32
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Debug|x64.ActiveCfg = Debug|x64
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Debug|x64.Build.0 = Debug|x64
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Release|Win32.ActiveCfg = Release|Win32
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Release|Win32.Build.0 = Release|Win32
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Release|x64.ActiveCfg = Release|x64
{42F0F0F4-C928-4860-A4E4-94991C2C3D90}.Release|x64.Build.0 = Release|x64
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Debug|Win32.ActiveCfg = Debug|Win32
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Debug|Win32.Build.0 = Debug|Win32
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Debug|x64.ActiveCfg = Debug|x64
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Debug|x64.Build.0 = Debug|x64
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Release|Win32.ActiveCfg = Release|Win32
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Release|Win32.Build.0 = Release|Win32
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Release|x64.ActiveCfg = Release|x64
{679D03C5-CD70-4FFA-93F8-A4AB3637509B}.Release|x64.Build.0 = Release|x64
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Debug|Win32.ActiveCfg = Debug|Win32
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Debug|Win32.Build.0 = Debug|Win32
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Debug|x64.ActiveCfg = Debug|x64
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Debug|x64.Build.0 = Debug|x64
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Release|Win32.ActiveCfg = Release|Win32
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Release|Win32.Build.0 = Release|Win32
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Release|x64.ActiveCfg = Release|x64
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}.Release|x64.Build.0 = Release|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|Win32.ActiveCfg = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|Win32.Build.0 = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x64.ActiveCfg = Debug|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x64.Build.0 = Debug|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.ActiveCfg = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.Build.0 = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.ActiveCfg = Release|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.Build.0 = Release|x64
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|Win32.ActiveCfg = Debug|Win32
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|Win32.Build.0 = Debug|Win32
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|x64.ActiveCfg = Debug|x64
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|x64.Build.0 = Debug|x64
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|Win32.ActiveCfg = Release|Win32
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|Win32.Build.0 = Release|Win32
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|x64.ActiveCfg = Release|x64
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{331B6077-E3E2-4867-B93E-9D3F57280DE7} = {60BAAC3D-DC98-4C19-BC40-1A86963DE86C}
{D63F24BD-92A0-4D6B-8B69-ED947E4D2B1B} = {60BAAC3D-DC98-4C19-BC40-1A86963DE86C}
{DD7A97CA-F18E-43B7-95C4-D06E6A291624} = {60BAAC3D-DC98-4C19-BC40-1A86963DE86C}
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{D63F24BD-92A0-4D6B-8B69-ED947E4D2B1B} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{AD6816A0-9600-4E01-8C49-39D03D1E791F} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{D4B54856-BE1F-4937-A8F7-495125BE76BE} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{36B0CF8A-7794-46C3-8099-825BA962B4C7} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{4D40CB8A-812E-4F12-B23A-31AF743878E8} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{EE0EF0D9-A475-4038-8637-5754724F65B0} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{3D309C2E-64AB-4BC4-A16D-468571A2BC1A} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{9A25C261-8ADE-4938-8393-E857EF0E37E9} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{42F0F0F4-C928-4860-A4E4-94991C2C3D90} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
{2D3CE079-7EB1-4F47-B79E-F0310671ECCB} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
{679D03C5-CD70-4FFA-93F8-A4AB3637509B} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
EndGlobalSection
EndGlobal

2
WLANManager/.gitignore vendored Normal file
View File

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

9
WLANManager/MSIBuild/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
/*-1.idt
/*-2.idt
/*-2.idtx
/*.Binary-1
/*.Binary-2
/*.Icon-1
/*.Icon-2
/*.lst
/*.msm

Binary file not shown.

136
WLANManager/Main.cpp Normal file
View File

@@ -0,0 +1,136 @@
/*
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"
#pragma comment(lib, "Wlanapi.lib")
#pragma comment(lib, "Wlanui.lib")
using namespace std;
using namespace winstd;
DWORD (WINAPI *pfnWlanReasonCodeToString)(__in DWORD dwReasonCode, __in DWORD dwBufferSize, __in_ecount(dwBufferSize) PWCHAR pStringBuffer, __reserved PVOID pReserved);
static int DisplayError(_In_z_ _Printf_format_string_ LPCTSTR format, ...)
{
va_list arg;
va_start(arg, format);
tstring msg;
vsprintf(msg, format, arg);
va_end(arg);
return MessageBox(NULL, msg.c_str(), _T("WLANManager"), MB_OK);
}
static int WLANManager()
{
int nArgs;
unique_ptr<LPWSTR[], LocalFree_delete<LPWSTR[]> > pwcArglist(CommandLineToArgvW(GetCommandLineW(), &nArgs));
if (pwcArglist == NULL) {
DisplayError(_T("%s function failed (error %u)."), _T("CommandLineToArgvW"), GetLastError());
return 1;
}
if (nArgs < 3) {
DisplayError(_T("Not enough parameters."));
return -1;
}
if (_wcsicmp(pwcArglist[1], L"profile") != 0) {
DisplayError(_T("Unknown command (%ls)."), pwcArglist[1]);
return -1;
}
// Open WLAN handle.
DWORD dwNegotiatedVersion;
wlan_handle wlan;
if (!wlan.open(WLAN_API_MAKE_VERSION(2, 0), &dwNegotiatedVersion)) {
DisplayError(_T("%s function failed (error %u)."), _T("WlanOpenHandle"), GetLastError());
return 2;
} else if (dwNegotiatedVersion < WLAN_API_MAKE_VERSION(2, 0)) {
DisplayError(_T("WlanOpenHandle negotiated unsupported version (expected: %u, negotiated: %u)."), WLAN_API_MAKE_VERSION(2, 0), dwNegotiatedVersion);
return 3;
}
unique_ptr<WLAN_INTERFACE_INFO_LIST, WlanFreeMemory_delete<WLAN_INTERFACE_INFO_LIST> > interfaces;
{
// Get a list of WLAN interfaces.
WLAN_INTERFACE_INFO_LIST *pInterfaceList;
DWORD dwResult = WlanEnumInterfaces(wlan, NULL, &pInterfaceList);
if (dwResult != ERROR_SUCCESS) {
DisplayError(_T("%s function failed (error %u)."), _T("WlanEnumInterfaces"), dwResult);
return 4;
}
interfaces.reset(pInterfaceList);
}
for (DWORD i = 0; i < interfaces->dwNumberOfItems; i++) {
if (interfaces->InterfaceInfo[i].isState == wlan_interface_state_not_ready) {
// This interface is not ready.
continue;
}
// Launch WLAN profile config dialog.
// Note: When a debugger is attached to this process the WlanUIEditProfile() will raise an exception and fail.
WLAN_REASON_CODE wlrc;
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
if (dwResult != ERROR_SUCCESS) {
DisplayError(_T("%s function failed (error %u)."), _T("WlanUIEditProfile"), dwResult);
return 5;
}
if (wlrc != WLAN_REASON_CODE_SUCCESS) {
tstring reason;
if (WlanReasonCodeToString(wlrc, reason, NULL) == ERROR_SUCCESS)
DisplayError(_T("%s function failed: %s"), _T("WlanUIEditProfile"), reason.c_str());
else
DisplayError(_T("%s function failed (reason code: %u)."), _T("WlanUIEditProfile"), wlrc);
}
break;
}
return 0;
}
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
{
// Initialize Windows XP visual styles
INITCOMMONCONTROLSEX icc;
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
icc.dwICC = ICC_WIN95_CLASSES | ICC_STANDARD_CLASSES | ICC_LINK_CLASS;
InitCommonControlsEx(&icc);
}
pfnWlanReasonCodeToString = WlanReasonCodeToString;
int res = WLANManager();
assert(!_CrtDumpMemoryLeaks());
return res;
}

18
WLANManager/README.md Normal file
View File

@@ -0,0 +1,18 @@
#WLANManager
Invokes standard Windows Wireless Network Properties dialog
##Usage
```
WLANManager profile <name>
```
- `name` - The name of the network profile (not neccessarely the same as SSID)
Return codes:
- -1 = Invalid parameters
- 0 = Success
- 1 = Error parsing command line
- 2 = WLAN handle could not be opened
- 3 = WLAN provider negotiated unsupported version
- 4 = Interface enumeration failed
- 5 = Edit profile UI failed

21
WLANManager/StdAfx.cpp Normal file
View File

@@ -0,0 +1,21 @@
/*
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"

33
WLANManager/StdAfx.h Normal file
View File

@@ -0,0 +1,33 @@
/*
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/>.
*/
#pragma once
#include "../lib/EAPBase_UI/include/EAP_UI.h"
#include <WinStd/Common.h>
#include <WinStd/Win.h>
#include <WinStd/WLAN.h>
#include <Windows.h>
#include <CommCtrl.h>
#include <tchar.h>
#include <memory>

View File

@@ -0,0 +1,14 @@
<?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>
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

BIN
WLANManager/WLANManager.rc Normal file

Binary file not shown.

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<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|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>WLANManager</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</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\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="WLANManager.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\x64.props" />
<Import Project="..\include\Debug.props" />
<Import Project="WLANManager.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\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="WLANManager.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\x64.props" />
<Import Project="..\include\Release.props" />
<Import Project="WLANManager.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemGroup>
<ClInclude Include="StdAfx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="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)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WLANManager.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
<None Include="res\WLANManager.ico" />
</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>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WLANManager.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
<None Include="res\WLANManager.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>

1
WLANManager/locale/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/*.mo

View File

@@ -0,0 +1,32 @@
msgid ""
msgstr ""
"Project-Id-Version: WLANManager\n"
"POT-Creation-Date: 2016-08-28 12:03+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.8\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-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
msgid "1252"
msgstr ""
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "Helper utility to support direct shortcuts to Wireless Network Properties"
msgstr ""
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "WLAN Manager"
msgstr ""

View File

@@ -0,0 +1,37 @@
# Translators:
# Simon Rozman <simon@rozman.si>, 2016
msgid ""
msgstr ""
"Project-Id-Version: WLANManager\n"
"POT-Creation-Date: 2016-08-28 12:03+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl_SI\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Generator: Poedit 1.8.8\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
msgid "1252"
msgstr "1250"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid ""
"Helper utility to support direct shortcuts to Wireless Network Properties"
msgstr ""
"Orodje za pomoč, ki omogoča neposredne bližnjice do nastavitev brezžičnega "
"omrežja"
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
msgid "WLAN Manager"
msgstr "Upravitelj WLAN"

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

2
desktop.ini Normal file
View File

@@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=include\icon_full.ico,0

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Amebis
Copyright 2016 GÉANT
Copyright 2016 GÉANT
This file is part of GÉANTLink.
@@ -24,15 +24,15 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IntDir>temp\$(ProjectName).$(Platform).$(Configuration).$(PlatformToolset)\</IntDir>
<OutDir>temp\$(ProjectName).$(Platform).$(Configuration).$(PlatformToolset)\</OutDir>
<IntDir>temp\$(MSBuildProjectName).$(Platform).$(Configuration).$(PlatformToolset)\</IntDir>
<OutDir>temp\$(MSBuildProjectName).$(Platform).$(Configuration).$(PlatformToolset)\</OutDir>
<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>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;ISOLATION_AWARE_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;ISOLATION_AWARE_ENABLED=1;SECURITY_WIN32;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;EAP_TLS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>StdAfx.h</PrecompiledHeaderFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -43,6 +43,9 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<ResourceCompile />
<POCompile>
<OutputFile>$(OutDir)..\locale\%(Filename)\$(ProjectName).mo</OutputFile>
</POCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Binary file not shown.

View File

@@ -29,7 +29,7 @@
// Product version as a single DWORD
// Note: Used for version comparison within C/C++ code.
//
#define PRODUCT_VERSION 0x00ff0300
#define PRODUCT_VERSION 0x00ff0e00
//
// Product version by components
@@ -39,26 +39,31 @@
//
#define PRODUCT_VERSION_MAJ 0
#define PRODUCT_VERSION_MIN 255
#define PRODUCT_VERSION_REV 3
#define PRODUCT_VERSION_REV 14
#define PRODUCT_VERSION_BUILD 0
//
// Human readable product version and build year for UI
//
#define PRODUCT_VERSION_STR "1.0-alpha3"
#define PRODUCT_VERSION_STR "1.0-alpha14"
#define PRODUCT_BUILD_YEAR_STR "2016"
//
// Numerical version presentation for ProductVersion propery in
// MSI packages (syntax: N.N[.N[.N]])
//
#define PRODUCT_VERSION_INST "0.255.3"
#define PRODUCT_VERSION_INST "0.255.14"
//
// The product code for ProductCode property in MSI packages
// Replace with new on every version change, regardless how minor it is.
//
#define PRODUCT_VERSION_GUID "{14FCBB4F-BA19-46D7-B881-CA5AE7F42991}"
#define PRODUCT_VERSION_GUID "{2C45C10E-80B7-4E3B-A06F-08A1A795EDE5}"
//
// Product vendor
//
#define VENDOR_NAME_STR "GÉANT"
//
// Since the product name is not finally confirmed at the time of

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