Compare commits
38 Commits
1.0-alpha1
...
1.0-alpha1
Author | SHA1 | Date | |
---|---|---|---|
f64dbacdbd | |||
2a88c4f2a8 | |||
6ee34cdd47 | |||
65c87bcbc0 | |||
1bdf4a2b8a | |||
a8856b951b | |||
6e58183d16 | |||
9daa5b52a4 | |||
9704046868 | |||
3b8bc90a0f | |||
b5c8b8ee67 | |||
53e31b1be7 | |||
5483368640 | |||
6077063599 | |||
2857b2edd2 | |||
6760287f0d | |||
7973a8d59b | |||
f5d8f653af | |||
e1600e5aba | |||
352d546da1 | |||
d2ff78a613 | |||
10807fad18 | |||
c6d53cd13c | |||
6f25e4c0ad | |||
edac93e115 | |||
d1c24efcf0 | |||
1cb6ca5adb | |||
38e1443276 | |||
6835f5279c | |||
eb9c8a5f7c | |||
5332b538aa | |||
a9baa07227 | |||
387a12ab5e | |||
7b3251a758 | |||
894f19a81e | |||
318ad7f355 | |||
ef2042253c | |||
9b997408a1 |
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EAPMethods\n"
|
||||
"POT-Creation-Date: 2016-06-10 12:06+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"
|
||||
@@ -11,8 +11,6 @@ msgstr ""
|
||||
"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: lib/EAPBase_UI\n"
|
||||
@@ -21,70 +19,203 @@ msgstr ""
|
||||
"X-Poedit-SearchPath-3: lib/TTLS_UI\n"
|
||||
"X-Poedit-SearchPath-4: EAPMethods\n"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:123 lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:144
|
||||
msgid "Identity:"
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:198
|
||||
msgid "Use &own credentials:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:160
|
||||
msgid "Click here to set or modify your credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:164
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:214
|
||||
msgid "&Clear Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:221
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:317
|
||||
msgid "User ID:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:230
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:326
|
||||
msgid "Password:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:235
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:331
|
||||
msgid "Enter your password here"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:242 lib/TLS_UI/res/wxTLS_UI.cpp:164
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:338 lib/TLS_UI/res/wxTLS_UI.cpp:183
|
||||
msgid "&Remember"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/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 ""
|
||||
|
||||
#: lib/PAP_UI/src/PAP_UI.cpp:41
|
||||
msgid "This method requires no additional settings."
|
||||
#: 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
|
||||
@@ -132,11 +263,11 @@ msgid "Acceptable server &names:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:77
|
||||
msgid "A semicolon delimited list of acceptable server FQDN names; blank to skip name check; \"*\" wildchar allowed"
|
||||
msgid "A semicolon delimited list of acceptable server FQDN names; blank to skip name check; Unicode characters allowed"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:81
|
||||
msgid "(Example: foo.bar.com;*.domain.org)"
|
||||
msgid "(Example: foo.bar.com;server2.bar.com)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:120
|
||||
@@ -167,48 +298,59 @@ msgstr ""
|
||||
msgid "Client certificate to use for authentication"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/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 ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:199
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:118
|
||||
#, c-format
|
||||
msgid "Invalid character in host name found: %c"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:199
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:118
|
||||
msgid "Validation conflict"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:551
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:514
|
||||
msgid "Add Certificate"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:552
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:515
|
||||
msgid "Certificate Files (*.cer;*.crt;*.der;*.p7b;*.pem)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:553
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:516
|
||||
msgid "X.509 Certificate Files (*.cer;*.crt;*.der;*.pem)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:554
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:517
|
||||
msgid "PKCS #7 Certificate Files (*.p7b)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:555
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:518
|
||||
msgid "All Files (*.*)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:571
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:534
|
||||
#, c-format
|
||||
msgid "Invalid or unsupported certificate file %s"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:571
|
||||
#, fuzzy
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:534
|
||||
msgid "Error"
|
||||
msgstr "Napaka pri nalaganju knjižnice MSI.DLL (%1!ld!)."
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:17
|
||||
msgid "Outer Identity"
|
||||
@@ -219,7 +361,7 @@ msgid "Select the user ID supplicant introduces itself as to authenticator:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:35
|
||||
msgid "&Same as inner identity"
|
||||
msgid "&True identity"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:36
|
||||
@@ -246,96 +388,93 @@ msgstr ""
|
||||
msgid "Custom outer identity to use"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:92
|
||||
msgid "Outer Authentication"
|
||||
#: 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/TTLS_UI.cpp:105
|
||||
#: 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 ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:111
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:114
|
||||
msgid "Select inner authentication method from the list"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:112
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:116
|
||||
msgid "PAP"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:217
|
||||
#: 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 ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:223
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:508
|
||||
#, c-format
|
||||
msgid "<error %u>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:246
|
||||
#: 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 ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:300
|
||||
#, c-format
|
||||
msgid "Error reading credentials from Credential Manager: %ls (error %u)"
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:817
|
||||
msgid "<Your Organization>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:303
|
||||
#, c-format
|
||||
msgid "Reading credentials failed (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:318
|
||||
#, c-format
|
||||
msgid "Error writing credentials to Credential Manager: %ls (error %u)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:321
|
||||
#, c-format
|
||||
msgid "Writing credentials failed (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:56
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:60
|
||||
msgid "EAP Method Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:81
|
||||
msgid "EAP Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Debug.Feature-2.idtx:3
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: EAPMethods/MSIBuild/En.x64.Debug.Feature-2.idtx:3
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
#, fuzzy
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Debug.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.x64.Debug.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "EAP Peer Methods"
|
||||
msgstr ""
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Debug.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.x64.Debug.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.Debug.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Debug.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
|
||||
msgid "TTLS"
|
||||
msgstr ""
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Debug.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Debug.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
|
||||
msgid "Tunneled Transport Layer Security"
|
||||
msgstr ""
|
||||
|
@@ -84,7 +84,7 @@ VOID WINAPI EapPeerFreeErrorMemory(_In_ EAP_ERROR *ppEapError)
|
||||
|
||||
|
||||
///
|
||||
/// Obtains a set of function pointers for an implementation of the EAP peer method currently loaded on the EAPHost service.
|
||||
/// Obtains a set of function pointers for an implementation of the EAP peer method currently loaded on the EapHost service.
|
||||
///
|
||||
/// \sa [EapPeerGetInfo function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363608.aspx)
|
||||
///
|
||||
@@ -135,7 +135,7 @@ DWORD WINAPI EapPeerGetInfo(_In_ EAP_TYPE* pEapType, _Out_ EAP_PEER_METHOD_ROUTI
|
||||
#pragma warning(disable: 4702) // Compiler is smart enough to find out the initialize() method is empty => never throws an exception.
|
||||
|
||||
///
|
||||
/// Initializes an EAP peer method for EAPHost.
|
||||
/// Initializes an EAP peer method for EapHost.
|
||||
///
|
||||
/// \sa [EapPeerGetInfo function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363613.aspx)
|
||||
///
|
||||
@@ -206,7 +206,7 @@ DWORD APIENTRY EapPeerShutdown(_Out_ EAP_ERROR **ppEapError)
|
||||
|
||||
|
||||
///
|
||||
/// Returns the user data and user identity after being called by EAPHost.
|
||||
/// 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)
|
||||
///
|
||||
@@ -263,7 +263,7 @@ DWORD APIENTRY EapPeerGetIdentity(
|
||||
|
||||
|
||||
///
|
||||
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
||||
/// Starts an EAP authentication session on the peer EapHost using the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
||||
///
|
||||
@@ -351,7 +351,7 @@ DWORD APIENTRY EapPeerEndSession(
|
||||
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
@@ -930,7 +930,7 @@ DWORD WINAPI EapPeerQueryInteractiveUIInputFields(
|
||||
|
||||
|
||||
///
|
||||
/// Converts user information into a user BLOB that can be consumed by EAPHost run-time functions.
|
||||
/// Converts user information into a user BLOB that can be consumed by EapHost run-time functions.
|
||||
///
|
||||
/// \sa [EapPeerQueryUIBlobFromInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204696.aspx)
|
||||
///
|
||||
|
@@ -66,19 +66,19 @@ bool wxEventMonitorApp::OnInit()
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Find EventMonitor window if already running.
|
||||
HWND okno = ::FindWindow(_T("wxWindowNR"), _("Event Monitor"));
|
||||
if (okno) {
|
||||
if (::IsIconic(okno))
|
||||
::SendMessage(okno, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
::SetActiveWindow(okno);
|
||||
::SetForegroundWindow(okno);
|
||||
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();
|
||||
m_mainWnd = new wxEventMonitorFrame(NULL);
|
||||
wxPersistentRegisterAndRestore<wxEventMonitorFrame>(m_mainWnd);
|
||||
m_mainWnd->Show();
|
||||
|
||||
|
@@ -48,8 +48,6 @@ wxETWEvent::wxETWEvent(wxEventType type, const EVENT_RECORD &record) :
|
||||
m_record(record),
|
||||
wxEvent(0, type)
|
||||
{
|
||||
DoSetExtendedData(record.ExtendedDataCount, record.ExtendedData);
|
||||
DoSetUserData(record.UserDataLength, record.UserData);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,92 +55,6 @@ wxETWEvent::wxETWEvent(const wxETWEvent& event) :
|
||||
m_record(event.m_record),
|
||||
wxEvent(event)
|
||||
{
|
||||
DoSetExtendedData(event.m_record.ExtendedDataCount, event.m_record.ExtendedData);
|
||||
DoSetUserData(event.m_record.UserDataLength, event.m_record.UserData);
|
||||
}
|
||||
|
||||
|
||||
wxETWEvent::~wxETWEvent()
|
||||
{
|
||||
if (m_record.ExtendedData)
|
||||
delete (unsigned char*)m_record.ExtendedData;
|
||||
|
||||
if (m_record.UserData)
|
||||
delete (unsigned char*)m_record.UserData;
|
||||
}
|
||||
|
||||
|
||||
bool wxETWEvent::SetExtendedData(size_t extended_data_count, const EVENT_HEADER_EXTENDED_DATA_ITEM *extended_data)
|
||||
{
|
||||
if (m_record.ExtendedData)
|
||||
delete (unsigned char*)m_record.ExtendedData;
|
||||
|
||||
return DoSetExtendedData(extended_data_count, extended_data);
|
||||
}
|
||||
|
||||
|
||||
bool wxETWEvent::SetUserData(size_t user_data_length, const void *user_data)
|
||||
{
|
||||
if (m_record.UserData)
|
||||
delete (unsigned char*)m_record.UserData;
|
||||
|
||||
return DoSetUserData(user_data_length, user_data);
|
||||
}
|
||||
|
||||
|
||||
bool wxETWEvent::DoSetExtendedData(size_t extended_data_count, const EVENT_HEADER_EXTENDED_DATA_ITEM *extended_data)
|
||||
{
|
||||
if (extended_data_count) {
|
||||
wxASSERT_MSG(extended_data, wxT("extended data is NULL"));
|
||||
|
||||
// Count the total required memory.
|
||||
size_t data_size = 0;
|
||||
for (size_t i = 0; i < extended_data_count; i++)
|
||||
data_size += extended_data[i].DataSize;
|
||||
|
||||
// Allocate memory for extended data.
|
||||
m_record.ExtendedData = (EVENT_HEADER_EXTENDED_DATA_ITEM*)(new unsigned char[sizeof(EVENT_HEADER_EXTENDED_DATA_ITEM)*extended_data_count + data_size]);
|
||||
wxCHECK_MSG(m_record.ExtendedData, false, wxT("extended data memory allocation failed"));
|
||||
|
||||
// Bulk-copy extended data descriptors.
|
||||
memcpy(m_record.ExtendedData, extended_data, sizeof(EVENT_HEADER_EXTENDED_DATA_ITEM) * extended_data_count);
|
||||
|
||||
// Copy the data.
|
||||
unsigned char *ptr = (unsigned char*)(m_record.ExtendedData + extended_data_count);
|
||||
for (size_t i = 0; i < extended_data_count; i++) {
|
||||
if (extended_data[i].DataSize) {
|
||||
memcpy(ptr, (void*)(extended_data[i].DataPtr), extended_data[i].DataSize);
|
||||
m_record.ExtendedData[i].DataPtr = (ULONGLONG)ptr;
|
||||
ptr += extended_data[i].DataSize;
|
||||
} else
|
||||
m_record.ExtendedData[i].DataPtr = NULL;
|
||||
}
|
||||
} else
|
||||
m_record.ExtendedData = NULL;
|
||||
|
||||
m_record.ExtendedDataCount = extended_data_count;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool wxETWEvent::DoSetUserData(size_t user_data_length, const void *user_data)
|
||||
{
|
||||
if (user_data_length) {
|
||||
wxASSERT_MSG(user_data, wxT("user data is NULL"));
|
||||
|
||||
// Allocate memory for user data.
|
||||
m_record.UserData = new unsigned char[user_data_length];
|
||||
wxCHECK_MSG(m_record.UserData, false, wxT("user data memory allocation failed"));
|
||||
|
||||
// Copy user data.
|
||||
memcpy(m_record.UserData, user_data, user_data_length);
|
||||
} else
|
||||
m_record.UserData = NULL;
|
||||
|
||||
m_record.UserDataLength = user_data_length;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,12 +150,18 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
// {6EB8DB94-FE96-443F-A366-5FE0CEE7FB1C}
|
||||
const GUID wxETWListCtrl::s_provider_eaphost = { 0X6EB8DB94, 0XFE96, 0X443F, { 0XA3, 0X66, 0X5F, 0XE0, 0XCE, 0XE7, 0XFB, 0X1C } };
|
||||
const GUID wxETWListCtrl::s_provider_eaphost = { 0x6EB8DB94, 0xFE96, 0x443F, { 0xA3, 0x66, 0x5F, 0xE0, 0xCE, 0xE7, 0xFB, 0x1C } };
|
||||
|
||||
// {1F678132-5938-4686-9FDC-C8FF68F15C85}
|
||||
const GUID wxETWListCtrl::s_provider_schannel = { 0x1F678132, 0x5938, 0x4686, { 0x9F, 0xDC, 0xC8, 0xFF, 0x68, 0xF1, 0x5C, 0x85 } };
|
||||
|
||||
|
||||
wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) :
|
||||
m_proc(NULL),
|
||||
m_item_id(0),
|
||||
m_scroll_auto(true),
|
||||
m_level(TRACE_LEVEL_INFORMATION),
|
||||
m_rec_db(wxETWEVENT_RECORDS_MAX),
|
||||
m_rec_idx(wxETWEVENT_RECORDS_MAX),
|
||||
wxListCtrl(parent, id, pos, size, style, validator, name)
|
||||
{
|
||||
this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, 100);
|
||||
@@ -252,6 +170,32 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, 100);
|
||||
this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE_USEHEADER);
|
||||
|
||||
// Maximum expected column widths for pre-formatted row display
|
||||
m_col_format_width[0] = 26;
|
||||
m_col_format_width[1] = 5;
|
||||
m_col_format_width[2] = 5;
|
||||
m_col_format_width[3] = std::max<int>(std::max<int>(_countof("EapHost"), _countof("Schannel")), _countof(PRODUCT_NAME_STR)) - 1;
|
||||
m_col_format_width[4] = 0;
|
||||
|
||||
// Prepare all possible item attributes.
|
||||
wxColour col_bg((unsigned long)0xffffff);
|
||||
m_item_attr[0][0].SetBackgroundColour(col_bg );
|
||||
m_item_attr[0][0].SetTextColour ((unsigned long)0x666666);
|
||||
m_item_attr[0][1].SetBackgroundColour(col_bg );
|
||||
m_item_attr[0][1].SetTextColour ((unsigned long)0x000000);
|
||||
m_item_attr[0][2].SetBackgroundColour(col_bg );
|
||||
m_item_attr[0][2].SetTextColour ((unsigned long)0x00aacc);
|
||||
m_item_attr[0][3].SetBackgroundColour(col_bg );
|
||||
m_item_attr[0][3].SetTextColour ((unsigned long)0x0000ff);
|
||||
m_item_attr[1][0].SetBackgroundColour(col_bg );
|
||||
m_item_attr[1][0].SetTextColour ((unsigned long)0xcccccc);
|
||||
m_item_attr[1][1].SetBackgroundColour(col_bg );
|
||||
m_item_attr[1][1].SetTextColour ((unsigned long)0xaaaaaa);
|
||||
m_item_attr[1][2].SetBackgroundColour(col_bg );
|
||||
m_item_attr[1][2].SetTextColour ((unsigned long)0xaaeeee);
|
||||
m_item_attr[1][3].SetBackgroundColour(col_bg );
|
||||
m_item_attr[1][3].SetTextColour ((unsigned long)0xaaaaff);
|
||||
|
||||
// Start a new session.
|
||||
ULONG ulResult;
|
||||
for (unsigned int i = 0; ; i++) {
|
||||
@@ -304,9 +248,11 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
0,
|
||||
NULL)) != ERROR_SUCCESS)
|
||||
{
|
||||
wxLogError(_("Error enabling event provider (error %u)."), ulResult);
|
||||
wxLogDebug(wxString::Format(_("Error enabling %s event provider (error %u)."), wxT(PRODUCT_NAME_STR)), ulResult);
|
||||
return;
|
||||
}
|
||||
m_sources.insert(EAPMETHOD_TRACE_EVENT_PROVIDER);
|
||||
|
||||
if ((ulResult = EnableTraceEx(
|
||||
&s_provider_eaphost,
|
||||
&((const EVENT_TRACE_PROPERTIES*)m_session)->Wnode.Guid,
|
||||
@@ -317,14 +263,28 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
0,
|
||||
NULL)) != ERROR_SUCCESS)
|
||||
{
|
||||
// If the EAPHost trace provider failed to enable, do not despair.
|
||||
wxLogDebug(_("Error enabling EAPHost event provider (error %u)."), ulResult);
|
||||
// If the EapHost trace provider failed to enable, do not despair.
|
||||
wxLogDebug(wxString::Format(_("Error enabling %s event provider (error %u)."), wxT("EapHost")), ulResult);
|
||||
}
|
||||
|
||||
if ((ulResult = EnableTraceEx(
|
||||
&s_provider_schannel,
|
||||
&((const EVENT_TRACE_PROPERTIES*)m_session)->Wnode.Guid,
|
||||
m_session,
|
||||
EVENT_CONTROL_CODE_ENABLE_PROVIDER,
|
||||
TRACE_LEVEL_VERBOSE,
|
||||
0, 0,
|
||||
0,
|
||||
NULL)) != ERROR_SUCCESS)
|
||||
{
|
||||
// If the Schannel trace provider failed to enable, do not despair.
|
||||
wxLogDebug(wxString::Format(_("Error enabling %s event provider (error %u)."), wxT("Schannel")), ulResult);
|
||||
}
|
||||
|
||||
// Process events in separate thread, not to block wxWidgets' message pump.
|
||||
wxArrayString sessions;
|
||||
sessions.Add(m_session.name());
|
||||
m_proc = new wxEventTraceProcessorThread(this->GetEventHandler(), sessions);
|
||||
m_proc = new wxEventTraceProcessorThread(GetEventHandler(), sessions);
|
||||
wxASSERT_MSG(m_proc, wxT("error allocating thread memory"));
|
||||
if (m_proc->Run() != wxTHREAD_NO_ERROR) {
|
||||
wxFAIL_MSG("Can't create the thread!");
|
||||
@@ -344,6 +304,16 @@ wxETWListCtrl::~wxETWListCtrl()
|
||||
}
|
||||
|
||||
// Disable event providers.
|
||||
EnableTraceEx(
|
||||
&s_provider_schannel,
|
||||
&((const EVENT_TRACE_PROPERTIES*)m_session)->Wnode.Guid,
|
||||
m_session,
|
||||
EVENT_CONTROL_CODE_DISABLE_PROVIDER,
|
||||
TRACE_LEVEL_VERBOSE,
|
||||
0, 0,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
EnableTraceEx(
|
||||
&s_provider_eaphost,
|
||||
&((const EVENT_TRACE_PROPERTIES*)m_session)->Wnode.Guid,
|
||||
@@ -367,24 +337,235 @@ wxETWListCtrl::~wxETWListCtrl()
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::OnETWEvent(wxETWEvent& event)
|
||||
void wxETWListCtrl::CopySelected() const
|
||||
{
|
||||
EVENT_RECORD &rec = event.GetRecord();
|
||||
// Prepare text in ANSI and Unicode flavours.
|
||||
string dataA, rowA;
|
||||
wstring dataW, rowW;
|
||||
for (long item = -1; (item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != -1;) {
|
||||
FormatRow(m_rec_db.at_abs(m_rec_idx.at(item)), rowA, rowW);
|
||||
rowA += "\r\n"; dataA += rowA;
|
||||
rowW += L"\r\n"; dataW += rowW;
|
||||
}
|
||||
|
||||
// Put text to clipboard.
|
||||
CopyToClipboard(dataA, dataW);
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::CopyAll() const
|
||||
{
|
||||
// Prepare text in ANSI and Unicode flavours.
|
||||
string dataA, rowA;
|
||||
wstring dataW, rowW;
|
||||
for (size_t i = 0, n = m_rec_db.size(); i < n; i++) {
|
||||
FormatRow(m_rec_db[i], rowA, rowW);
|
||||
rowA += "\r\n"; dataA += rowA;
|
||||
rowW += L"\r\n"; dataW += rowW;
|
||||
}
|
||||
|
||||
// Put text to clipboard.
|
||||
CopyToClipboard(dataA, dataW);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::ClearAll()
|
||||
{
|
||||
m_rec_idx.clear();
|
||||
m_rec_db.clear();
|
||||
if (GetItemCount())
|
||||
SetItemCount(0);
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::SelectAll()
|
||||
{
|
||||
for (long item = 0, count = GetItemCount(); item < count; item++)
|
||||
SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::SelectNone()
|
||||
{
|
||||
for (long item = -1; (item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != -1;)
|
||||
SetItemState(item, 0, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::RebuildItems()
|
||||
{
|
||||
ChildrenRepositioningGuard child_reposition(this);
|
||||
|
||||
// Get current focus and selection.
|
||||
set<size_t> focus, selection;
|
||||
for (long item = -1; (item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED)) != -1;)
|
||||
focus.insert(m_rec_idx[item]);
|
||||
for (long item = -1; (item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != -1;)
|
||||
selection.insert(m_rec_idx[item]);
|
||||
|
||||
// Get current view position (scrolling).
|
||||
long
|
||||
item_top = GetTopItem(),
|
||||
item_page_count = GetCountPerPage(),
|
||||
item_center = std::min<long>(
|
||||
item_top + item_page_count / 2, // Index of item in the centre of the view
|
||||
(item_top + m_rec_idx.size()) / 2); // Index of the item in the centre between top viewed item and the last (when list is not overflowed)
|
||||
size_t center = item_center < m_rec_idx.size() ? m_rec_idx[item_center] : -1;
|
||||
|
||||
// Rebuild the index.
|
||||
m_rec_idx.clear();
|
||||
set<size_t>::const_iterator selection_end = selection.end(), focus_end = focus.end();
|
||||
vector<long> selection_out, focus_out;
|
||||
long center_out = -1;
|
||||
for (size_t i = 0, n = m_rec_db.size(); i < n; i++) {
|
||||
size_t i_abs = m_rec_db.abs(i);
|
||||
if (i_abs == center)
|
||||
center_out = m_rec_idx.size();
|
||||
if (IsVisible(m_rec_db[i])) {
|
||||
if (selection.find(i_abs) != selection_end)
|
||||
selection_out.push_back(m_rec_idx.size());
|
||||
if (focus.find(i_abs) != focus_end)
|
||||
focus_out.push_back(m_rec_idx.size());
|
||||
m_rec_idx.push_back(i_abs);
|
||||
}
|
||||
}
|
||||
|
||||
// Set new item count.
|
||||
long item_count = (long)m_rec_idx.size();
|
||||
if (GetItemCount() != item_count)
|
||||
SetItemCount(item_count);
|
||||
|
||||
if (item_count) {
|
||||
// Restore focus and selection.
|
||||
for (size_t i = 0, n = focus_out.size(); i < n; i++)
|
||||
SetItemState(focus_out[i], wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
|
||||
SelectNone();
|
||||
for (size_t i = 0, n = selection_out.size(); i < n; i++)
|
||||
SetItemState(selection_out[i], wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
|
||||
// Restore scrolling.
|
||||
if (center_out != -1) {
|
||||
wxRect pos1, pos2;
|
||||
GetItemRect(GetTopItem(), pos1);
|
||||
GetItemRect(std::max<long>(std::min<long>(center_out, item_count - 1) - item_page_count / 2, 0), pos2);
|
||||
ScrollList(pos2.x - pos1.x, pos2.y - pos1.y);
|
||||
} else
|
||||
EnsureVisible(item_count - 1);
|
||||
|
||||
// Refresh items.
|
||||
item_top = GetTopItem();
|
||||
RefreshItems(item_top, std::min<long>(item_top + item_page_count, item_count));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool wxETWListCtrl::IsVisible(const EVENT_RECORD &rec) const
|
||||
{
|
||||
return
|
||||
m_sources.find(rec.EventHeader.ProviderId) != m_sources.end() &&
|
||||
rec.EventHeader.EventDescriptor.Level <= m_level;
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::FormatRow(const event_rec &rec, std::string &rowA, std::wstring &rowW) const
|
||||
{
|
||||
rowA.clear();
|
||||
rowW.clear();
|
||||
|
||||
// Merge columns.
|
||||
string colA;
|
||||
wxString colW;
|
||||
for (size_t i = 0; i < _countof(m_col_format_width); i++) {
|
||||
// Get column text.
|
||||
colW = OnGetItemText(rec, i);
|
||||
size_t len = colW.Length();
|
||||
if (len < m_col_format_width[i]) {
|
||||
// Pad it to required length.
|
||||
colW.Append(wxT(' '), m_col_format_width[i] - len);
|
||||
} else if (m_col_format_width[i] && len > m_col_format_width[i]) {
|
||||
// Truncate it and add horizontal ellipsis.
|
||||
colW.Truncate(m_col_format_width[i] - 3);
|
||||
colW.Append(wxT("..."));
|
||||
}
|
||||
|
||||
// Convert to ACP.
|
||||
WideCharToMultiByte(CP_ACP, 0, colW.c_str(), -1, colA, NULL, NULL);
|
||||
|
||||
// Append to output.
|
||||
if (i) {
|
||||
rowA += " ";
|
||||
rowW += L" ";
|
||||
}
|
||||
rowA += colA;
|
||||
rowW += colW;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool wxETWListCtrl::CopyToClipboard(const std::string &dataA, const std::wstring &dataW) const
|
||||
{
|
||||
if (OpenClipboard(GetHWND())) {
|
||||
EmptyClipboard();
|
||||
|
||||
HGLOBAL h;
|
||||
size_t size;
|
||||
|
||||
size = (dataA.length() + 1) * sizeof(CHAR);
|
||||
h = GlobalAlloc(GMEM_MOVEABLE, size);
|
||||
if (h) {
|
||||
LPVOID d = GlobalLock(h);
|
||||
if (d) {
|
||||
memcpy(d, dataA.data(), size);
|
||||
GlobalUnlock(h);
|
||||
SetClipboardData(CF_TEXT, h);
|
||||
}
|
||||
}
|
||||
|
||||
size = (dataW.length() + 1) * sizeof(WCHAR);
|
||||
h = GlobalAlloc(GMEM_MOVEABLE, size);
|
||||
if (h) {
|
||||
LPVOID d = GlobalLock(h);
|
||||
if (d) {
|
||||
memcpy(d, dataW.data(), size);
|
||||
GlobalUnlock(h);
|
||||
SetClipboardData(CF_UNICODETEXT, h);
|
||||
}
|
||||
}
|
||||
|
||||
CloseClipboard();
|
||||
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wxListItemAttr *wxETWListCtrl::OnGetItemAttr(long item) const
|
||||
{
|
||||
const event_rec &rec = m_rec_db.at_abs(m_rec_idx.at(item));
|
||||
bool is_ours = IsEqualGUID(rec.EventHeader.ProviderId, EAPMETHOD_TRACE_EVENT_PROVIDER) ? true : false;
|
||||
int column = 0;
|
||||
|
||||
// Prepare item to insert into the list.
|
||||
wxListItem item;
|
||||
item.SetId(m_item_id++);
|
||||
item.SetTextColour(
|
||||
rec.EventHeader.EventDescriptor.Level >= TRACE_LEVEL_VERBOSE ? (is_ours ? 0x666666 : 0xcccccc) :
|
||||
rec.EventHeader.EventDescriptor.Level >= TRACE_LEVEL_INFORMATION ? (is_ours ? 0x000000 : 0xaaaaaa) :
|
||||
rec.EventHeader.EventDescriptor.Level >= TRACE_LEVEL_WARNING ? (is_ours ? 0x00aacc : 0xaaeeee) :
|
||||
(is_ours ? 0x0000ff : 0xaaaaff));
|
||||
item.SetBackgroundColour(0xffffff);
|
||||
// Select appropriate attributes acording to race, colour, or creed...
|
||||
return (wxListItemAttr*)(
|
||||
((const EVENT_RECORD&)rec).EventHeader.EventDescriptor.Level >= TRACE_LEVEL_VERBOSE ? (is_ours ? &(m_item_attr[0][0]) : &(m_item_attr[1][0])) :
|
||||
((const EVENT_RECORD&)rec).EventHeader.EventDescriptor.Level >= TRACE_LEVEL_INFORMATION ? (is_ours ? &(m_item_attr[0][1]) : &(m_item_attr[1][1])) :
|
||||
((const EVENT_RECORD&)rec).EventHeader.EventDescriptor.Level >= TRACE_LEVEL_WARNING ? (is_ours ? &(m_item_attr[0][2]) : &(m_item_attr[1][2])) :
|
||||
(is_ours ? &(m_item_attr[0][3]) : &(m_item_attr[1][3])));
|
||||
}
|
||||
|
||||
{
|
||||
// Output event time-stamp.
|
||||
|
||||
wxString wxETWListCtrl::OnGetItemText(long item, long column) const
|
||||
{
|
||||
return OnGetItemText(m_rec_db.at_abs(m_rec_idx.at(item)), column);
|
||||
}
|
||||
|
||||
|
||||
wxString wxETWListCtrl::OnGetItemText(const event_rec &rec, long column) const
|
||||
{
|
||||
switch (column) {
|
||||
case 0: {
|
||||
// Get event time-stamp.
|
||||
FILETIME ft;
|
||||
ft.dwHighDateTime = rec.EventHeader.TimeStamp.HighPart;
|
||||
ft.dwLowDateTime = rec.EventHeader.TimeStamp.LowPart;
|
||||
@@ -395,39 +576,36 @@ void wxETWListCtrl::OnETWEvent(wxETWEvent& event)
|
||||
|
||||
ULONGLONG
|
||||
ts = rec.EventHeader.TimeStamp.QuadPart,
|
||||
nanosec = (ts % 10000000) * 100;
|
||||
microsec = (ts % 10000000) / 10;
|
||||
|
||||
item.SetColumn(column++);
|
||||
item.SetText(tstring_printf(_T("%04d-%02d-%02d %02d:%02d:%02d.%09I64u"),
|
||||
st_local.wYear, st_local.wMonth, st_local.wDay, st_local.wHour, st_local.wMinute, st_local.wSecond, nanosec));
|
||||
this->InsertItem(item);
|
||||
return tstring_printf(_T("%04d-%02d-%02d %02d:%02d:%02d.%06I64u"),
|
||||
st_local.wYear, st_local.wMonth, st_local.wDay, st_local.wHour, st_local.wMinute, st_local.wSecond, microsec);
|
||||
}
|
||||
|
||||
// Output process ID.
|
||||
item.SetColumn(column++);
|
||||
item.SetText(wxString::Format(wxT("%u"), rec.EventHeader.ProcessId));
|
||||
this->SetItem(item);
|
||||
case 1:
|
||||
// Get process ID.
|
||||
return wxString::Format(wxT("%u"), rec.EventHeader.ProcessId);
|
||||
|
||||
// Output thread ID.
|
||||
item.SetColumn(column++);
|
||||
item.SetText(wxString::Format(wxT("%u"), rec.EventHeader.ThreadId));
|
||||
this->SetItem(item);
|
||||
case 2:
|
||||
// Get thread ID.
|
||||
return wxString::Format(wxT("%u"), rec.EventHeader.ThreadId);
|
||||
|
||||
// Output event source.
|
||||
item.SetColumn(column++);
|
||||
item.SetText(is_ours ? wxT(PRODUCT_NAME_STR) : wxT("EAPHost"));
|
||||
this->SetItem(item);
|
||||
case 3:
|
||||
// Get event source.
|
||||
return
|
||||
IsEqualGUID(rec.EventHeader.ProviderId, EAPMETHOD_TRACE_EVENT_PROVIDER) ? wxT(PRODUCT_NAME_STR) :
|
||||
IsEqualGUID(rec.EventHeader.ProviderId, s_provider_eaphost ) ? wxT("EapHost" ) :
|
||||
IsEqualGUID(rec.EventHeader.ProviderId, s_provider_schannel ) ? wxT("Schannel" ) : wxEmptyString;
|
||||
|
||||
item.SetColumn(column++);
|
||||
{
|
||||
case 4: {
|
||||
// Get event meta-info.
|
||||
unique_ptr<TRACE_EVENT_INFO> info;
|
||||
ULONG ulResult;
|
||||
if ((ulResult = TdhGetEventInformation(&rec, 0, NULL, info)) == ERROR_SUCCESS) {
|
||||
if ((ulResult = TdhGetEventInformation((PEVENT_RECORD)&rec, 0, NULL, info)) == ERROR_SUCCESS) {
|
||||
if (info->DecodingSource != DecodingSourceWPP) {
|
||||
if (rec.EventHeader.Flags & EVENT_HEADER_FLAG_STRING_ONLY) {
|
||||
// This is a string-only event. Print it.
|
||||
item.SetText((LPCWSTR)rec.UserData);
|
||||
return (LPCWSTR)rec.UserData;
|
||||
} else {
|
||||
// This is not a string-only event. Prepare parameters.
|
||||
|
||||
@@ -437,25 +615,146 @@ void wxETWListCtrl::OnETWEvent(wxETWEvent& event)
|
||||
props.reserve(info->TopLevelPropertyCount);
|
||||
props_msg.reserve(info->TopLevelPropertyCount);
|
||||
for (ULONG i = 0; i < info->TopLevelPropertyCount; i++) {
|
||||
props.push_back(std::move(PropertyToString(&rec, info.get(), i, NULL, 0, nPtrSize)));
|
||||
props.push_back(std::move(PropertyToString((PEVENT_RECORD)&rec, info.get(), i, NULL, 0, nPtrSize)));
|
||||
props_msg.push_back((DWORD_PTR)props[i].c_str());
|
||||
}
|
||||
|
||||
if (info->EventMessageOffset) {
|
||||
// Format the message.
|
||||
item.SetText(wstring_msg(0, (LPCTSTR)((LPCBYTE)info.get() + info->EventMessageOffset), props_msg.data()).c_str());
|
||||
return wstring_msg(0, (LPCTSTR)((LPCBYTE)info.get() + info->EventMessageOffset), props_msg.data()).c_str();
|
||||
}
|
||||
}
|
||||
} else if (info->EventMessageOffset) {
|
||||
// This is a WPP event.
|
||||
item.SetText((LPCWSTR)((LPCBYTE)info.get() + info->EventMessageOffset));
|
||||
return (LPCWSTR)((LPCBYTE)info.get() + info->EventMessageOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this->SetItem(item);
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
void wxETWListCtrl::OnETWEvent(wxETWEvent& event)
|
||||
{
|
||||
// Move event, since event handlers will have no use of it and destroy it in the end.
|
||||
// This way we save memory allocation and copying.
|
||||
event_rec rec(std::move(event.GetRecord()));
|
||||
|
||||
// Is event visible according to current view settings?
|
||||
bool is_visible = IsVisible(rec);
|
||||
|
||||
// Move event to the end of the queue.
|
||||
size_t pos = m_rec_db.push_back(std::move(rec));
|
||||
|
||||
bool has_moved;
|
||||
if (!m_rec_idx.empty() && m_rec_idx.front() == pos) {
|
||||
// This event overwrote previous head element in index.
|
||||
m_rec_idx.pop_front();
|
||||
has_moved = true;
|
||||
} else
|
||||
has_moved = false;
|
||||
|
||||
if (is_visible) {
|
||||
// Push event absolute subscript to the index too.
|
||||
m_rec_idx.push_back(pos);
|
||||
}
|
||||
|
||||
long item_count = (long)m_rec_idx.size();
|
||||
if (GetItemCount() != item_count)
|
||||
SetItemCount(item_count);
|
||||
|
||||
if (item_count) {
|
||||
if (m_scroll_auto) {
|
||||
// Bring the record into view.
|
||||
this->EnsureVisible(item.GetId());
|
||||
EnsureVisible(item_count - 1);
|
||||
}
|
||||
|
||||
if (has_moved) {
|
||||
long item_top = GetTopItem();
|
||||
RefreshItems(item_top, std::min<long>(item_top + GetCountPerPage(), item_count));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// wxPersistentETWListCtrl
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxPersistentETWListCtrl::wxPersistentETWListCtrl(wxETWListCtrl *wnd) : wxPersistentWindow<wxETWListCtrl>(wnd)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxString wxPersistentETWListCtrl::GetKind() const
|
||||
{
|
||||
return wxT(wxPERSIST_TLW_KIND);
|
||||
}
|
||||
|
||||
|
||||
void wxPersistentETWListCtrl::Save() const
|
||||
{
|
||||
const wxETWListCtrl * const wnd = static_cast<const wxETWListCtrl*>(GetWindow());
|
||||
|
||||
// Save log's column widths.
|
||||
wxListItem col;
|
||||
col.SetMask(wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH);
|
||||
for (int i = 0, n = wnd->GetColumnCount(); i < n; i++) {
|
||||
wnd->GetColumn(i, col);
|
||||
SaveValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), col.GetWidth());
|
||||
}
|
||||
|
||||
SaveValue(wxT("ScrollAuto" ), wnd->m_scroll_auto);
|
||||
|
||||
SaveValue(wxT("SourceCount"), (long)wnd->m_sources.size());
|
||||
long i = 0;
|
||||
for (wxETWListCtrl::guidset::const_iterator src = wnd->m_sources.cbegin(), src_end = wnd->m_sources.cend(); src != src_end; ++src, i++)
|
||||
SaveValue(wxString::Format(wxT("Source%u"), i), tstring_guid(*src));
|
||||
|
||||
SaveValue(wxT("Level"), (int)wnd->m_level);
|
||||
}
|
||||
|
||||
|
||||
bool wxPersistentETWListCtrl::Restore()
|
||||
{
|
||||
wxETWListCtrl * const wnd = static_cast<wxETWListCtrl*>(GetWindow());
|
||||
|
||||
// Restore log's column widths.
|
||||
wxListItem col;
|
||||
col.SetMask(wxLIST_MASK_TEXT);
|
||||
for (int i = 0, n = wnd->GetColumnCount(); i < n; i++) {
|
||||
wnd->GetColumn(i, col);
|
||||
|
||||
int width;
|
||||
if (RestoreValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), &width))
|
||||
wnd->SetColumnWidth(i, width);
|
||||
}
|
||||
|
||||
RestoreValue(wxT("ScrollAuto"), &(wnd->m_scroll_auto));
|
||||
|
||||
wnd->m_sources.clear();
|
||||
long n;
|
||||
if (RestoreValue(wxT("SourceCount"), &n)) {
|
||||
wxString guid_str;
|
||||
for (long i = 0; i < n; i++) {
|
||||
if (RestoreValue(wxString::Format(wxT("Source%u"), i), &guid_str)) {
|
||||
GUID guid;
|
||||
if (StringToGuid(guid_str.c_str(), &guid))
|
||||
wnd->m_sources.insert(guid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Insert our provider by default.
|
||||
wnd->m_sources.insert(EAPMETHOD_TRACE_EVENT_PROVIDER);
|
||||
}
|
||||
|
||||
int dummy_int;
|
||||
if (RestoreValue(wxT("Level"), &dummy_int))
|
||||
wnd->m_level = (UCHAR)std::min<int>(std::max<int>(dummy_int, TRACE_LEVEL_ERROR), TRACE_LEVEL_VERBOSE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -20,6 +20,11 @@
|
||||
|
||||
#include <wx/event.h>
|
||||
|
||||
///
|
||||
/// Maximum number of event records kept
|
||||
///
|
||||
#define wxETWEVENT_RECORDS_MAX 1000000
|
||||
|
||||
///
|
||||
/// ETW event
|
||||
///
|
||||
@@ -28,24 +33,32 @@ 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;
|
||||
|
||||
///
|
||||
/// Event trace processor
|
||||
/// Supports saving/restoring wxETWListCtrl state
|
||||
///
|
||||
class wxEventTraceProcessorThread;
|
||||
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
|
||||
@@ -53,23 +66,10 @@ class wxETWEvent : public wxEvent
|
||||
public:
|
||||
wxETWEvent(wxEventType type = wxEVT_NULL, const EVENT_RECORD &record = s_record_null);
|
||||
wxETWEvent(const wxETWEvent& event);
|
||||
virtual ~wxETWEvent();
|
||||
virtual wxEvent *Clone() const { return new wxETWEvent(*this); }
|
||||
|
||||
inline const EVENT_RECORD& GetRecord() const { return m_record; }
|
||||
inline EVENT_RECORD& GetRecord() { return m_record; }
|
||||
|
||||
inline const EVENT_HEADER& GetHeader() const { return m_record.EventHeader; }
|
||||
|
||||
inline const ETW_BUFFER_CONTEXT& GetBufferContext() const { return m_record.BufferContext; }
|
||||
|
||||
bool SetExtendedData(size_t extended_data_count, const EVENT_HEADER_EXTENDED_DATA_ITEM *extended_data);
|
||||
inline size_t GetExtendedDataCount() const { return m_record.ExtendedDataCount; }
|
||||
inline const EVENT_HEADER_EXTENDED_DATA_ITEM& GetExtendedData(size_t index) const { wxASSERT(index < m_record.ExtendedDataCount); return m_record.ExtendedData[index]; }
|
||||
|
||||
bool SetUserData(size_t user_data_length, const void *user_data);
|
||||
inline size_t GetUserDataLength() const { return m_record.UserDataLength; }
|
||||
inline void *GetUserData() const { return m_record.UserData; }
|
||||
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);
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
static const EVENT_RECORD s_record_null;
|
||||
|
||||
protected:
|
||||
EVENT_RECORD m_record; ///< ETW event record
|
||||
winstd::event_rec m_record; ///< ETW event record
|
||||
};
|
||||
|
||||
|
||||
@@ -111,26 +111,116 @@ protected:
|
||||
|
||||
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_SINGLE_SEL|wxNO_BORDER,
|
||||
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:
|
||||
static const GUID s_provider_eaphost; ///< EAPHost event provider ID
|
||||
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
|
||||
long m_item_id; ///< Next free list item ID
|
||||
|
||||
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);
|
||||
}
|
||||
|
Binary file not shown.
@@ -25,27 +25,239 @@
|
||||
// wxEventMonitorFrame
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxBEGIN_EVENT_TABLE(wxEventMonitorFrame, wxEventMonitorFrameBase)
|
||||
EVT_MENU(wxID_EXIT, wxEventMonitorFrame::OnExit)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
|
||||
wxEventMonitorFrame::wxEventMonitorFrame() : wxEventMonitorFrameBase(NULL)
|
||||
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__
|
||||
wxIcon icon_small(wxT("00_EventMonitor.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
|
||||
wxIconBundle icons;
|
||||
icons.AddIcon(icon_small);
|
||||
icons.AddIcon(wxIcon(wxT("00_EventMonitor.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)));
|
||||
SetIcons(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
|
||||
wxIcon icon_small(wxICON(00_EventMonitor.ico));
|
||||
SetIcon(icon_small);
|
||||
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, _("&Edit toolbar"), _("Toggles display of Edit toolbar"), wxITEM_CHECK);
|
||||
m_menuView->Append(m_menuViewToolbarEdit);
|
||||
|
||||
wxMenuItem* m_menuViewToolbarView;
|
||||
m_menuViewToolbarView = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_VIEW, _("&View toolbar"), _("Toggles display of View toolbar"), 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(_("Log Trace")).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();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +267,147 @@ void wxEventMonitorFrame::OnExit(wxCommandEvent& /*event*/)
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -30,20 +30,92 @@ 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 wxEventMonitorFrameBase
|
||||
|
||||
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();
|
||||
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);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -51,13 +51,7 @@ void wxPersistentEventMonitorLogPanel::Save() const
|
||||
{
|
||||
const wxEventMonitorLogPanel * const wnd = static_cast<const wxEventMonitorLogPanel*>(GetWindow());
|
||||
|
||||
// Save log's column widths.
|
||||
wxListItem col;
|
||||
col.SetMask(wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH);
|
||||
for (int i = 0, n = wnd->m_log->GetColumnCount(); i < n; i++) {
|
||||
wnd->m_log->GetColumn(i, col);
|
||||
SaveValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), col.GetWidth());
|
||||
}
|
||||
wxPersistentETWListCtrl(wnd->m_log).Save();
|
||||
}
|
||||
|
||||
|
||||
@@ -65,16 +59,7 @@ bool wxPersistentEventMonitorLogPanel::Restore()
|
||||
{
|
||||
wxEventMonitorLogPanel * const wnd = static_cast<wxEventMonitorLogPanel*>(GetWindow());
|
||||
|
||||
// Restore log's column widths.
|
||||
wxListItem col;
|
||||
col.SetMask(wxLIST_MASK_TEXT);
|
||||
for (int i = 0, n = wnd->m_log->GetColumnCount(); i < n; i++) {
|
||||
wnd->m_log->GetColumn(i, col);
|
||||
|
||||
int width;
|
||||
if (RestoreValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), &width))
|
||||
wnd->m_log->SetColumnWidth(i, width);
|
||||
}
|
||||
wxPersistentETWListCtrl(wnd->m_log).Restore();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -25,9 +25,12 @@
|
||||
#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>
|
||||
@@ -43,6 +46,8 @@
|
||||
#include <Sddl.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#include <EventsETW.h> // Must include after <Windows.h>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EventMonitor\n"
|
||||
"POT-Creation-Date: 2016-07-15 13:05+0200\n"
|
||||
"POT-Creation-Date: 2016-08-27 07:52+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"
|
||||
@@ -17,31 +17,214 @@ msgstr ""
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: App.cpp:69 wxEventMonitor_UI.h:54
|
||||
#: 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 ""
|
||||
|
||||
#: LogPanel.cpp:30
|
||||
#: ETWLog.cpp:83
|
||||
#, c-format
|
||||
msgid "Error opening event trace (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:171
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
#: LogPanel.cpp:31
|
||||
#: ETWLog.cpp:172
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:173
|
||||
msgid "TID"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:174
|
||||
msgid "Source"
|
||||
msgstr ""
|
||||
|
||||
#: wxEventMonitor_UI.cpp:23
|
||||
#: ETWLog.cpp:175
|
||||
msgid "Event"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:232
|
||||
msgid "Access denied creating event session: you need administrative privileges (Run As Administrator) or be a member of Performance Log Users group to start event tracing session."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:235
|
||||
#, c-format
|
||||
msgid "The %s event session already exists."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:239
|
||||
#, c-format
|
||||
msgid "Error creating event session (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:255 ETWLog.cpp:270 ETWLog.cpp:284
|
||||
#, 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 ""
|
||||
|
||||
#: wxEventMonitor_UI.cpp:23
|
||||
msgid "Quit this program"
|
||||
#: Frame.cpp:65
|
||||
msgid "Quits this program"
|
||||
msgstr ""
|
||||
|
||||
#: wxEventMonitor_UI.cpp:26
|
||||
#: Frame.cpp:69
|
||||
#, fuzzy
|
||||
msgid "&Program"
|
||||
msgstr "You don't have %s subscription yet."
|
||||
|
||||
#: wxEventMonitor_UI.cpp:32
|
||||
#: 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
|
||||
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
|
||||
#, fuzzy
|
||||
msgid "Error"
|
||||
msgstr "Napaka pri nalaganju knjižnice MSI.DLL (%1!ld!)."
|
||||
|
||||
#: Frame.cpp:135 Frame.cpp:182
|
||||
msgid "Displays error level records only"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:142
|
||||
msgid "&Edit toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:142
|
||||
msgid "Toggles display of Edit toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:146
|
||||
msgid "&View toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:146
|
||||
msgid "Toggles display of View toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: 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:185
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:189
|
||||
msgid "Log Trace"
|
||||
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
|
||||
#, fuzzy
|
||||
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 ""
|
||||
|
||||
#: 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 ""
|
||||
|
@@ -13,54 +13,12 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEventMonitorFrameBase::wxEventMonitorFrameBase( 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);
|
||||
|
||||
m_menubar = new wxMenuBar( 0 );
|
||||
m_menuProgram = new wxMenu();
|
||||
wxMenuItem* m_menuItemExit;
|
||||
m_menuItemExit = new wxMenuItem( m_menuProgram, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Alt+F4"), _("Quit this program"), wxITEM_NORMAL );
|
||||
m_menuProgram->Append( m_menuItemExit );
|
||||
|
||||
m_menubar->Append( m_menuProgram, _("&Program") );
|
||||
|
||||
this->SetMenuBar( m_menubar );
|
||||
|
||||
m_panel = new wxEventMonitorLogPanel( this );
|
||||
|
||||
m_mgr.AddPane( m_panel, wxAuiPaneInfo() .Name( wxT("LogPanel") ).Center() .Caption( _("Log Trace") ).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 );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxEventMonitorFrameBase::OnClose ) );
|
||||
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxEventMonitorFrameBase::OnIconize ) );
|
||||
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxEventMonitorFrameBase::OnIdle ) );
|
||||
}
|
||||
|
||||
wxEventMonitorFrameBase::~wxEventMonitorFrameBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxEventMonitorFrameBase::OnClose ) );
|
||||
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxEventMonitorFrameBase::OnIconize ) );
|
||||
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxEventMonitorFrameBase::OnIdle ) );
|
||||
|
||||
m_mgr.UnInit();
|
||||
|
||||
}
|
||||
|
||||
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_SINGLE_SEL|wxNO_BORDER );
|
||||
m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER );
|
||||
bSizerMain->Add( m_log, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@@ -26,261 +26,6 @@
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">1</property>
|
||||
<object class="Frame" expanded="1">
|
||||
<property name="aui_managed">1</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size">150,150</property>
|
||||
<property name="name">wxEventMonitorFrameBase</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">600,400</property>
|
||||
<property name="style">wxDEFAULT_FRAME_STYLE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="title">Event Monitor</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name">EventMonitor</property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<property name="xrc_skip_sizer">1</property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<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="OnClose">OnClose</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize">OnIconize</event>
|
||||
<event name="OnIdle">OnIdle</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="wxMenuBar" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Menu</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_menubar</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxMenu" expanded="1">
|
||||
<property name="label">&Program</property>
|
||||
<property name="name">m_menuProgram</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Quit this program</property>
|
||||
<property name="id">wxID_EXIT</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">E&xit</property>
|
||||
<property name="name">m_menuItemExit</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut">Alt+F4</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="CustomControl" expanded="0">
|
||||
<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">LogPanel</property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption">Log Trace</property>
|
||||
<property name="caption_visible">0</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="class">wxEventMonitorLogPanel</property>
|
||||
<property name="close_button">0</property>
|
||||
<property name="construction">m_panel = new wxEventMonitorLogPanel( this );
</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="declaration">wxEventMonitorLogPanel* m_panel;</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Center</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">0</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include">class wxEventMonitorLogPanel;</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_panel</property>
|
||||
<property name="pane_border">0</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</property>
|
||||
<property name="pin_button">0</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="settings"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
<object class="wxStatusBar" expanded="0">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="fields">1</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">m_statusBar</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxST_SIZEGRIP</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="Panel" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@@ -381,13 +126,13 @@
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</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_SINGLE_SEL</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>
|
||||
|
@@ -13,53 +13,17 @@
|
||||
#include <wx/intl.h>
|
||||
class wxETWListCtrl;
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
class wxEventMonitorLogPanel;
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/frame.h>
|
||||
#include <wx/aui/aui.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEventMonitorFrameBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEventMonitorFrameBase : public wxFrame
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxMenuBar* m_menubar;
|
||||
wxMenu* m_menuProgram;
|
||||
wxStatusBar* m_statusBar;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
||||
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
wxEventMonitorLogPanel* m_panel;
|
||||
|
||||
wxEventMonitorFrameBase( 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") );
|
||||
wxAuiManager m_mgr;
|
||||
|
||||
~wxEventMonitorFrameBase();
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEventMonitorLogPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -68,9 +32,9 @@ class wxEventMonitorLogPanelBase : public wxPanel
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxETWListCtrl* m_log;
|
||||
|
||||
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();
|
||||
|
Binary file not shown.
2
desktop.ini
Normal file
2
desktop.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=include\icon_full.ico,0
|
@@ -32,7 +32,7 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;ISOLATION_AWARE_ENABLED=1;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;%(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>
|
||||
|
@@ -29,7 +29,7 @@
|
||||
// Product version as a single DWORD
|
||||
// Note: Used for version comparison within C/C++ code.
|
||||
//
|
||||
#define PRODUCT_VERSION 0x00ff0a00
|
||||
#define PRODUCT_VERSION 0x00ff0d00
|
||||
|
||||
//
|
||||
// Product version by components
|
||||
@@ -39,26 +39,26 @@
|
||||
//
|
||||
#define PRODUCT_VERSION_MAJ 0
|
||||
#define PRODUCT_VERSION_MIN 255
|
||||
#define PRODUCT_VERSION_REV 10
|
||||
#define PRODUCT_VERSION_REV 13
|
||||
#define PRODUCT_VERSION_BUILD 0
|
||||
|
||||
//
|
||||
// Human readable product version and build year for UI
|
||||
//
|
||||
#define PRODUCT_VERSION_STR "1.0-alpha10-owntls"
|
||||
#define PRODUCT_VERSION_STR "1.0-alpha13"
|
||||
#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.10"
|
||||
#define PRODUCT_VERSION_INST "0.255.13"
|
||||
|
||||
//
|
||||
// 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 "{C3675615-0D70-47C7-9BCB-B683A77C6ED6}"
|
||||
#define PRODUCT_VERSION_GUID "{13ADDFF3-B249-4AB5-9FAD-E4CDCED62B11}"
|
||||
|
||||
//
|
||||
// Since the product name is not finally confirmed at the time of
|
||||
|
1598
include/icon.pdf
Normal file
1598
include/icon.pdf
Normal file
File diff suppressed because one or more lines are too long
BIN
include/icon_full.ico
Normal file
BIN
include/icon_full.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 113 KiB |
BIN
include/icon_ui.ico
Normal file
BIN
include/icon_ui.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
@@ -40,14 +40,14 @@ namespace eap
|
||||
class config_method_with_cred;
|
||||
|
||||
///
|
||||
/// Base class for single provider configuration storage
|
||||
/// Provider configuration storage
|
||||
///
|
||||
class config_provider;
|
||||
|
||||
///
|
||||
/// Base class for the list of providers configuration storage
|
||||
/// Connection configuration storage
|
||||
///
|
||||
class config_provider_list;
|
||||
class config_connection;
|
||||
}
|
||||
|
||||
///
|
||||
@@ -454,7 +454,7 @@ namespace eap
|
||||
};
|
||||
|
||||
|
||||
class config_provider_list : public config
|
||||
class config_connection : public config
|
||||
{
|
||||
public:
|
||||
///
|
||||
@@ -462,21 +462,21 @@ namespace eap
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
///
|
||||
config_provider_list(_In_ module &mod);
|
||||
config_connection(_In_ module &mod);
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
///
|
||||
/// \param[in] other Configuration to copy from
|
||||
///
|
||||
config_provider_list(_In_ const config_provider_list &other);
|
||||
config_connection(_In_ const config_connection &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
///
|
||||
/// \param[in] other Configuration to move from
|
||||
///
|
||||
config_provider_list(_Inout_ config_provider_list &&other);
|
||||
config_connection(_Inout_ config_connection &&other);
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
@@ -485,7 +485,7 @@ namespace eap
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_provider_list& operator=(_In_ const config_provider_list &other);
|
||||
config_connection& operator=(_In_ const config_connection &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
@@ -494,7 +494,7 @@ namespace eap
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_provider_list& operator=(_Inout_ config_provider_list &&other);
|
||||
config_connection& operator=(_Inout_ config_connection &&other);
|
||||
|
||||
///
|
||||
/// Clones configuration
|
||||
|
@@ -60,7 +60,7 @@ namespace eap
|
||||
///
|
||||
enum source_t {
|
||||
source_unknown = -1, ///< Unknown source
|
||||
source_cache = 0, ///< Credentials were obtained from EAPHost cache
|
||||
source_cache = 0, ///< Credentials were obtained from EapHost cache
|
||||
source_preshared, ///< Credentials were set by method configuration
|
||||
source_storage ///< Credentials were loaded from Windows Credential Manager
|
||||
};
|
||||
@@ -120,6 +120,52 @@ namespace eap
|
||||
///
|
||||
virtual bool empty() const;
|
||||
|
||||
/// \name XML configuration management
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Save to XML document
|
||||
///
|
||||
/// \param[in] pDoc XML document
|
||||
/// \param[in] pConfigRoot Suggested root element for saving
|
||||
///
|
||||
virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const;
|
||||
|
||||
///
|
||||
/// Load from XML document
|
||||
///
|
||||
/// \param[in] pConfigRoot Root element for loading
|
||||
///
|
||||
virtual void load(_In_ IXMLDOMNode *pConfigRoot);
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name BLOB management
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Packs a configuration
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
///
|
||||
virtual void operator<<(_Inout_ cursor_out &cursor) const;
|
||||
|
||||
///
|
||||
/// Returns packed size of a configuration
|
||||
///
|
||||
/// \returns Size of data when packed (in bytes)
|
||||
///
|
||||
virtual size_t get_pk_size() const;
|
||||
|
||||
///
|
||||
/// Unpacks a configuration
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
///
|
||||
virtual void operator>>(_Inout_ cursor_in &cursor);
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Storage
|
||||
/// @{
|
||||
|
||||
@@ -164,12 +210,15 @@ namespace eap
|
||||
///
|
||||
/// Returns credential identity.
|
||||
///
|
||||
virtual std::wstring get_identity() const = 0;
|
||||
virtual std::wstring get_identity() const;
|
||||
|
||||
///
|
||||
/// Returns credential name (for GUI display).
|
||||
///
|
||||
virtual winstd::tstring get_name() const;
|
||||
|
||||
public:
|
||||
std::wstring m_identity; ///< Identity (username\@domain, certificate name etc.)
|
||||
};
|
||||
|
||||
|
||||
@@ -294,13 +343,7 @@ namespace eap
|
||||
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// Returns credential identity.
|
||||
///
|
||||
virtual std::wstring get_identity() const;
|
||||
|
||||
public:
|
||||
std::wstring m_identity; ///< Identity (username\@domain, certificate name etc.)
|
||||
winstd::sanitizing_wstring m_password; ///< Password
|
||||
|
||||
private:
|
||||
|
@@ -391,6 +391,31 @@ template<size_t N> inline size_t pksizeof(_In_ const eap::sanitizing_blob_f<N> &
|
||||
///
|
||||
template<size_t N> inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::sanitizing_blob_f<N> &val);
|
||||
|
||||
///
|
||||
/// Packs a GUID
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[in] val Variable with data to pack
|
||||
///
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const GUID &val);
|
||||
|
||||
///
|
||||
/// Returns packed size of a GUID
|
||||
///
|
||||
/// \param[in] val Data to pack
|
||||
///
|
||||
/// \returns Size of data when packed (in bytes)
|
||||
///
|
||||
inline size_t pksizeof(_In_ const GUID &val);
|
||||
|
||||
///
|
||||
/// Unpacks a GUID
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[out] val Variable to receive unpacked value
|
||||
///
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ GUID &val);
|
||||
|
||||
#ifndef htonll
|
||||
///
|
||||
/// Convert host converts an unsigned __int64 from host to TCP/IP network byte order.
|
||||
@@ -975,6 +1000,31 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::sanitizing_blo
|
||||
}
|
||||
|
||||
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const GUID &val)
|
||||
{
|
||||
eap::cursor_out::ptr_type ptr_end = cursor.ptr + sizeof(GUID);
|
||||
assert(ptr_end <= cursor.ptr_end);
|
||||
memcpy(cursor.ptr, &val, sizeof(GUID));
|
||||
cursor.ptr = ptr_end;
|
||||
}
|
||||
|
||||
|
||||
inline size_t pksizeof(_In_ const GUID &val)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(val);
|
||||
return sizeof(GUID);
|
||||
}
|
||||
|
||||
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ GUID &val)
|
||||
{
|
||||
eap::cursor_in::ptr_type ptr_end = cursor.ptr + sizeof(GUID);
|
||||
assert(ptr_end <= cursor.ptr_end);
|
||||
memcpy(&val, cursor.ptr, sizeof(GUID));
|
||||
cursor.ptr = ptr_end;
|
||||
}
|
||||
|
||||
|
||||
#ifndef htonll
|
||||
|
||||
inline unsigned __int64 htonll(unsigned __int64 val)
|
||||
|
@@ -51,10 +51,10 @@ namespace eap
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Providers configuration
|
||||
/// \param[in] cfg Connection configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials &cred);
|
||||
method(_In_ module &module, _In_ config_connection &cfg, _In_ credentials &cred);
|
||||
|
||||
|
||||
///
|
||||
@@ -77,7 +77,7 @@ namespace eap
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
||||
/// Starts an EAP authentication session on the peer EapHost using the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
||||
///
|
||||
@@ -95,7 +95,7 @@ namespace eap
|
||||
virtual void end_session();
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
@@ -131,7 +131,7 @@ namespace eap
|
||||
|
||||
public:
|
||||
module &m_module; ///< EAP module
|
||||
config_provider_list &m_cfg; ///< Providers configuration
|
||||
config_connection &m_cfg; ///< Connection configuration
|
||||
credentials &m_cred; ///< User credentials
|
||||
};
|
||||
}
|
||||
|
@@ -565,7 +565,7 @@ namespace eap
|
||||
peer(_In_ winstd::eap_type_t eap_method);
|
||||
|
||||
///
|
||||
/// Initializes an EAP peer method for EAPHost.
|
||||
/// Initializes an EAP peer method for EapHost.
|
||||
///
|
||||
/// \sa [EapPeerGetInfo function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363613.aspx)
|
||||
///
|
||||
@@ -579,7 +579,7 @@ namespace eap
|
||||
virtual void shutdown() = 0;
|
||||
|
||||
///
|
||||
/// Returns the user data and user identity after being called by EAPHost.
|
||||
/// 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)
|
||||
///
|
||||
@@ -662,7 +662,7 @@ namespace eap
|
||||
_Inout_ EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData) const;
|
||||
|
||||
///
|
||||
/// Converts user information into a user BLOB that can be consumed by EAPHost run-time functions.
|
||||
/// Converts user information into a user BLOB that can be consumed by EapHost run-time functions.
|
||||
///
|
||||
/// \sa [EapPeerQueryUIBlobFromInteractiveUIInputFields function](https://msdn.microsoft.com/en-us/library/windows/desktop/bb204696.aspx)
|
||||
///
|
||||
@@ -679,7 +679,7 @@ namespace eap
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
||||
/// Starts an EAP authentication session on the peer EapHost using the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
||||
///
|
||||
@@ -703,7 +703,7 @@ namespace eap
|
||||
virtual void end_session(_In_ EAP_SESSION_HANDLE hSession) = 0;
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
|
@@ -609,29 +609,29 @@ void eap::config_provider::operator>>(_Inout_ cursor_in &cursor)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::config_provider_list
|
||||
// eap::config_connection
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::config_provider_list::config_provider_list(_In_ module &mod) : config(mod)
|
||||
eap::config_connection::config_connection(_In_ module &mod) : config(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_provider_list::config_provider_list(_In_ const config_provider_list &other) :
|
||||
eap::config_connection::config_connection(_In_ const config_connection &other) :
|
||||
m_providers(other.m_providers),
|
||||
config(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_provider_list::config_provider_list(_Inout_ config_provider_list &&other) :
|
||||
eap::config_connection::config_connection(_Inout_ config_connection &&other) :
|
||||
m_providers(std::move(other.m_providers)),
|
||||
config(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_provider_list& eap::config_provider_list::operator=(_In_ const config_provider_list &other)
|
||||
eap::config_connection& eap::config_connection::operator=(_In_ const config_connection &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&)*this = other;
|
||||
@@ -642,7 +642,7 @@ eap::config_provider_list& eap::config_provider_list::operator=(_In_ const confi
|
||||
}
|
||||
|
||||
|
||||
eap::config_provider_list& eap::config_provider_list::operator=(_Inout_ config_provider_list &&other)
|
||||
eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&&)*this = std::move(other);
|
||||
@@ -653,13 +653,13 @@ eap::config_provider_list& eap::config_provider_list::operator=(_Inout_ config_p
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::config_provider_list::clone() const
|
||||
eap::config* eap::config_connection::clone() const
|
||||
{
|
||||
return new config_provider_list(*this);
|
||||
return new config_connection(*this);
|
||||
}
|
||||
|
||||
|
||||
void eap::config_provider_list::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
|
||||
void eap::config_connection::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
|
||||
{
|
||||
config::save(pDoc, pConfigRoot);
|
||||
|
||||
@@ -686,7 +686,7 @@ void eap::config_provider_list::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNod
|
||||
}
|
||||
|
||||
|
||||
void eap::config_provider_list::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
void eap::config_connection::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
{
|
||||
assert(pConfigRoot);
|
||||
HRESULT hr;
|
||||
@@ -714,14 +714,14 @@ void eap::config_provider_list::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
}
|
||||
|
||||
|
||||
void eap::config_provider_list::operator<<(_Inout_ cursor_out &cursor) const
|
||||
void eap::config_connection::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
config::operator<<(cursor);
|
||||
cursor << m_providers;
|
||||
}
|
||||
|
||||
|
||||
size_t eap::config_provider_list::get_pk_size() const
|
||||
size_t eap::config_connection::get_pk_size() const
|
||||
{
|
||||
return
|
||||
config::get_pk_size() +
|
||||
@@ -729,7 +729,7 @@ size_t eap::config_provider_list::get_pk_size() const
|
||||
}
|
||||
|
||||
|
||||
void eap::config_provider_list::operator>>(_Inout_ cursor_in &cursor)
|
||||
void eap::config_connection::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
config::operator>>(cursor);
|
||||
|
||||
|
@@ -36,12 +36,14 @@ 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))
|
||||
{
|
||||
}
|
||||
@@ -49,8 +51,10 @@ eap::credentials::credentials(_Inout_ credentials &&other) :
|
||||
|
||||
eap::credentials& eap::credentials::operator=(_In_ const credentials &other)
|
||||
{
|
||||
if (this != &other)
|
||||
if (this != &other) {
|
||||
(config&)*this = other;
|
||||
m_identity = other.m_identity;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -58,8 +62,10 @@ eap::credentials& eap::credentials::operator=(_In_ const credentials &other)
|
||||
|
||||
eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
if (this != &other) {
|
||||
(config&)*this = std::move(other);
|
||||
m_identity = std::move(other.m_identity);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -67,13 +73,73 @@ eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other)
|
||||
|
||||
void eap::credentials::clear()
|
||||
{
|
||||
m_identity.clear();
|
||||
}
|
||||
|
||||
|
||||
bool eap::credentials::empty() const
|
||||
{
|
||||
// Base class always report empty credentials.
|
||||
return true;
|
||||
return m_identity.empty();
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
|
||||
{
|
||||
assert(pDoc);
|
||||
assert(pConfigRoot);
|
||||
|
||||
config::save(pDoc, pConfigRoot);
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// <UserName>
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), bstrNamespace, bstr(m_identity))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <UserName> element.");
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
{
|
||||
assert(pConfigRoot);
|
||||
HRESULT hr;
|
||||
|
||||
config::load(pConfigRoot);
|
||||
|
||||
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
|
||||
|
||||
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error reading <UserName> element.");
|
||||
|
||||
m_module.log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
config::operator<<(cursor);
|
||||
cursor << m_identity;
|
||||
}
|
||||
|
||||
|
||||
size_t eap::credentials::get_pk_size() const
|
||||
{
|
||||
return
|
||||
config::get_pk_size() +
|
||||
pksizeof(m_identity);
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
config::operator>>(cursor);
|
||||
cursor >> m_identity;
|
||||
}
|
||||
|
||||
|
||||
wstring eap::credentials::get_identity() const
|
||||
{
|
||||
return m_identity;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +159,6 @@ eap::credentials_pass::credentials_pass(_In_ module &mod) : credentials(mod)
|
||||
|
||||
|
||||
eap::credentials_pass::credentials_pass(_In_ const credentials_pass &other) :
|
||||
m_identity(other.m_identity),
|
||||
m_password(other.m_password),
|
||||
credentials(other)
|
||||
{
|
||||
@@ -101,7 +166,6 @@ eap::credentials_pass::credentials_pass(_In_ const credentials_pass &other) :
|
||||
|
||||
|
||||
eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) :
|
||||
m_identity(std::move(other.m_identity)),
|
||||
m_password(std::move(other.m_password)),
|
||||
credentials(std::move(other))
|
||||
{
|
||||
@@ -112,7 +176,6 @@ eap::credentials_pass& eap::credentials_pass::operator=(_In_ const credentials_p
|
||||
{
|
||||
if (this != &other) {
|
||||
(credentials&)*this = other;
|
||||
m_identity = other.m_identity;
|
||||
m_password = other.m_password;
|
||||
}
|
||||
|
||||
@@ -124,7 +187,6 @@ eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass
|
||||
{
|
||||
if (this != &other) {
|
||||
(credentials&)*this = std::move(other);
|
||||
m_identity = std::move(other.m_identity);
|
||||
m_password = std::move(other.m_password);
|
||||
}
|
||||
|
||||
@@ -135,14 +197,13 @@ eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass
|
||||
void eap::credentials_pass::clear()
|
||||
{
|
||||
credentials::clear();
|
||||
m_identity.clear();
|
||||
m_password.clear();
|
||||
}
|
||||
|
||||
|
||||
bool eap::credentials_pass::empty() const
|
||||
{
|
||||
return credentials::empty() && m_identity.empty() && m_password.empty();
|
||||
return credentials::empty() && m_password.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -156,10 +217,6 @@ void eap::credentials_pass::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// <UserName>
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), bstrNamespace, bstr(m_identity))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <UserName> element.");
|
||||
|
||||
// <Password>
|
||||
bstr pass(m_password);
|
||||
hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"Password"), bstrNamespace, pass);
|
||||
@@ -178,11 +235,6 @@ void eap::credentials_pass::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
|
||||
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
|
||||
|
||||
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error reading <UserName> element.");
|
||||
|
||||
m_module.log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
|
||||
|
||||
bstr pass;
|
||||
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:Password"), &pass)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error reading <Password> element.");
|
||||
@@ -202,7 +254,6 @@ void eap::credentials_pass::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
void eap::credentials_pass::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
credentials::operator<<(cursor);
|
||||
cursor << m_identity;
|
||||
cursor << m_password;
|
||||
}
|
||||
|
||||
@@ -211,7 +262,6 @@ size_t eap::credentials_pass::get_pk_size() const
|
||||
{
|
||||
return
|
||||
credentials::get_pk_size() +
|
||||
pksizeof(m_identity) +
|
||||
pksizeof(m_password);
|
||||
}
|
||||
|
||||
@@ -219,7 +269,6 @@ size_t eap::credentials_pass::get_pk_size() const
|
||||
void eap::credentials_pass::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
credentials::operator>>(cursor);
|
||||
cursor >> m_identity;
|
||||
cursor >> m_password;
|
||||
}
|
||||
|
||||
@@ -289,7 +338,7 @@ void eap::credentials_pass::retrieve(_In_z_ LPCTSTR pszTargetName)
|
||||
m_identity.clear();
|
||||
|
||||
wstring xpath(pszTargetName);
|
||||
m_module.log_config((xpath + L"/Username").c_str(), m_identity.c_str());
|
||||
m_module.log_config((xpath + L"/Identity").c_str(), m_identity.c_str());
|
||||
m_module.log_config((xpath + L"/Password").c_str(),
|
||||
#ifdef _DEBUG
|
||||
m_password.c_str()
|
||||
@@ -300,12 +349,6 @@ void eap::credentials_pass::retrieve(_In_z_ LPCTSTR pszTargetName)
|
||||
}
|
||||
|
||||
|
||||
std::wstring eap::credentials_pass::get_identity() const
|
||||
{
|
||||
return m_identity;
|
||||
}
|
||||
|
||||
|
||||
const unsigned char eap::credentials_pass::s_entropy[1024] = {
|
||||
0x40, 0x88, 0xd3, 0x13, 0x81, 0x8a, 0xf6, 0x74, 0x55, 0x8e, 0xcc, 0x73, 0x2c, 0xf8, 0x93, 0x37,
|
||||
0x4f, 0xeb, 0x1d, 0x66, 0xb7, 0xfb, 0x47, 0x75, 0xb4, 0xfd, 0x07, 0xbb, 0xf6, 0xb3, 0x05, 0x30,
|
||||
|
@@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::method
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method::method(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials &cred) :
|
||||
eap::method::method(_In_ module &module, _In_ config_connection &cfg, _In_ credentials &cred) :
|
||||
m_module(module),
|
||||
m_cfg(cfg),
|
||||
m_cred(cred)
|
||||
|
@@ -91,20 +91,26 @@ EAP_ERROR* eap::module::make_error(_In_ std::exception &err) const
|
||||
MultiByteToWideChar(CP_ACP, 0, err.what(), -1, what);
|
||||
|
||||
{
|
||||
win_runtime_error &e(dynamic_cast<win_runtime_error&>(err));
|
||||
if (&e)
|
||||
return make_error(e.number(), what.c_str());
|
||||
win_runtime_error *e = dynamic_cast<win_runtime_error*>(&err);
|
||||
if (e)
|
||||
return make_error(e->number(), what.c_str());
|
||||
}
|
||||
|
||||
{
|
||||
com_runtime_error &e(dynamic_cast<com_runtime_error&>(err));
|
||||
if (&e)
|
||||
return make_error(HRESULT_CODE(e.number()), what.c_str());
|
||||
com_runtime_error *e = dynamic_cast<com_runtime_error*>(&err);
|
||||
if (e)
|
||||
return make_error(HRESULT_CODE(e->number()), what.c_str());
|
||||
}
|
||||
|
||||
{
|
||||
invalid_argument &e(dynamic_cast<invalid_argument&>(err));
|
||||
if (&e)
|
||||
sec_runtime_error *e = dynamic_cast<sec_runtime_error*>(&err);
|
||||
if (e)
|
||||
return make_error(SCODE_CODE(e->number()), what.c_str());
|
||||
}
|
||||
|
||||
{
|
||||
invalid_argument *e = dynamic_cast<invalid_argument*>(&err);
|
||||
if (e)
|
||||
return make_error(ERROR_INVALID_PARAMETER, what.c_str());
|
||||
}
|
||||
|
||||
|
@@ -30,5 +30,6 @@
|
||||
|
||||
#include <WinStd/Cred.h>
|
||||
#include <WinStd/ETW.h>
|
||||
#include <WinStd/Sec.h>
|
||||
|
||||
#include <EventsETW.h>
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
@@ -91,15 +90,28 @@ template <class _Tcred, class _Tbase> class wxEAPCredentialsPanelBase;
|
||||
template <class _Tcred, class _Tbase> class wxPasswordCredentialsPanel;
|
||||
|
||||
///
|
||||
/// Sets icon from resource
|
||||
/// Loads icon from resource
|
||||
///
|
||||
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName);
|
||||
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx = GetSystemMetrics(SM_CXICON), int cy = GetSystemMetrics(SM_CYICON));
|
||||
|
||||
///
|
||||
/// Loads icon from resource
|
||||
///
|
||||
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, const wxSize &size);
|
||||
|
||||
///
|
||||
/// Returns GUI displayable provider name
|
||||
///
|
||||
inline wxString wxEAPGetProviderName(const std::wstring &id);
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// Base class to prevent multiple instances of the same dialog
|
||||
///
|
||||
class monitor_ui;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/msw/winundef.h> // Fixes `CreateDialog` name collision
|
||||
@@ -142,16 +154,26 @@ public:
|
||||
///
|
||||
/// Constructs a configuration dialog
|
||||
///
|
||||
/// \param[inout] cfg Providers configuration data
|
||||
/// \param[inout] cfg Connection configuration
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPConfigDialog(eap::config_provider_list &cfg, wxWindow* parent) :
|
||||
wxEAPConfigDialog(eap::config_connection &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);
|
||||
|
||||
// Load window icons.
|
||||
#ifdef __WINDOWS__
|
||||
wxIconBundle icons;
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
|
||||
this->SetIcons(icons);
|
||||
#else
|
||||
this->SetIcon(wxIcon(wxICON(product.ico)));
|
||||
#endif
|
||||
|
||||
for (std::vector<eap::config_provider>::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::vector<std::unique_ptr<eap::config_method> >::size_type count = 0;
|
||||
@@ -207,7 +229,7 @@ protected:
|
||||
|
||||
|
||||
protected:
|
||||
eap::config_provider_list &m_cfg; ///< EAP providers configuration
|
||||
eap::config_connection &m_cfg; ///< Connection configuration
|
||||
};
|
||||
|
||||
|
||||
@@ -217,7 +239,7 @@ public:
|
||||
///
|
||||
/// Constructs a dialog
|
||||
///
|
||||
wxEAPGeneralDialog(wxWindow* parent, const wxString& title = wxEmptyString);
|
||||
wxEAPGeneralDialog(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
///
|
||||
/// Adds panels to the dialog
|
||||
@@ -242,7 +264,7 @@ public:
|
||||
///
|
||||
/// Constructs a credential dialog
|
||||
///
|
||||
wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow* parent);
|
||||
wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("EAP Credentials"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
|
||||
};
|
||||
|
||||
|
||||
@@ -302,10 +324,6 @@ public:
|
||||
/// Constructs a notice pannel and set the title text
|
||||
///
|
||||
wxEAPProviderLockedPanel(const eap::config_provider &prov, wxWindow* parent);
|
||||
|
||||
protected:
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
@@ -316,10 +334,6 @@ public:
|
||||
/// Constructs a notice pannel and set the title text
|
||||
///
|
||||
wxEAPCredentialWarningPanel(const eap::config_provider &prov, wxWindow* parent);
|
||||
|
||||
protected:
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
@@ -373,8 +387,6 @@ protected:
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< EAP method configuration
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
@@ -397,8 +409,6 @@ protected:
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< EAP method configuration
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
@@ -411,7 +421,7 @@ public:
|
||||
/// \param[inout] prov Provider configuration data
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPConfigProvider(eap::config_provider &prov, wxWindow* parent);
|
||||
wxEAPConfigProvider(eap::config_provider &prov, wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("Provider Settings"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< EAP method configuration
|
||||
@@ -440,8 +450,9 @@ public:
|
||||
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(/*16770*/269));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(/*16770*/269)));
|
||||
}
|
||||
|
||||
///
|
||||
@@ -605,8 +616,6 @@ protected:
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_method_with_cred &m_cfg; ///< EAP method configuration
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
winstd::tstring m_target; ///< Credential Manager target
|
||||
|
||||
private:
|
||||
@@ -711,8 +720,9 @@ public:
|
||||
wxEAPCredentialsPanelBase<_Tcred, _Tbase>(prov, cfg, 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));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(269)));
|
||||
|
||||
bool layout = false;
|
||||
if (!m_prov.m_lbl_alt_credential.empty()) {
|
||||
@@ -777,10 +787,6 @@ protected:
|
||||
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
|
||||
private:
|
||||
static const wxStringCharType *s_dummy_password;
|
||||
};
|
||||
@@ -789,17 +795,27 @@ template <class _Tcred, class _Tbase>
|
||||
const wxStringCharType *wxPasswordCredentialsPanel<_Tcred, _Tbase>::s_dummy_password = wxT("dummypass");
|
||||
|
||||
|
||||
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName)
|
||||
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, int cx, int cy)
|
||||
{
|
||||
wxASSERT(bmp);
|
||||
|
||||
HICON hIcon;
|
||||
if (SUCCEEDED(LoadIconWithScaleDown(hinst, pszName, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), &hIcon))) {
|
||||
if (SUCCEEDED(LoadIconWithScaleDown(hinst, pszName, cx, cy, &hIcon))) {
|
||||
wxIcon icon;
|
||||
icon.CreateFromHICON(hIcon);
|
||||
bmp->SetIcon(icon);
|
||||
return true;
|
||||
return icon;
|
||||
} else
|
||||
return false;
|
||||
return wxNullIcon;
|
||||
}
|
||||
|
||||
|
||||
inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, const wxSize &size)
|
||||
{
|
||||
HICON hIcon;
|
||||
if (SUCCEEDED(LoadIconWithScaleDown(hinst, pszName, size.GetWidth(), size.GetHeight(), &hIcon))) {
|
||||
wxIcon icon;
|
||||
icon.CreateFromHICON(hIcon);
|
||||
return icon;
|
||||
} else
|
||||
return wxNullIcon;
|
||||
}
|
||||
|
||||
|
||||
@@ -808,3 +824,55 @@ inline wxString wxEAPGetProviderName(const std::wstring &id)
|
||||
return
|
||||
!id.empty() ? id : _("<Your Organization>");
|
||||
}
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class monitor_ui
|
||||
{
|
||||
public:
|
||||
monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid);
|
||||
virtual ~monitor_ui();
|
||||
|
||||
void set_popup(_In_ HWND hwnd);
|
||||
void release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const;
|
||||
|
||||
inline bool is_master() const
|
||||
{
|
||||
return m_is_master;
|
||||
}
|
||||
|
||||
inline bool is_slave() const
|
||||
{
|
||||
return !is_master();
|
||||
}
|
||||
|
||||
inline const std::vector<unsigned char>& master_data() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual LRESULT winproc(
|
||||
_In_ UINT msg,
|
||||
_In_ WPARAM wparam,
|
||||
_In_ LPARAM lparam);
|
||||
|
||||
static LRESULT CALLBACK winproc(
|
||||
_In_ HWND hwnd,
|
||||
_In_ UINT msg,
|
||||
_In_ WPARAM wparam,
|
||||
_In_ LPARAM lparam);
|
||||
|
||||
protected:
|
||||
bool m_is_master; ///< Is this monitor master?
|
||||
HWND m_hwnd; ///< Message window handle
|
||||
std::list<HWND> m_slaves; ///< List of slaves to notify on finish
|
||||
HWND m_hwnd_popup; ///< Pop-up window handle
|
||||
std::vector<unsigned char> m_data; ///< Data master sent
|
||||
|
||||
// Custom window messages
|
||||
static const UINT s_msg_attach; ///< Slave sends this message to attach to master
|
||||
static const UINT s_msg_finish; ///< Master sends this message to slaves to notify them it has finished (wparam has size, lparam has data)
|
||||
};
|
||||
}
|
||||
|
@@ -412,7 +412,7 @@ wxEAPProviderIdentityPanelBase::wxEAPProviderIdentityPanelBase( wxWindow* parent
|
||||
sb_provider_helpdesk_inner->Add( m_provider_web_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_provider_web = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_web->SetToolTip( _("Your helpdesk website") );
|
||||
m_provider_web->SetToolTip( _("Your helpdesk website address") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_web, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
|
||||
|
||||
|
@@ -3370,7 +3370,7 @@
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Your helpdesk website</property>
|
||||
<property name="tooltip">Your helpdesk website address</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
|
@@ -41,11 +41,22 @@ bool wxEAPBannerPanel::AcceptsFocusFromKeyboard() const
|
||||
// wxEAPGeneralDialog
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPGeneralDialog::wxEAPGeneralDialog(wxWindow* parent, const wxString& title) : wxEAPGeneralDialogBase(parent, wxID_ANY, title)
|
||||
wxEAPGeneralDialog::wxEAPGeneralDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style) :
|
||||
wxEAPGeneralDialogBase(parent, id, title, pos, size, style)
|
||||
{
|
||||
// Set extra style here, as wxFormBuilder overrides all default flags.
|
||||
this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
|
||||
|
||||
// Load window icons.
|
||||
#ifdef __WINDOWS__
|
||||
wxIconBundle icons;
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
|
||||
this->SetIcons(icons);
|
||||
#else
|
||||
this->SetIcon(wxIcon(wxICON(product.ico)));
|
||||
#endif
|
||||
|
||||
m_buttonsOK->SetDefault();
|
||||
}
|
||||
|
||||
@@ -80,7 +91,8 @@ void wxEAPGeneralDialog::OnInitDialog(wxInitDialogEvent& event)
|
||||
// wxEAPCredentialsDialog
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow* parent) : wxEAPGeneralDialog(parent, _("EAP Credentials"))
|
||||
wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style) :
|
||||
wxEAPGeneralDialog(parent, id, title, pos, size, style)
|
||||
{
|
||||
// Set banner title.
|
||||
m_banner->m_title->SetLabel(wxString::Format(_("%s Credentials"), wxEAPGetProviderName(prov.m_id).c_str()));
|
||||
@@ -172,8 +184,9 @@ void wxEAPNotePanel::CreateContactFields(const eap::config_provider &prov)
|
||||
wxEAPProviderLockedPanel::wxEAPProviderLockedPanel(const eap::config_provider &prov, wxWindow* parent) : wxEAPNotePanel(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
wxSetIconFromResource(m_note_icon, m_icon, m_shell32, MAKEINTRESOURCE(48));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_note_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(48)));
|
||||
|
||||
m_note_label->SetLabel(wxString::Format(_("%s has pre-set parts of this configuration. Those parts are locked to prevent accidental modification."),
|
||||
!prov.m_name.empty() ? prov.m_name.c_str() :
|
||||
@@ -193,8 +206,9 @@ wxEAPProviderLockedPanel::wxEAPProviderLockedPanel(const eap::config_provider &p
|
||||
wxEAPCredentialWarningPanel::wxEAPCredentialWarningPanel(const eap::config_provider &prov, wxWindow* parent) : wxEAPNotePanel(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
wxSetIconFromResource(m_note_icon, m_icon, m_shell32, MAKEINTRESOURCE(161));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_note_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(161)));
|
||||
|
||||
m_note_label->SetLabel(_("Previous attempt to connect failed. Please, make sure your credentials are correct, or try again later."));
|
||||
m_note_label->Wrap(449);
|
||||
@@ -263,8 +277,9 @@ wxEAPProviderIdentityPanel::wxEAPProviderIdentityPanel(eap::config_provider &pro
|
||||
wxEAPProviderIdentityPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
wxSetIconFromResource(m_provider_id_icon, m_icon, m_shell32, MAKEINTRESOURCE(259));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_provider_id_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(259)));
|
||||
}
|
||||
|
||||
|
||||
@@ -301,8 +316,9 @@ wxEAPProviderLockPanel::wxEAPProviderLockPanel(eap::config_provider &prov, wxWin
|
||||
wxEAPProviderLockPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
wxSetIconFromResource(m_provider_lock_icon, m_icon, m_shell32, MAKEINTRESOURCE(1003));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_provider_lock_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(1003)));
|
||||
}
|
||||
|
||||
|
||||
@@ -328,12 +344,12 @@ bool wxEAPProviderLockPanel::TransferDataFromWindow()
|
||||
// wxEAPConfigProvider
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPConfigProvider::wxEAPConfigProvider(eap::config_provider &prov, wxWindow* parent) :
|
||||
wxEAPConfigProvider::wxEAPConfigProvider(eap::config_provider &prov, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style) :
|
||||
m_prov(prov),
|
||||
wxEAPGeneralDialog(parent, _("Provider Settings"))
|
||||
wxEAPGeneralDialog(parent, id, title, pos, size, style)
|
||||
{
|
||||
// Set banner title.
|
||||
m_banner->m_title->SetLabel(_("Provider Settings"));
|
||||
m_banner->m_title->SetLabel(title);
|
||||
|
||||
m_identity = new wxEAPProviderIdentityPanel(prov, this);
|
||||
AddContent(m_identity);
|
||||
@@ -343,3 +359,196 @@ wxEAPConfigProvider::wxEAPConfigProvider(eap::config_provider &prov, wxWindow* p
|
||||
|
||||
m_identity->m_provider_name->SetFocusFromKbd();
|
||||
}
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::monitor_ui
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::monitor_ui::monitor_ui(_In_ HINSTANCE module, _In_ const GUID &guid) :
|
||||
m_hwnd_popup(NULL)
|
||||
{
|
||||
// Verify if the monitor is already running.
|
||||
const WNDCLASSEX wnd_class_desc = {
|
||||
sizeof(WNDCLASSEX), // cbSize
|
||||
0, // style
|
||||
winproc, // lpfnWndProc
|
||||
0, // cbClsExtra
|
||||
0, // cbWndExtra
|
||||
module, // hInstance
|
||||
NULL, // hIcon
|
||||
NULL, // hCursor
|
||||
NULL, // hbrBackground
|
||||
NULL, // lpszMenuName
|
||||
_T(__FUNCTION__), // lpszClassName
|
||||
NULL // hIconSm
|
||||
};
|
||||
ATOM wnd_class = RegisterClassEx(&wnd_class_desc);
|
||||
if (!wnd_class)
|
||||
throw win_runtime_error(__FUNCTION__ " Error registering master monitor window class.");
|
||||
tstring_guid guid_str(guid);
|
||||
HWND hwnd_master = FindWindowEx(HWND_MESSAGE, NULL, (LPCTSTR)wnd_class, guid_str.c_str());
|
||||
if (hwnd_master) {
|
||||
// Another monitor is already running.
|
||||
m_is_master = false;
|
||||
|
||||
// Register slave windows class slightly different, not to include slaves in FindWindowEx().
|
||||
const WNDCLASSEX wnd_class_desc = {
|
||||
sizeof(WNDCLASSEX), // cbSize
|
||||
0, // style
|
||||
winproc, // lpfnWndProc
|
||||
0, // cbClsExtra
|
||||
0, // cbWndExtra
|
||||
module, // hInstance
|
||||
NULL, // hIcon
|
||||
NULL, // hCursor
|
||||
NULL, // hbrBackground
|
||||
NULL, // lpszMenuName
|
||||
_T(__FUNCTION__) _T("-Slave"), // lpszClassName
|
||||
NULL // hIconSm
|
||||
};
|
||||
wnd_class = RegisterClassEx(&wnd_class_desc);
|
||||
if (!wnd_class)
|
||||
throw win_runtime_error(__FUNCTION__ " Error registering slave monitor window class.");
|
||||
} else {
|
||||
// This is a fresh monitor.
|
||||
m_is_master = true;
|
||||
}
|
||||
|
||||
m_hwnd = CreateWindowEx(
|
||||
0, // dwExStyle
|
||||
(LPCTSTR)wnd_class, // lpClassName
|
||||
guid_str.c_str(), // lpWindowName
|
||||
0, // dwStyle
|
||||
0, // x
|
||||
0, // y
|
||||
0, // nWidth
|
||||
0, // nHeight
|
||||
HWND_MESSAGE, // hWndParent
|
||||
NULL, // hMenu
|
||||
module, // hInstance
|
||||
this); // lpParam
|
||||
|
||||
if (!m_is_master) {
|
||||
// Notify master we are waiting him.
|
||||
SendMessage(hwnd_master, s_msg_attach, 0, (LPARAM)m_hwnd);
|
||||
|
||||
// Slaves must pump message queue until finished.
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, NULL, 0, 0) > 0) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
eap::monitor_ui::~monitor_ui()
|
||||
{
|
||||
if (m_hwnd)
|
||||
DestroyWindow(m_hwnd);
|
||||
}
|
||||
|
||||
|
||||
void eap::monitor_ui::set_popup(_In_ HWND hwnd)
|
||||
{
|
||||
m_hwnd_popup = hwnd;
|
||||
}
|
||||
|
||||
|
||||
void eap::monitor_ui::release_slaves(_In_bytecount_(size) const void *data, _In_ size_t size) const
|
||||
{
|
||||
assert(!size || data);
|
||||
|
||||
for (list<HWND>::const_iterator slave = m_slaves.begin(), slave_end = m_slaves.end(); slave != slave_end; ++slave) {
|
||||
// Get slave's PID.
|
||||
DWORD pid_slave;
|
||||
GetWindowThreadProcessId(*slave, &pid_slave);
|
||||
|
||||
// Get slave's process handle.
|
||||
process proc_slave;
|
||||
if (!proc_slave.open(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, 0, pid_slave))
|
||||
continue;
|
||||
|
||||
// Allocate memory in slave's virtual memory space and save data to it.
|
||||
vmemory mem_slave;
|
||||
if (!mem_slave.alloc(proc_slave, NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE))
|
||||
continue;
|
||||
if (!WriteProcessMemory(proc_slave, mem_slave, data, size, NULL))
|
||||
continue;
|
||||
|
||||
// Notify slave. Use SendMessage(), not PostMessage(), as memory will get cleaned up.
|
||||
SendMessage(*slave, s_msg_finish, (WPARAM)size, (LPARAM)(LPVOID)mem_slave);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LRESULT eap::monitor_ui::winproc(
|
||||
_In_ UINT msg,
|
||||
_In_ WPARAM wparam,
|
||||
_In_ LPARAM lparam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(wparam);
|
||||
|
||||
if (msg == s_msg_attach) {
|
||||
// Attach a new slave.
|
||||
assert(m_is_master);
|
||||
m_slaves.push_back((HWND)lparam);
|
||||
|
||||
if (m_hwnd_popup) {
|
||||
// Bring pop-up window up.
|
||||
if (::IsIconic(m_hwnd_popup))
|
||||
::SendMessage(m_hwnd_popup, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
::SetActiveWindow(m_hwnd_popup);
|
||||
::SetForegroundWindow(m_hwnd_popup);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} else if (msg == s_msg_finish) {
|
||||
// Master finished.
|
||||
assert(!m_is_master);
|
||||
m_data.assign((const unsigned char*)lparam, (const unsigned char*)lparam + wparam);
|
||||
|
||||
// Finish slave too.
|
||||
DestroyWindow(m_hwnd);
|
||||
return TRUE;
|
||||
} else if (msg == WM_DESTROY) {
|
||||
// Stop the message pump.
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc(m_hwnd, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
|
||||
LRESULT CALLBACK eap::monitor_ui::winproc(
|
||||
_In_ HWND hwnd,
|
||||
_In_ UINT msg,
|
||||
_In_ WPARAM wparam,
|
||||
_In_ LPARAM lparam)
|
||||
{
|
||||
if (msg == WM_CREATE) {
|
||||
// Set window's user data to "this" pointer.
|
||||
const CREATESTRUCT *cs = (CREATESTRUCT*)lparam;
|
||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
|
||||
|
||||
// Forward to our handler.
|
||||
return ((eap::monitor_ui*)cs->lpCreateParams)->winproc(msg, wparam, lparam);
|
||||
} else {
|
||||
// Get "this" pointer from window's user data.
|
||||
eap::monitor_ui *_this = (eap::monitor_ui*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
if (_this) {
|
||||
// Forward to our handler.
|
||||
return _this->winproc(msg, wparam, lparam);
|
||||
} else
|
||||
return DefWindowProc(hwnd, msg, wparam, lparam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const UINT eap::monitor_ui::s_msg_attach = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Attach"));
|
||||
const UINT eap::monitor_ui::s_msg_finish = RegisterWindowMessage(_T(PRODUCT_NAME_STR) _T("-Finish"));
|
||||
|
Binary file not shown.
@@ -25,6 +25,10 @@
|
||||
|
||||
#include <sal.h>
|
||||
|
||||
#define EAP_TLS_OWN 0 ///< We do the TLS ourself
|
||||
#define EAP_TLS_SCHANNEL 1 ///< TLS is done by Schannel, but server certificate check is done ourself
|
||||
#define EAP_TLS_SCHANNEL_FULL 2 ///< TLS is fully done by Schannel
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
@@ -169,8 +173,10 @@ namespace eap
|
||||
std::list<winstd::cert_context> m_trusted_root_ca; ///< Trusted root CAs
|
||||
std::list<std::wstring> m_server_names; ///< Acceptable authenticating server names
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
// Following members are used for session resumptions. They are not exported/imported to XML.
|
||||
sanitizing_blob m_session_id; ///< TLS session ID
|
||||
tls_master_secret m_master_secret; ///< TLS master secret
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
@@ -180,11 +180,6 @@ namespace eap
|
||||
///
|
||||
virtual std::wstring get_identity() const;
|
||||
|
||||
///
|
||||
/// Returns credential name (for GUI display).
|
||||
///
|
||||
virtual winstd::tstring get_name() const;
|
||||
|
||||
///
|
||||
/// Combine credentials in the following order:
|
||||
///
|
||||
|
@@ -36,6 +36,7 @@ namespace eap
|
||||
#include "../../EAPBase/include/Method.h"
|
||||
|
||||
#include <WinStd/Crypt.h>
|
||||
#include <WinStd/Sec.h>
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
@@ -145,10 +146,10 @@ namespace eap
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Providers configuration
|
||||
/// \param[in] cfg Connection configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method_tls(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials_tls &cred);
|
||||
method_tls(_In_ module &module, _In_ config_connection &cfg, _In_ credentials_tls &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
@@ -175,7 +176,7 @@ namespace eap
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
||||
/// Starts an EAP authentication session on the peer EapHost using the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
||||
///
|
||||
@@ -186,7 +187,7 @@ namespace eap
|
||||
_In_ DWORD dwMaxSendPacketSize);
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
@@ -216,6 +217,7 @@ namespace eap
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
/// \name Client handshake message generation
|
||||
/// @{
|
||||
|
||||
@@ -360,6 +362,18 @@ namespace eap
|
||||
///
|
||||
virtual void process_handshake(_In_bytecount_(msg_size) const void *msg, _In_ size_t msg_size);
|
||||
|
||||
#else
|
||||
///
|
||||
/// Process handshake
|
||||
///
|
||||
void process_handshake();
|
||||
|
||||
///
|
||||
/// Process application data
|
||||
///
|
||||
void process_application_data();
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Processes a TLS application_data message
|
||||
///
|
||||
@@ -370,24 +384,16 @@ namespace eap
|
||||
///
|
||||
virtual void process_application_data(_In_bytecount_(msg_size) const void *msg, _In_ size_t msg_size);
|
||||
|
||||
/////
|
||||
///// Processes a vendor-specific TLS message
|
||||
/////
|
||||
///// \note Please see `m_cipher_spec` member if the message data came encrypted.
|
||||
/////
|
||||
///// \param[in] type TLS message type
|
||||
///// \param[in] msg TLS message data
|
||||
///// \param[in] msg_size TLS message data size
|
||||
/////
|
||||
//virtual void process_vendor_data(_In_ tls_message_type_t type, _In_bytecount_(msg_size) const void *msg, _In_ size_t msg_size);
|
||||
|
||||
/// @}
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL_FULL
|
||||
///
|
||||
/// Verifies server's certificate if trusted by configuration
|
||||
///
|
||||
void verify_server_trust() const;
|
||||
#endif
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
/// \name Encryption
|
||||
/// @{
|
||||
|
||||
@@ -481,13 +487,16 @@ namespace eap
|
||||
_In_ HCRYPTKEY key,
|
||||
_In_bytecount_(size_secret) const void *secret,
|
||||
_In_ size_t size_secret);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
credentials_tls &m_cred; ///< EAP-TLS user credentials
|
||||
HANDLE m_user_ctx; ///< Handle to user context
|
||||
|
||||
packet m_packet_req; ///< Request packet
|
||||
packet m_packet_res; ///< Response packet
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
winstd::crypt_prov m_cp; ///< Cryptography provider for general services
|
||||
winstd::crypt_prov m_cp_enc_client; ///< Cryptography provider for encryption
|
||||
winstd::crypt_prov m_cp_enc_server; ///< Cryptography provider for encryption
|
||||
@@ -528,6 +537,20 @@ namespace eap
|
||||
|
||||
unsigned __int64 m_seq_num_client; ///< Sequence number for encrypting
|
||||
unsigned __int64 m_seq_num_server; ///< Sequence number for decrypting
|
||||
#else
|
||||
winstd::tstring m_sc_target_name; ///< Schannel target name
|
||||
winstd::sec_credentials m_sc_cred; ///< Schannel client credentials
|
||||
std::vector<unsigned char> m_sc_queue; ///< TLS data queue
|
||||
winstd::sec_context m_sc_ctx; ///< Schannel context
|
||||
|
||||
enum {
|
||||
phase_unknown = -1, ///< Unknown phase
|
||||
phase_handshake_init = 0, ///< Handshake initialize
|
||||
phase_handshake_cont, ///< Handshake continue
|
||||
phase_application_data, ///< Exchange application data
|
||||
phase_shutdown, ///< Connection shut down
|
||||
} m_phase, m_phase_prev; ///< What phase is our communication at?
|
||||
#endif
|
||||
|
||||
// The following members are required to avoid memory leakage in get_result()
|
||||
EAP_ATTRIBUTES m_eap_attr_desc; ///< EAP Radius attributes descriptor
|
||||
|
@@ -503,7 +503,16 @@ namespace eap
|
||||
///
|
||||
tls_conn_state& operator=(_Inout_ tls_conn_state &&other);
|
||||
|
||||
///
|
||||
/// Configures state according to given cipher
|
||||
///
|
||||
/// \param[in] cipher Cipher ID
|
||||
///
|
||||
void set_cipher(_In_ const unsigned char cipher[2]);
|
||||
|
||||
public:
|
||||
LPCTSTR m_prov_name; ///< Cryptography provider name
|
||||
DWORD m_prov_type; ///< Cryptography provider type
|
||||
ALG_ID m_alg_encrypt; ///< Bulk encryption algorithm
|
||||
size_t m_size_enc_key; ///< Encryption key size in bytes (has to comply with `m_alg_encrypt`)
|
||||
size_t m_size_enc_iv; ///< Encryption initialization vector size in bytes (has to comply with `m_alg_encrypt`)
|
||||
|
@@ -75,8 +75,10 @@ eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method_with
|
||||
eap::config_method_tls::config_method_tls(_In_ const config_method_tls &other) :
|
||||
m_trusted_root_ca(other.m_trusted_root_ca),
|
||||
m_server_names(other.m_server_names),
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_session_id(other.m_session_id),
|
||||
m_master_secret(other.m_master_secret),
|
||||
#endif
|
||||
config_method_with_cred(other)
|
||||
{
|
||||
}
|
||||
@@ -85,8 +87,10 @@ eap::config_method_tls::config_method_tls(_In_ const config_method_tls &other) :
|
||||
eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) :
|
||||
m_trusted_root_ca(std::move(other.m_trusted_root_ca)),
|
||||
m_server_names(std::move(other.m_server_names)),
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_session_id(std::move(other.m_session_id)),
|
||||
m_master_secret(std::move(other.m_master_secret)),
|
||||
#endif
|
||||
config_method_with_cred(std::move(other))
|
||||
{
|
||||
}
|
||||
@@ -98,8 +102,10 @@ eap::config_method_tls& eap::config_method_tls::operator=(_In_ const config_meth
|
||||
(config_method_with_cred&)*this = other;
|
||||
m_trusted_root_ca = other.m_trusted_root_ca;
|
||||
m_server_names = other.m_server_names;
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_session_id = other.m_session_id;
|
||||
m_master_secret = other.m_master_secret;
|
||||
#endif
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -112,8 +118,10 @@ eap::config_method_tls& eap::config_method_tls::operator=(_Inout_ config_method_
|
||||
(config_method_with_cred&&)*this = std::move(other);
|
||||
m_trusted_root_ca = std::move(other.m_trusted_root_ca);
|
||||
m_server_names = std::move(other.m_server_names);
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_session_id = std::move(other.m_session_id);
|
||||
m_master_secret = std::move(other.m_master_secret);
|
||||
#endif
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -243,8 +251,10 @@ void eap::config_method_tls::operator<<(_Inout_ cursor_out &cursor) const
|
||||
config_method_with_cred::operator<<(cursor);
|
||||
cursor << m_trusted_root_ca;
|
||||
cursor << m_server_names ;
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
cursor << m_session_id ;
|
||||
cursor << m_master_secret ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -253,9 +263,14 @@ size_t eap::config_method_tls::get_pk_size() const
|
||||
return
|
||||
config_method_with_cred::get_pk_size() +
|
||||
pksizeof(m_trusted_root_ca) +
|
||||
pksizeof(m_server_names ) +
|
||||
pksizeof(m_server_names )
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
+
|
||||
pksizeof(m_session_id ) +
|
||||
pksizeof(m_master_secret );
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -264,8 +279,10 @@ void eap::config_method_tls::operator>>(_Inout_ cursor_in &cursor)
|
||||
config_method_with_cred::operator>>(cursor);
|
||||
cursor >> m_trusted_root_ca;
|
||||
cursor >> m_server_names ;
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
cursor >> m_session_id ;
|
||||
cursor >> m_master_secret ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -182,11 +182,10 @@ void eap::credentials_tls::store(_In_z_ LPCTSTR pszTargetName) const
|
||||
throw win_runtime_error(__FUNCTION__ " CryptProtectData failed.");
|
||||
|
||||
tstring target(target_name(pszTargetName));
|
||||
wstring name(std::move(get_name()));
|
||||
|
||||
// Write credentials.
|
||||
assert(cred_enc.cbData < CRED_MAX_CREDENTIAL_BLOB_SIZE);
|
||||
assert(name.length() < CRED_MAX_USERNAME_LENGTH );
|
||||
assert(m_identity.length() < CRED_MAX_USERNAME_LENGTH );
|
||||
CREDENTIAL cred = {
|
||||
0, // Flags
|
||||
CRED_TYPE_GENERIC, // Type
|
||||
@@ -199,7 +198,7 @@ void eap::credentials_tls::store(_In_z_ LPCTSTR pszTargetName) const
|
||||
0, // AttributeCount
|
||||
NULL, // Attributes
|
||||
NULL, // TargetAlias
|
||||
(LPTSTR)name.c_str() // UserName
|
||||
(LPTSTR)m_identity.c_str() // UserName
|
||||
};
|
||||
if (!CredWrite(&cred, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " CredWrite failed.");
|
||||
@@ -227,7 +226,14 @@ void eap::credentials_tls::retrieve(_In_z_ LPCTSTR pszTargetName)
|
||||
if (!bResult)
|
||||
throw win_runtime_error(__FUNCTION__ " Error loading certificate.");
|
||||
|
||||
m_module.log_config((wstring(pszTargetName) + L"/Certificate").c_str(), get_name().c_str());
|
||||
if (cred->UserName)
|
||||
m_identity = cred->UserName;
|
||||
else
|
||||
m_identity.clear();
|
||||
|
||||
wstring xpath(pszTargetName);
|
||||
m_module.log_config((xpath + L"/Identity").c_str(), m_identity.c_str());
|
||||
m_module.log_config((xpath + L"/Certificate").c_str(), get_name().c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +245,9 @@ LPCTSTR eap::credentials_tls::target_suffix() const
|
||||
|
||||
std::wstring eap::credentials_tls::get_identity() const
|
||||
{
|
||||
if (m_cert) {
|
||||
if (!m_identity.empty()) {
|
||||
return m_identity;
|
||||
} else if (m_cert) {
|
||||
wstring identity;
|
||||
CertGetNameString(m_cert, CERT_NAME_EMAIL_TYPE, 0, NULL, identity);
|
||||
return identity;
|
||||
@@ -248,12 +256,6 @@ std::wstring eap::credentials_tls::get_identity() const
|
||||
}
|
||||
|
||||
|
||||
tstring eap::credentials_tls::get_name() const
|
||||
{
|
||||
return m_cert ? std::move(get_cert_title(m_cert)) : _T("<blank>");
|
||||
}
|
||||
|
||||
|
||||
eap::credentials::source_t eap::credentials_tls::combine(
|
||||
_In_ const credentials_tls *cred_cached,
|
||||
_In_ const config_method_tls &cfg,
|
||||
|
@@ -20,9 +20,41 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#if EAP_TLS >= EAP_TLS_SCHANNEL
|
||||
#pragma comment(lib, "Secur32.lib")
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
static const unsigned char s_cipher_suite[] = {
|
||||
//0xc0, 0x28, // ECDHE-RSA-AES256-SHA384 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384
|
||||
//0xc0, 0x24, // ECDHE-ECDSA-AES256-SHA384 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384
|
||||
0x00, 0x3d, // AES256-SHA256 Kx=RSA Au=RSA Enc=AES(256) Mac=SHA256
|
||||
//0x00, 0x6b, // DHE-RSA-AES256-SHA256 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256
|
||||
//0x00, 0x6a, // DHE-DSS-AES256-SHA256 Kx=DH Au=DSS Enc=AES(256) Mac=SHA256
|
||||
//0xc0, 0x27, // ECDHE-RSA-AES128-SHA256 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256
|
||||
//0xc0, 0x23, // ECDHE-ECDSA-AES128-SHA256 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256
|
||||
0x00, 0x3c, // AES128-SHA256 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA256
|
||||
//0x00, 0x67, // DHE-RSA-AES128-SHA256 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256
|
||||
//0x00, 0x40, // DHE-DSS-AES128-SHA256 Kx=DH Au=DSS Enc=AES(128) Mac=SHA256
|
||||
|
||||
// Backward compatibility ciphers
|
||||
0x00, 0x2f, // TLS_RSA_WITH_AES_128_CBC_SHA (required by TLS 1.2)
|
||||
0x00, 0x0a, // TLS_RSA_WITH_3DES_EDE_CBC_SHA (required by EAP-TLS)
|
||||
};
|
||||
static const unsigned char s_compression_suite[] = {
|
||||
0x00, // No compression
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::method_tls::packet
|
||||
@@ -93,26 +125,38 @@ void eap::method_tls::packet::clear()
|
||||
// eap::method_tls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method_tls::method_tls(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials_tls &cred) :
|
||||
eap::method_tls::method_tls(_In_ module &module, _In_ config_connection &cfg, _In_ credentials_tls &cred) :
|
||||
m_cred(cred),
|
||||
m_user_ctx(NULL),
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_phase(phase_unknown),
|
||||
m_seq_num_client(0),
|
||||
m_seq_num_server(0),
|
||||
#else
|
||||
m_phase(phase_unknown),
|
||||
m_phase_prev(phase_unknown),
|
||||
#endif
|
||||
m_blob_cfg(NULL),
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
m_blob_cred(NULL),
|
||||
#endif
|
||||
method(module, cfg, cred)
|
||||
{
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_tls_version = tls_version_1_2;
|
||||
#ifdef _DEBUG
|
||||
memset(m_handshake, 0, sizeof(m_handshake));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
eap::method_tls::method_tls(_Inout_ method_tls &&other) :
|
||||
m_cred ( other.m_cred ),
|
||||
m_user_ctx (std::move(other.m_user_ctx )),
|
||||
m_packet_req (std::move(other.m_packet_req )),
|
||||
m_packet_res (std::move(other.m_packet_res )),
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_cp (std::move(other.m_cp )),
|
||||
m_cp_enc_client (std::move(other.m_cp_enc_client )),
|
||||
m_cp_enc_server (std::move(other.m_cp_enc_server )),
|
||||
@@ -136,12 +180,22 @@ eap::method_tls::method_tls(_Inout_ method_tls &&other) :
|
||||
m_phase (std::move(other.m_phase )),
|
||||
m_seq_num_client (std::move(other.m_seq_num_client )),
|
||||
m_seq_num_server (std::move(other.m_seq_num_server )),
|
||||
#else
|
||||
m_sc_target_name (std::move(other.m_sc_target_name )),
|
||||
m_sc_cred (std::move(other.m_sc_cred )),
|
||||
m_sc_queue (std::move(other.m_sc_queue )),
|
||||
m_sc_ctx (std::move(other.m_sc_ctx )),
|
||||
m_phase (std::move(other.m_phase )),
|
||||
m_phase_prev (std::move(other.m_phase_prev )),
|
||||
#endif
|
||||
method (std::move(other ))
|
||||
{
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
memcpy(m_handshake, other.m_handshake, sizeof(m_handshake));
|
||||
#ifdef _DEBUG
|
||||
memset(other.m_handshake, 0, sizeof(m_handshake));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -162,8 +216,10 @@ eap::method_tls& eap::method_tls::operator=(_Inout_ method_tls &&other)
|
||||
if (this != std::addressof(other)) {
|
||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move method with same credentials only!
|
||||
(method&)*this = std::move(other );
|
||||
m_user_ctx = std::move(other.m_user_ctx );
|
||||
m_packet_req = std::move(other.m_packet_req );
|
||||
m_packet_res = std::move(other.m_packet_res );
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
m_cp = std::move(other.m_cp );
|
||||
m_cp_enc_client = std::move(other.m_cp_enc_client );
|
||||
m_cp_enc_server = std::move(other.m_cp_enc_server );
|
||||
@@ -191,6 +247,14 @@ eap::method_tls& eap::method_tls::operator=(_Inout_ method_tls &&other)
|
||||
memcpy(m_handshake, other.m_handshake, sizeof(m_handshake));
|
||||
#ifdef _DEBUG
|
||||
memset(other.m_handshake, 0, sizeof(m_handshake));
|
||||
#endif
|
||||
#else
|
||||
m_sc_target_name = std::move(other.m_sc_target_name );
|
||||
m_sc_cred = std::move(other.m_sc_cred );
|
||||
m_sc_queue = std::move(other.m_sc_queue );
|
||||
m_sc_ctx = std::move(other.m_sc_ctx );
|
||||
m_phase = std::move(other.m_phase );
|
||||
m_phase_prev = std::move(other.m_phase_prev );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -206,8 +270,19 @@ void eap::method_tls::begin_session(
|
||||
{
|
||||
method::begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
|
||||
|
||||
m_user_ctx = hTokenImpersonateUser;
|
||||
user_impersonator impersonating(m_user_ctx);
|
||||
|
||||
// Get method configuration.
|
||||
if (m_cfg.m_providers.empty() || m_cfg.m_providers.front().m_methods.empty())
|
||||
throw invalid_argument(__FUNCTION__ " Configuration has no providers and/or methods.");
|
||||
const config_provider &cfg_prov(m_cfg.m_providers.front());
|
||||
const config_method_tls *cfg_method = dynamic_cast<const config_method_tls*>(cfg_prov.m_methods.front().get());
|
||||
assert(cfg_method);
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
// Create cryptographics provider for support needs (handshake hashing, client random, temporary keys...).
|
||||
if (!m_cp.create(NULL, NULL, PROV_RSA_AES))
|
||||
if (!m_cp.create(NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating cryptographics provider.");
|
||||
|
||||
// Microsoft CryptoAPI does not support importing clear text session keys.
|
||||
@@ -215,16 +290,56 @@ void eap::method_tls::begin_session(
|
||||
if (!m_key_exp1.create_exp1(m_cp, AT_KEYEXCHANGE))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating exponent-of-one key.");
|
||||
|
||||
if (m_cfg.m_providers.empty() || m_cfg.m_providers.front().m_methods.empty())
|
||||
throw invalid_argument(__FUNCTION__ " Configuration has no providers and/or methods.");
|
||||
|
||||
const config_provider &cfg_prov(m_cfg.m_providers.front());
|
||||
const config_method_tls *cfg_method = dynamic_cast<const config_method_tls*>(cfg_prov.m_methods.front().get());
|
||||
assert(cfg_method);
|
||||
|
||||
// Restore previous session ID and master secret. We might get lucky.
|
||||
m_session_id = cfg_method->m_session_id;
|
||||
m_master_secret = cfg_method->m_master_secret;
|
||||
#else
|
||||
// Build (expected) server name(s) for Schannel.
|
||||
m_sc_target_name.clear();
|
||||
for (list<wstring>::const_iterator name = cfg_method->m_server_names.cbegin(), name_end = cfg_method->m_server_names.cend(); name != name_end; ++name) {
|
||||
if (name != cfg_method->m_server_names.cbegin())
|
||||
m_sc_target_name += _T(';');
|
||||
#ifdef _UNICODE
|
||||
m_sc_target_name.insert(m_sc_target_name.end(), name->begin(), name->end());
|
||||
#else
|
||||
string buf;
|
||||
WideCharToMultiByte(CP_ACP, 0, name->c_str(), -1, buf, NULL, NULL);
|
||||
m_sc_target_name.insert(m_sc_target_name.end(), buf.begin(), buf.end());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Prepare client credentials for Schannel.
|
||||
PCCERT_CONTEXT certs[] = { m_cred.m_cert ? m_cred.m_cert : NULL };
|
||||
SCHANNEL_CRED cred = {
|
||||
SCHANNEL_CRED_VERSION, // dwVersion
|
||||
m_cred.m_cert ? 1 : 0, // cCreds
|
||||
certs, // paCred
|
||||
NULL, // hRootStore: Not valid for client credentials
|
||||
0, // cMappers
|
||||
NULL, // aphMappers
|
||||
0, // cSupportedAlgs: Use system configured default
|
||||
NULL, // palgSupportedAlgs: Use system configured default
|
||||
0, // grbitEnabledProtocols: Use default
|
||||
0, // dwMinimumCipherStrength: Use system configured default
|
||||
0, // dwMaximumCipherStrength: Use system configured default
|
||||
0, // dwSessionLifespan: Use system configured default = 10hr
|
||||
#if EAP_TLS >= EAP_TLS_SCHANNEL_FULL
|
||||
SCH_CRED_AUTO_CRED_VALIDATION | // dwFlags: Let Schannel verify server certificate
|
||||
#else
|
||||
SCH_CRED_MANUAL_CRED_VALIDATION | // dwFlags: Prevent Schannel verify server certificate (we want to use custom root CA store and multiple name checking)
|
||||
#endif
|
||||
SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE | // dwFlags: Do not attempt online revocation check - we do not expect to have network connection yet
|
||||
SCH_CRED_IGNORE_NO_REVOCATION_CHECK | // dwFlags: Ignore no-revocation-check errors (TODO: Test if this flag is required.)
|
||||
SCH_CRED_IGNORE_REVOCATION_OFFLINE | // dwFlags: Ignore offline-revocation errors - we do not expect to have network connection yet
|
||||
SCH_CRED_NO_DEFAULT_CREDS | // dwFlags: If client certificate we provided is not acceptable, do not try to select one on your own
|
||||
(cfg_method->m_server_names.empty() ? SCH_CRED_NO_SERVERNAME_CHECK : 0) | // dwFlags: When no expected server name is given, do not do the server name check.
|
||||
0x00400000 /*SCH_USE_STRONG_CRYPTO*/, // dwFlags: Do not use broken ciphers
|
||||
0 // dwCredFormat
|
||||
};
|
||||
SECURITY_STATUS stat = m_sc_cred.acquire(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &cred);
|
||||
if (FAILED(stat))
|
||||
throw sec_runtime_error(stat, __FUNCTION__ " Error acquiring Schannel credentials handle.");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -316,6 +431,9 @@ void eap::method_tls::process_request_packet(
|
||||
m_packet_res.m_id = m_packet_req.m_id;
|
||||
m_packet_res.m_flags = 0;
|
||||
|
||||
user_impersonator impersonating(m_user_ctx);
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
if (pReceivedPacket->Code == EapCodeRequest && (m_packet_req.m_flags & flags_req_start)) {
|
||||
// This is the EAP-TLS start message: (re)initialize method.
|
||||
m_module.log_event(&EAPMETHOD_TLS_HANDSHAKE_START2, event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
@@ -359,8 +477,12 @@ void eap::method_tls::process_request_packet(
|
||||
if (!m_handshake[tls_handshake_type_server_hello])
|
||||
throw win_runtime_error(__FUNCTION__ " Server did not hello back. No server random! What cipher to use?");
|
||||
|
||||
// Create cryptographics provider (based on server selected cipher?).
|
||||
if (!m_cp_enc_client.create(NULL, NULL, PROV_RSA_AES))
|
||||
// Adopt server state as client pending.
|
||||
// If server already send the change cipher spec, use active server state. Otherwise pending.
|
||||
m_state_client_pending = m_state_server.m_alg_encrypt ? m_state_server : m_state_server_pending;
|
||||
|
||||
// Create cryptographics provider.
|
||||
if (!m_cp_enc_client.create(NULL, m_state_client_pending.m_prov_name, m_state_client_pending.m_prov_type, CRYPT_VERIFYCONTEXT))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating cryptographics provider.");
|
||||
|
||||
if (m_handshake[tls_handshake_type_certificate]) {
|
||||
@@ -382,14 +504,14 @@ void eap::method_tls::process_request_packet(
|
||||
|
||||
// Generate pre-master secret. PMS will get sanitized in its destructor when going out-of-scope.
|
||||
// Always use latest supported version by client (not negotiated one, to detect version rollback attacks).
|
||||
tls_master_secret pms(m_cp_enc_client, tls_version_1_2);
|
||||
tls_master_secret pms(m_cp, tls_version_1_2);
|
||||
|
||||
// Derive master secret.
|
||||
static const unsigned char s_label[] = "master secret";
|
||||
sanitizing_blob seed(s_label, s_label + _countof(s_label) - 1);
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_client, (const unsigned char*)(&m_random_client + 1));
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_server, (const unsigned char*)(&m_random_server + 1));
|
||||
memcpy(&m_master_secret, prf(m_cp_enc_client, m_alg_prf, pms, seed, sizeof(tls_master_secret)).data(), sizeof(tls_master_secret));
|
||||
memcpy(&m_master_secret, prf(m_cp, m_alg_prf, pms, seed, sizeof(tls_master_secret)).data(), sizeof(tls_master_secret));
|
||||
|
||||
// Create client key exchange message, and append to packet.
|
||||
sanitizing_blob msg_client_key_exchange(make_message(tls_message_type_handshake, make_client_key_exchange(pms)));
|
||||
@@ -404,23 +526,19 @@ void eap::method_tls::process_request_packet(
|
||||
sanitizing_blob ccs(make_message(tls_message_type_change_cipher_spec, sanitizing_blob(1, 1)));
|
||||
m_packet_res.m_data.insert(m_packet_res.m_data.end(), ccs.begin(), ccs.end());
|
||||
|
||||
// Adopt server state as client pending.
|
||||
// If server already send the change cipher spec, use active server state. Otherwise pending.
|
||||
m_state_client_pending = m_state_server.m_alg_encrypt ? m_state_server : m_state_server_pending;
|
||||
|
||||
// Derive client side keys.
|
||||
static const unsigned char s_label[] = "key expansion";
|
||||
sanitizing_blob seed(s_label, s_label + _countof(s_label) - 1);
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_server, (const unsigned char*)(&m_random_server + 1));
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_client, (const unsigned char*)(&m_random_client + 1));
|
||||
sanitizing_blob key_block(prf(m_cp_enc_client, m_alg_prf, m_master_secret, seed,
|
||||
sanitizing_blob key_block(prf(m_cp, m_alg_prf, m_master_secret, seed,
|
||||
2*m_state_client_pending.m_size_mac_key + // client_write_MAC_secret & server_write_MAC_secret (SHA1)
|
||||
2*m_state_client_pending.m_size_enc_key + // client_write_key & server_write_key
|
||||
2*m_state_client_pending.m_size_enc_iv )); // client_write_IV & server_write_IV
|
||||
const unsigned char *_key_block = key_block.data();
|
||||
|
||||
// client_write_MAC_secret
|
||||
m_state_client_pending.m_padding_hmac = hmac_padding(m_cp_enc_client, m_state_client_pending.m_alg_mac, _key_block, m_state_client_pending.m_size_mac_key);
|
||||
m_state_client_pending.m_padding_hmac = hmac_padding(m_cp, m_state_client_pending.m_alg_mac, _key_block, m_state_client_pending.m_size_mac_key);
|
||||
_key_block += m_state_client_pending.m_size_mac_key;
|
||||
|
||||
// server_write_MAC_secret
|
||||
@@ -461,12 +579,33 @@ void eap::method_tls::process_request_packet(
|
||||
if (m_handshake[tls_handshake_type_hello_request])
|
||||
m_phase = phase_client_hello;
|
||||
}
|
||||
#else
|
||||
if (pReceivedPacket->Code == EapCodeRequest && (m_packet_req.m_flags & flags_req_start)) {
|
||||
// This is the EAP-TLS start message: (re)initialize method.
|
||||
m_module.log_event(&EAPMETHOD_TLS_HANDSHAKE_START2, event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
m_phase = phase_handshake_init;
|
||||
m_sc_queue.assign(m_packet_req.m_data.begin(), m_packet_req.m_data.end());
|
||||
} else
|
||||
m_sc_queue.insert(m_sc_queue.end(), m_packet_req.m_data.begin(), m_packet_req.m_data.end());
|
||||
|
||||
m_phase_prev = m_phase;
|
||||
switch (m_phase) {
|
||||
case phase_handshake_init:
|
||||
case phase_handshake_cont:
|
||||
process_handshake();
|
||||
break;
|
||||
|
||||
case phase_application_data:
|
||||
process_application_data();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
pEapOutput->fAllowNotifications = TRUE;
|
||||
pEapOutput->action = EapPeerMethodResponseActionSend;
|
||||
|
||||
// EAP-Request packet was processed. Clear its data since we use the absence of data to detect first of fragmented message packages.
|
||||
m_packet_req.m_data.clear();
|
||||
|
||||
pEapOutput->fAllowNotifications = FALSE;
|
||||
pEapOutput->action = EapPeerMethodResponseActionSend;
|
||||
}
|
||||
|
||||
|
||||
@@ -538,11 +677,9 @@ void eap::method_tls::get_result(
|
||||
|
||||
switch (reason) {
|
||||
case EapPeerMethodResultSuccess: {
|
||||
if (!m_handshake[tls_handshake_type_finished])
|
||||
throw invalid_argument(__FUNCTION__ " Premature success.");
|
||||
|
||||
m_module.log_event(&EAPMETHOD_TLS_SUCCESS, event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
// Derive MSK/EMSK for line encryption.
|
||||
derive_msk();
|
||||
|
||||
@@ -555,6 +692,26 @@ void eap::method_tls::get_result(
|
||||
a.create_ms_mppe_key(17, (LPCBYTE)&m_key_mppe_server, sizeof(tls_random));
|
||||
m_eap_attr.push_back(std::move(a));
|
||||
m_eap_attr.push_back(eap_attr::blank);
|
||||
#else
|
||||
// Derive MSK/EMSK for line encryption.
|
||||
SecPkgContext_EapKeyBlock key_block;
|
||||
SECURITY_STATUS status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_EAP_KEY_BLOCK, &key_block);
|
||||
if (FAILED(status))
|
||||
throw sec_runtime_error(status, __FUNCTION__ "Error generating MSK in Schannel.");
|
||||
const unsigned char *_key_block = key_block.rgbKeys;
|
||||
|
||||
// Fill array with RADIUS attributes.
|
||||
eap_attr a;
|
||||
m_eap_attr.clear();
|
||||
m_eap_attr.reserve(3);
|
||||
a.create_ms_mppe_key(16, _key_block, sizeof(tls_random));
|
||||
m_eap_attr.push_back(std::move(a));
|
||||
_key_block += sizeof(tls_random);
|
||||
a.create_ms_mppe_key(17, _key_block, sizeof(tls_random));
|
||||
m_eap_attr.push_back(std::move(a));
|
||||
_key_block += sizeof(tls_random);
|
||||
m_eap_attr.push_back(eap_attr::blank);
|
||||
#endif
|
||||
|
||||
m_eap_attr_desc.dwNumberOfAttributes = (DWORD)m_eap_attr.size();
|
||||
m_eap_attr_desc.pAttribs = m_eap_attr.data();
|
||||
@@ -566,25 +723,33 @@ void eap::method_tls::get_result(
|
||||
ppResult->fIsSuccess = TRUE;
|
||||
ppResult->dwFailureReasonCode = ERROR_SUCCESS;
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
// Update configuration with session resumption data and prepare BLOB.
|
||||
cfg_method->m_session_id = m_session_id;
|
||||
cfg_method->m_master_secret = m_master_secret;
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case EapPeerMethodResultFailure:
|
||||
m_module.log_event(&EAPMETHOD_TLS_FAILURE, event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
m_module.log_event(
|
||||
m_phase_prev < phase_handshake_cont ? &EAPMETHOD_TLS_FAILURE_INIT :
|
||||
m_phase_prev < phase_application_data ? &EAPMETHOD_TLS_FAILURE_HANDSHAKE : &EAPMETHOD_TLS_FAILURE,
|
||||
event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
// Clear session resumption data.
|
||||
cfg_method->m_session_id.clear();
|
||||
cfg_method->m_master_secret.clear();
|
||||
#endif
|
||||
|
||||
// Mark credentials as failed, so GUI can re-prompt user.
|
||||
cfg_method->m_auth_failed = true;
|
||||
// But be careful: do so only if this happened after transition from handshake to application data phase.
|
||||
cfg_method->m_auth_failed = m_phase_prev < phase_application_data && m_phase >= phase_application_data;
|
||||
|
||||
// Do not report failure to EAPHost, as it will not save updated configuration then. But we need it to save it, to alert user on next connection attempt.
|
||||
// EAPHost is well aware of the failed condition.
|
||||
// Do not report failure to EapHost, as it will not save updated configuration then. But we need it to save it, to alert user on next connection attempt.
|
||||
// EapHost is well aware of the failed condition.
|
||||
//ppResult->fIsSuccess = FALSE;
|
||||
//ppResult->dwFailureReasonCode = EAP_E_AUTHENTICATION_FAILED;
|
||||
|
||||
@@ -611,16 +776,10 @@ void eap::method_tls::get_result(
|
||||
}
|
||||
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
eap::sanitizing_blob eap::method_tls::make_client_hello()
|
||||
{
|
||||
static const unsigned char s_cipher_suite[] = {
|
||||
0x00, 0x2f, // TLS_RSA_WITH_AES_128_CBC_SHA (required by TLS 1.2)
|
||||
0x00, 0x0a, // TLS_RSA_WITH_3DES_EDE_CBC_SHA (required by EAP-TLS)
|
||||
};
|
||||
static const unsigned char s_compression_suite[] = {
|
||||
0x00, // No compression
|
||||
};
|
||||
|
||||
size_t size_data;
|
||||
sanitizing_blob msg;
|
||||
msg.reserve(
|
||||
@@ -653,7 +812,7 @@ eap::sanitizing_blob eap::method_tls::make_client_hello()
|
||||
msg.insert(msg.end(), m_session_id.begin(), m_session_id.end());
|
||||
|
||||
// Cypher suite list
|
||||
unsigned short size_cipher_suite2 = htons((unsigned short)sizeof(s_cipher_suite)/2);
|
||||
unsigned short size_cipher_suite2 = htons((unsigned short)sizeof(s_cipher_suite));
|
||||
msg.insert(msg.end(), (unsigned char*)&size_cipher_suite2, (unsigned char*)(&size_cipher_suite2 + 1));
|
||||
msg.insert(msg.end(), s_cipher_suite, s_cipher_suite + _countof(s_cipher_suite));
|
||||
|
||||
@@ -772,7 +931,7 @@ eap::sanitizing_blob eap::method_tls::make_finished() const
|
||||
throw win_runtime_error(__FUNCTION__ " Error finishing SHA-256 hash calculation.");
|
||||
seed.insert(seed.end(), hash_data.begin(), hash_data.end());
|
||||
}
|
||||
sanitizing_blob verify(prf(m_cp_enc_client, m_alg_prf, m_master_secret, seed, 12));
|
||||
sanitizing_blob verify(prf(m_cp, m_alg_prf, m_master_secret, seed, 12));
|
||||
msg.insert(msg.end(), verify.begin(), verify.end());
|
||||
|
||||
return msg;
|
||||
@@ -816,7 +975,7 @@ void eap::method_tls::derive_msk()
|
||||
sanitizing_blob seed(s_label, s_label + _countof(s_label) - 1);
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_client, (const unsigned char*)(&m_random_client + 1));
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_server, (const unsigned char*)(&m_random_server + 1));
|
||||
sanitizing_blob key_block(prf(m_cp_enc_client, m_alg_prf, m_master_secret, seed, 2*sizeof(tls_random)));
|
||||
sanitizing_blob key_block(prf(m_cp, m_alg_prf, m_master_secret, seed, 2*sizeof(tls_random)));
|
||||
const unsigned char *_key_block = key_block.data();
|
||||
|
||||
// MS-MPPE-Recv-Key
|
||||
@@ -882,14 +1041,6 @@ void eap::method_tls::process_packet(_In_bytecount_(size_pck) const void *_pck,
|
||||
process_application_data(msg_dec.data(), msg_dec.size());
|
||||
break;
|
||||
}
|
||||
|
||||
//default:
|
||||
// if (m_state_server.m_alg_encrypt) {
|
||||
// sanitizing_blob msg_dec(msg, msg_end);
|
||||
// decrypt_message(hdr->type, msg_dec);
|
||||
// process_vendor_data(hdr->type, msg_dec.data(), msg_dec.size());
|
||||
// } else
|
||||
// process_vendor_data(hdr->type, msg, msg_end - msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -913,14 +1064,14 @@ void eap::method_tls::process_change_cipher_spec(_In_bytecount_(msg_size) const
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Change cipher spec received without cipher being negotiated first.");
|
||||
|
||||
// Create cryptographics provider (based on server selected cipher?).
|
||||
if (!m_cp_enc_server.create(NULL, NULL, PROV_RSA_AES))
|
||||
if (!m_cp_enc_server.create(NULL, m_state_server_pending.m_prov_name, m_state_server_pending.m_prov_type))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating cryptographics provider.");
|
||||
|
||||
static const unsigned char s_label[] = "key expansion";
|
||||
sanitizing_blob seed(s_label, s_label + _countof(s_label) - 1);
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_server, (const unsigned char*)(&m_random_server + 1));
|
||||
seed.insert(seed.end(), (const unsigned char*)&m_random_client, (const unsigned char*)(&m_random_client + 1));
|
||||
sanitizing_blob key_block(prf(m_cp_enc_server, m_alg_prf, m_master_secret, seed,
|
||||
sanitizing_blob key_block(prf(m_cp, m_alg_prf, m_master_secret, seed,
|
||||
2*m_state_server_pending.m_size_mac_key + // client_write_MAC_secret & server_write_MAC_secret (SHA1)
|
||||
2*m_state_server_pending.m_size_enc_key + // client_write_key & server_write_key
|
||||
2*m_state_server_pending.m_size_enc_iv )); // client_write_IV & server_write_IV
|
||||
@@ -930,7 +1081,7 @@ void eap::method_tls::process_change_cipher_spec(_In_bytecount_(msg_size) const
|
||||
_key_block += m_state_server_pending.m_size_mac_key;
|
||||
|
||||
// server_write_MAC_secret
|
||||
m_state_server_pending.m_padding_hmac = hmac_padding(m_cp_enc_server, m_state_server_pending.m_alg_mac, _key_block, m_state_server_pending.m_size_mac_key);
|
||||
m_state_server_pending.m_padding_hmac = hmac_padding(m_cp, m_state_server_pending.m_alg_mac, _key_block, m_state_server_pending.m_size_mac_key);
|
||||
_key_block += m_state_server_pending.m_size_mac_key;
|
||||
|
||||
// client_write_key
|
||||
@@ -1017,27 +1168,32 @@ void eap::method_tls::process_handshake(_In_bytecount_(msg_size) const void *_ms
|
||||
|
||||
// Cipher
|
||||
if (rec + 2 > rec_end)
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Cipher or incomplete.");
|
||||
if (rec[0] == 0x00 || rec[1] == 0x2f) {
|
||||
// TLS_RSA_WITH_AES_128_CBC_SHA
|
||||
m_state_server_pending.m_alg_encrypt = CALG_AES_128;
|
||||
m_state_server_pending.m_size_enc_key = 128/8; // AES-128
|
||||
m_state_server_pending.m_size_enc_iv = 128/8; // AES-128
|
||||
m_state_server_pending.m_size_enc_block = 128/8; // AES-128
|
||||
m_state_server_pending.m_alg_mac = CALG_SHA1;
|
||||
m_state_server_pending.m_size_mac_key = 160/8; // SHA-1
|
||||
m_state_server_pending.m_size_mac_hash = 160/8; // SHA-1
|
||||
} else if (rec[0] == 0x00 || rec[1] == 0x0a) {
|
||||
// TLS_RSA_WITH_3DES_EDE_CBC_SHA
|
||||
m_state_server_pending.m_alg_encrypt = CALG_3DES;
|
||||
m_state_server_pending.m_size_enc_key = 192/8; // 3DES 192bits
|
||||
m_state_server_pending.m_size_enc_iv = 64/8; // 3DES 64bits
|
||||
m_state_server_pending.m_size_enc_block = 64/8; // 3DES 64bits
|
||||
m_state_server_pending.m_alg_mac = CALG_SHA1;
|
||||
m_state_server_pending.m_size_mac_key = 160/8; // SHA-1
|
||||
m_state_server_pending.m_size_mac_hash = 160/8; // SHA-1
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Cipher missing or incomplete.");
|
||||
|
||||
// Verify the server selected one of our ciphers.
|
||||
for (size_t i = 0; ; i += 2) {
|
||||
if (i < _countof(s_cipher_suite)) {
|
||||
if (s_cipher_suite[i] == rec[0] && s_cipher_suite[i + 1] == rec[1])
|
||||
break;
|
||||
} else
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, string_printf(__FUNCTION__ " Other than requested cipher selected (received 0x%02x%02x).", rec[0], rec[1]));
|
||||
}
|
||||
m_state_server_pending.set_cipher(rec);
|
||||
rec += 2;
|
||||
|
||||
// Compression
|
||||
if (rec + 1 > rec_end)
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Compression missing or incomplete.");
|
||||
|
||||
// Verify the server selected one of our compression schemes.
|
||||
for (size_t i = 0; ; i++) {
|
||||
if (i < _countof(s_compression_suite)) {
|
||||
if (s_compression_suite[i] == rec[0])
|
||||
break;
|
||||
} else
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, string_printf(__FUNCTION__ " Other than requested compression selected (received 0x%02).", rec[0]));
|
||||
}
|
||||
rec++;
|
||||
|
||||
m_module.log_event(&EAPMETHOD_TLS_SERVER_HELLO1,
|
||||
event_data((unsigned int)eap_type_tls),
|
||||
@@ -1118,7 +1274,7 @@ void eap::method_tls::process_handshake(_In_bytecount_(msg_size) const void *_ms
|
||||
seed.insert(seed.end(), hash_data.begin(), hash_data.end());
|
||||
}
|
||||
|
||||
if (memcmp(prf(m_cp_enc_server, m_alg_prf, m_master_secret, seed, 12).data(), rec, 12))
|
||||
if (memcmp(prf(m_cp, m_alg_prf, m_master_secret, seed, 12).data(), rec, 12))
|
||||
throw win_runtime_error(ERROR_ENCRYPTION_FAILED, __FUNCTION__ " Integrity check failed.");
|
||||
|
||||
m_module.log_event(&EAPMETHOD_TLS_FINISHED, event_data((unsigned int)eap_type_tls), event_data::blank);
|
||||
@@ -1143,28 +1299,189 @@ void eap::method_tls::process_handshake(_In_bytecount_(msg_size) const void *_ms
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void eap::method_tls::process_application_data(_In_bytecount_(msg_size) const void *msg, _In_ size_t msg_size)
|
||||
void eap::method_tls::process_handshake()
|
||||
{
|
||||
// Prepare input buffer(s).
|
||||
SecBuffer buf_in[] = {
|
||||
{
|
||||
(unsigned long)m_sc_queue.size(),
|
||||
SECBUFFER_TOKEN,
|
||||
m_sc_queue.data()
|
||||
},
|
||||
{ 0, SECBUFFER_EMPTY, NULL },
|
||||
};
|
||||
SecBufferDesc buf_in_desc = {
|
||||
SECBUFFER_VERSION,
|
||||
_countof(buf_in),
|
||||
buf_in
|
||||
};
|
||||
|
||||
// Prepare output buffer(s).
|
||||
SecBuffer buf_out[] = {
|
||||
{ 0, SECBUFFER_TOKEN, NULL },
|
||||
{ 0, SECBUFFER_ALERT, NULL },
|
||||
};
|
||||
sec_buffer_desc buf_out_desc(buf_out, _countof(buf_out));
|
||||
|
||||
SECURITY_STATUS status;
|
||||
if (m_phase == phase_handshake_init) {
|
||||
status = m_sc_ctx.initialize(
|
||||
m_sc_cred,
|
||||
!m_sc_target_name.empty() ? m_sc_target_name.c_str() : NULL,
|
||||
ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY | ISC_REQ_STREAM | /*ISC_REQ_USE_SUPPLIED_CREDS |*/ ISC_REQ_EXTENDED_ERROR | ISC_REQ_ALLOCATE_MEMORY,
|
||||
0,
|
||||
&buf_in_desc,
|
||||
&buf_out_desc);
|
||||
} else {
|
||||
status = m_sc_ctx.process(
|
||||
m_sc_cred,
|
||||
!m_sc_target_name.empty() ? m_sc_target_name.c_str() : NULL,
|
||||
ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY | ISC_REQ_STREAM | /*ISC_REQ_USE_SUPPLIED_CREDS |*/ ISC_REQ_EXTENDED_ERROR | ISC_REQ_ALLOCATE_MEMORY,
|
||||
0,
|
||||
&buf_in_desc,
|
||||
&buf_out_desc);
|
||||
}
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL_FULL
|
||||
if (status == SEC_E_OK)
|
||||
verify_server_trust();
|
||||
#endif
|
||||
|
||||
if (status == SEC_E_OK || status == SEC_I_CONTINUE_NEEDED) {
|
||||
// Send Schannel's token via EAP.
|
||||
assert(buf_out[0].BufferType == SECBUFFER_TOKEN);
|
||||
assert(m_sc_ctx.m_attrib & ISC_RET_ALLOCATED_MEMORY);
|
||||
m_packet_res.m_data.assign((const unsigned char*)buf_out[0].pvBuffer, (const unsigned char*)buf_out[0].pvBuffer + buf_out[0].cbBuffer);
|
||||
if (buf_in[1].BufferType == SECBUFFER_EXTRA) {
|
||||
// Server appended extra data.
|
||||
m_sc_queue.erase(m_sc_queue.begin(), m_sc_queue.end() - buf_in[1].cbBuffer);
|
||||
} else
|
||||
m_sc_queue.clear();
|
||||
|
||||
if (status == SEC_E_OK) {
|
||||
SecPkgContext_Authority auth;
|
||||
if (FAILED(status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_AUTHORITY, &auth))) {
|
||||
m_module.log_event(&EAPMETHOD_TLS_QUERY_FAILED, event_data((unsigned int)SECPKG_ATTR_AUTHORITY), event_data(status), event_data::blank);
|
||||
auth.sAuthorityName = _T("");
|
||||
}
|
||||
|
||||
SecPkgContext_ConnectionInfo info;
|
||||
if (SUCCEEDED(status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_CONNECTION_INFO, &info)))
|
||||
m_module.log_event(&EAPMETHOD_TLS_HANDSHAKE_FINISHED,
|
||||
event_data((unsigned int)eap_type_tls),
|
||||
event_data(auth.sAuthorityName),
|
||||
event_data(info.dwProtocol),
|
||||
event_data(info.aiCipher),
|
||||
event_data(info.dwCipherStrength),
|
||||
event_data(info.aiHash),
|
||||
event_data(info.dwHashStrength),
|
||||
event_data(info.aiExch),
|
||||
event_data(info.dwExchStrength),
|
||||
event_data::blank);
|
||||
else
|
||||
m_module.log_event(&EAPMETHOD_TLS_QUERY_FAILED, event_data((unsigned int)SECPKG_ATTR_CONNECTION_INFO), event_data(status), event_data::blank);
|
||||
|
||||
m_phase = phase_application_data;
|
||||
process_application_data(m_sc_queue.data(), m_sc_queue.size());
|
||||
} else
|
||||
m_phase = phase_handshake_cont;
|
||||
} else if (status == SEC_E_INCOMPLETE_MESSAGE) {
|
||||
// Schannel neeeds more data. Send ACK packet to server to send more.
|
||||
} else if (FAILED(status)) {
|
||||
if (m_sc_ctx.m_attrib & ISC_RET_EXTENDED_ERROR) {
|
||||
// Send alert via EAP. Not that EAP will transmit it once we throw this is an error...
|
||||
assert(buf_out[1].BufferType == SECBUFFER_ALERT);
|
||||
assert(m_sc_ctx.m_attrib & ISC_RET_ALLOCATED_MEMORY);
|
||||
m_packet_res.m_data.assign((const unsigned char*)buf_out[1].pvBuffer, (const unsigned char*)buf_out[1].pvBuffer + buf_out[1].cbBuffer);
|
||||
}
|
||||
|
||||
throw sec_runtime_error(status, __FUNCTION__ " Schannel error.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void eap::method_tls::process_application_data()
|
||||
{
|
||||
if (m_sc_queue.empty()) {
|
||||
// An ACK packet received. Nothing to unencrypt.
|
||||
process_application_data(NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(m_sc_ctx.m_attrib & ISC_RET_CONFIDENTIALITY))
|
||||
throw runtime_error(__FUNCTION__ " Connection is not encrypted.");
|
||||
|
||||
// Prepare input/output buffer(s).
|
||||
SecBuffer buf[] = {
|
||||
{ 0, SECBUFFER_TOKEN, NULL },
|
||||
{ 0, SECBUFFER_ALERT, NULL },
|
||||
{
|
||||
(unsigned long)m_sc_queue.size(),
|
||||
SECBUFFER_DATA,
|
||||
m_sc_queue.data()
|
||||
},
|
||||
};
|
||||
SecBufferDesc buf_desc = {
|
||||
SECBUFFER_VERSION,
|
||||
_countof(buf),
|
||||
buf
|
||||
};
|
||||
|
||||
// Decrypt the message.
|
||||
SECURITY_STATUS status = DecryptMessage(m_sc_ctx, &buf_desc, 0, NULL);
|
||||
if (status == SEC_E_OK) {
|
||||
assert(buf[2].BufferType == SECBUFFER_DATA);
|
||||
process_application_data(buf[2].pvBuffer, buf[2].cbBuffer);
|
||||
} else if (status == SEC_E_INCOMPLETE_MESSAGE) {
|
||||
// Schannel neeeds more data. Send ACK packet to server to send more.
|
||||
} else if (status == SEC_I_CONTEXT_EXPIRED) {
|
||||
// Server initiated connection shutdown.
|
||||
m_sc_queue.clear();
|
||||
m_phase = phase_shutdown;
|
||||
} else if (status == SEC_I_RENEGOTIATE) {
|
||||
// Re-negotiation required.
|
||||
m_sc_queue.clear();
|
||||
m_phase = phase_handshake_init;
|
||||
process_handshake();
|
||||
} else if (FAILED(status)) {
|
||||
if (m_sc_ctx.m_attrib & ISC_RET_EXTENDED_ERROR) {
|
||||
// Send alert via EAP. Not that EAP will transmit it once we throw this is an error...
|
||||
assert(buf[1].BufferType == SECBUFFER_ALERT);
|
||||
assert(m_sc_ctx.m_attrib & ISC_RET_ALLOCATED_MEMORY);
|
||||
m_packet_res.m_data.assign((const unsigned char*)buf[1].pvBuffer, (const unsigned char*)buf[1].pvBuffer + buf[1].cbBuffer);
|
||||
}
|
||||
|
||||
throw sec_runtime_error(status, __FUNCTION__ " Schannel error.");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void eap::method_tls::process_application_data(_In_bytecount_(size_msg) const void *msg, _In_ size_t size_msg)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(msg);
|
||||
UNREFERENCED_PARAMETER(msg_size);
|
||||
UNREFERENCED_PARAMETER(size_msg);
|
||||
|
||||
// TODO: Parse application data (Diameter AVP)
|
||||
}
|
||||
|
||||
|
||||
//void eap::method_tls::process_vendor_data(_In_ tls_message_type_t type, _In_bytecount_(msg_size) const void *msg, _In_ size_t msg_size)
|
||||
//{
|
||||
// UNREFERENCED_PARAMETER(type);
|
||||
// UNREFERENCED_PARAMETER(msg);
|
||||
// UNREFERENCED_PARAMETER(msg_size);
|
||||
//}
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL_FULL
|
||||
|
||||
void eap::method_tls::verify_server_trust() const
|
||||
{
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
assert(!m_server_cert_chain.empty());
|
||||
const cert_context &cert = m_server_cert_chain.front();
|
||||
#else
|
||||
cert_context cert;
|
||||
SECURITY_STATUS status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (PVOID)&cert);
|
||||
if (FAILED(status))
|
||||
throw sec_runtime_error(status, __FUNCTION__ " Error retrieving server certificate from Schannel.");
|
||||
#endif
|
||||
|
||||
const config_provider &cfg_prov(m_cfg.m_providers.front());
|
||||
const config_method_tls *cfg_method = dynamic_cast<const config_method_tls*>(cfg_prov.m_methods.front().get());
|
||||
@@ -1189,7 +1506,7 @@ void eap::method_tls::verify_server_trust() const
|
||||
CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_ENABLE_PUNYCODE_FLAG,
|
||||
NULL,
|
||||
&output, &size_output))
|
||||
throw win_runtime_error(__FUNCTION__ " Error decoding certificate extension.");
|
||||
throw win_runtime_error(__FUNCTION__ " Error decoding subjectAltName2 certificate extension.");
|
||||
san_info.reset((CERT_ALT_NAME_INFO*)output);
|
||||
} else if (strcmp(cert->pCertInfo->rgExtension[i].pszObjId, szOID_SUBJECT_ALT_NAME) == 0) {
|
||||
unsigned char *output = NULL;
|
||||
@@ -1201,7 +1518,7 @@ void eap::method_tls::verify_server_trust() const
|
||||
CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_ENABLE_PUNYCODE_FLAG,
|
||||
NULL,
|
||||
&output, &size_output))
|
||||
throw win_runtime_error(__FUNCTION__ " Error decoding certificate extension.");
|
||||
throw win_runtime_error(__FUNCTION__ " Error decoding subjectAltName certificate extension.");
|
||||
san_info.reset((CERT_ALT_NAME_INFO*)output);
|
||||
} else {
|
||||
// Skip this extension.
|
||||
@@ -1236,21 +1553,22 @@ void eap::method_tls::verify_server_trust() const
|
||||
}
|
||||
|
||||
if (!found)
|
||||
throw win_runtime_error(ERROR_INVALID_DOMAINNAME, __FUNCTION__ " Server name is not on the list of trusted server names.");
|
||||
throw sec_runtime_error(SEC_E_WRONG_PRINCIPAL, __FUNCTION__ " Name provided in server certificate is not on the list of trusted server names.");
|
||||
}
|
||||
|
||||
if (cert->pCertInfo->Issuer.cbData == cert->pCertInfo->Subject.cbData &&
|
||||
memcmp(cert->pCertInfo->Issuer.pbData, cert->pCertInfo->Subject.pbData, cert->pCertInfo->Issuer.cbData) == 0)
|
||||
throw com_runtime_error(CRYPT_E_SELF_SIGNED, __FUNCTION__ " Server is using a self-signed certificate. Cannot trust it.");
|
||||
throw sec_runtime_error(SEC_E_CERT_UNKNOWN, __FUNCTION__ " Server is using a self-signed certificate. Cannot trust it.");
|
||||
|
||||
// Create temporary certificate store of our trusted root CAs.
|
||||
cert_store store;
|
||||
if (!store.create(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, NULL, 0, NULL))
|
||||
throw win_runtime_error(ERROR_INVALID_DOMAINNAME, __FUNCTION__ " Error creating temporary certificate store.");
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating temporary certificate store.");
|
||||
for (list<cert_context>::const_iterator c = cfg_method->m_trusted_root_ca.cbegin(), c_end = cfg_method->m_trusted_root_ca.cend(); c != c_end; ++c)
|
||||
CertAddCertificateContextToStore(store, *c, CERT_STORE_ADD_REPLACE_EXISTING, NULL);
|
||||
|
||||
// Add all intermediate certificates from the server's certificate chain.
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
for (list<cert_context>::const_iterator c = m_server_cert_chain.cbegin(), c_end = m_server_cert_chain.cend(); ++c != c_end;) {
|
||||
const cert_context &_c = *c;
|
||||
if (_c->pCertInfo->Issuer.cbData == _c->pCertInfo->Subject.cbData &&
|
||||
@@ -1262,6 +1580,22 @@ void eap::method_tls::verify_server_trust() const
|
||||
|
||||
CertAddCertificateContextToStore(store, *c, CERT_STORE_ADD_REPLACE_EXISTING, NULL);
|
||||
}
|
||||
#else
|
||||
for (cert_context c(cert); c;) {
|
||||
DWORD flags = 0;
|
||||
c.attach(CertGetIssuerCertificateFromStore(cert->hCertStore, c, NULL, &flags));
|
||||
if (!c) break;
|
||||
|
||||
if (c->pCertInfo->Issuer.cbData == c->pCertInfo->Subject.cbData &&
|
||||
memcmp(c->pCertInfo->Issuer.pbData, c->pCertInfo->Subject.pbData, c->pCertInfo->Issuer.cbData) == 0)
|
||||
{
|
||||
// Skip the root CA certificates (self-signed). We define in whom we trust!
|
||||
continue;
|
||||
}
|
||||
|
||||
CertAddCertificateContextToStore(store, c, CERT_STORE_ADD_REPLACE_EXISTING, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Prepare the certificate chain validation, and check.
|
||||
CERT_CHAIN_PARA chain_params = {
|
||||
@@ -1285,15 +1619,21 @@ void eap::method_tls::verify_server_trust() const
|
||||
|
||||
// Check chain validation error flags. Ignore CERT_TRUST_IS_UNTRUSTED_ROOT flag since we check root CA explicitly.
|
||||
if (context->TrustStatus.dwErrorStatus != CERT_TRUST_NO_ERROR &&
|
||||
(cfg_method->m_trusted_root_ca.empty() || (context->TrustStatus.dwErrorStatus & ~CERT_TRUST_IS_UNTRUSTED_ROOT) != CERT_TRUST_NO_ERROR))
|
||||
throw win_runtime_error(context->TrustStatus.dwErrorStatus, "Error validating certificate chain.");
|
||||
(context->TrustStatus.dwErrorStatus & ~CERT_TRUST_IS_UNTRUSTED_ROOT) != CERT_TRUST_NO_ERROR)
|
||||
{
|
||||
if (context->TrustStatus.dwErrorStatus & (CERT_TRUST_IS_NOT_TIME_VALID | CERT_TRUST_IS_NOT_TIME_NESTED))
|
||||
throw sec_runtime_error(SEC_E_CERT_EXPIRED, __FUNCTION__ " Server certificate has expired (or is not valid yet).");
|
||||
else if (context->TrustStatus.dwErrorStatus & (CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_PARTIAL_CHAIN))
|
||||
throw sec_runtime_error(SEC_E_UNTRUSTED_ROOT, __FUNCTION__ " Server's certificate not issued by one of configured trusted root CAs.");
|
||||
else
|
||||
throw sec_runtime_error(SEC_E_CERT_UNKNOWN, __FUNCTION__ " Error validating server certificate.");
|
||||
}
|
||||
|
||||
if (!cfg_method->m_trusted_root_ca.empty()) {
|
||||
// Verify Root CA against our trusted root CA list
|
||||
if (context->cChain != 1)
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Multiple chain verification not supported.");
|
||||
throw sec_runtime_error(SEC_E_CERT_UNKNOWN, __FUNCTION__ " Multiple chain verification not supported.");
|
||||
if (context->rgpChain[0]->cElement == 0)
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Can not verify empty certificate chain.");
|
||||
throw sec_runtime_error(SEC_E_CERT_UNKNOWN, __FUNCTION__ " Can not verify empty certificate chain.");
|
||||
|
||||
PCCERT_CONTEXT cert_root = context->rgpChain[0]->rgpElement[context->rgpChain[0]->cElement-1]->pCertContext;
|
||||
for (list<cert_context>::const_iterator c = cfg_method->m_trusted_root_ca.cbegin(), c_end = cfg_method->m_trusted_root_ca.cend();; ++c) {
|
||||
@@ -1306,20 +1646,22 @@ void eap::method_tls::verify_server_trust() const
|
||||
}
|
||||
} else {
|
||||
// Not found.
|
||||
throw win_runtime_error(ERROR_FILE_NOT_FOUND, __FUNCTION__ " Server's certificate not issued by one of configured trusted root CAs.");
|
||||
}
|
||||
throw sec_runtime_error(SEC_E_UNTRUSTED_ROOT, __FUNCTION__ " Server's certificate not issued by one of configured trusted root CAs.");
|
||||
}
|
||||
}
|
||||
|
||||
m_module.log_event(&EAPMETHOD_TLS_SERVER_CERT_TRUSTED, event_data::blank);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
void eap::method_tls::encrypt_message(_In_ tls_message_type_t type, _Inout_ sanitizing_blob &data)
|
||||
{
|
||||
// Hash sequence number, TLS header, and message.
|
||||
size_t size_data = data.size();
|
||||
hmac_hash hash(m_cp_enc_client, m_state_client.m_alg_mac, m_state_client.m_padding_hmac);
|
||||
hmac_hash hash(m_cp, m_state_client.m_alg_mac, m_state_client.m_padding_hmac);
|
||||
unsigned __int64 seq_num2 = htonll(m_seq_num_client);
|
||||
unsigned short size_data2 = htons((unsigned short)size_data);
|
||||
if (!CryptHashData(hash, (const BYTE*)&seq_num2 , sizeof(seq_num2 ), 0) ||
|
||||
@@ -1341,7 +1683,7 @@ void eap::method_tls::encrypt_message(_In_ tls_message_type_t type, _Inout_ sani
|
||||
if (m_tls_version >= tls_version_1_1) {
|
||||
// TLS 1.1+: Set random IV.
|
||||
data.insert(data.begin(), m_state_client.m_size_enc_iv, 0);
|
||||
if (!CryptGenRandom(m_cp_enc_client, (DWORD)m_state_client.m_size_enc_iv, data.data()))
|
||||
if (!CryptGenRandom(m_cp, (DWORD)m_state_client.m_size_enc_iv, data.data()))
|
||||
throw win_runtime_error(__FUNCTION__ " Error generating IV.");
|
||||
size_data_enc += m_state_client.m_size_enc_iv;
|
||||
}
|
||||
@@ -1406,7 +1748,7 @@ void eap::method_tls::decrypt_message(_In_ tls_message_type_t type, _Inout_ sani
|
||||
size_data -= m_state_server.m_size_mac_hash;
|
||||
|
||||
// Hash sequence number, TLS header (without length), original message length, and message.
|
||||
hmac_hash hash(m_cp_enc_server, m_state_server.m_alg_mac, m_state_server.m_padding_hmac);
|
||||
hmac_hash hash(m_cp, m_state_server.m_alg_mac, m_state_server.m_padding_hmac);
|
||||
unsigned __int64 seq_num2 = htonll(m_seq_num_server);
|
||||
unsigned short size_data2 = htons((unsigned short)size_data);
|
||||
if (!CryptHashData(hash, (const BYTE*)&seq_num2 , sizeof(seq_num2 ), 0) ||
|
||||
@@ -1637,3 +1979,5 @@ HCRYPTKEY eap::method_tls::create_key(
|
||||
return key_out.detach();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <WinStd/EAP.h>
|
||||
|
||||
#include <EapHostError.h>
|
||||
#include <schnlsp.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
@@ -182,6 +182,8 @@ eap::tls_conn_state::tls_conn_state()
|
||||
#ifdef _DEBUG
|
||||
// Initialize state primitive members for diagnostic purposes.
|
||||
:
|
||||
m_prov_name (NULL),
|
||||
m_prov_type (0),
|
||||
m_alg_encrypt (0),
|
||||
m_size_enc_key (0),
|
||||
m_size_enc_iv (0),
|
||||
@@ -195,6 +197,8 @@ eap::tls_conn_state::tls_conn_state()
|
||||
|
||||
|
||||
eap::tls_conn_state::tls_conn_state(_In_ const tls_conn_state &other) :
|
||||
m_prov_name (other.m_prov_name ),
|
||||
m_prov_type (other.m_prov_type ),
|
||||
m_alg_encrypt (other.m_alg_encrypt ),
|
||||
m_size_enc_key (other.m_size_enc_key ),
|
||||
m_size_enc_iv (other.m_size_enc_iv ),
|
||||
@@ -209,6 +213,8 @@ eap::tls_conn_state::tls_conn_state(_In_ const tls_conn_state &other) :
|
||||
|
||||
|
||||
eap::tls_conn_state::tls_conn_state(_Inout_ tls_conn_state &&other) :
|
||||
m_prov_name (std::move(other.m_prov_name )),
|
||||
m_prov_type (std::move(other.m_prov_type )),
|
||||
m_alg_encrypt (std::move(other.m_alg_encrypt )),
|
||||
m_size_enc_key (std::move(other.m_size_enc_key )),
|
||||
m_size_enc_iv (std::move(other.m_size_enc_iv )),
|
||||
@@ -221,6 +227,8 @@ eap::tls_conn_state::tls_conn_state(_Inout_ tls_conn_state &&other) :
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
// Reinitialize other state primitive members for diagnostic purposes.
|
||||
other.m_prov_name = NULL;
|
||||
other.m_prov_type = 0;
|
||||
other.m_alg_encrypt = 0;
|
||||
other.m_size_enc_key = 0;
|
||||
other.m_size_enc_iv = 0;
|
||||
@@ -235,6 +243,8 @@ eap::tls_conn_state::tls_conn_state(_Inout_ tls_conn_state &&other) :
|
||||
eap::tls_conn_state& eap::tls_conn_state::operator=(_In_ const tls_conn_state &other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
m_prov_name = other.m_prov_name ;
|
||||
m_prov_type = other.m_prov_type ;
|
||||
m_alg_encrypt = other.m_alg_encrypt ;
|
||||
m_size_enc_key = other.m_size_enc_key ;
|
||||
m_size_enc_iv = other.m_size_enc_iv ;
|
||||
@@ -253,6 +263,8 @@ eap::tls_conn_state& eap::tls_conn_state::operator=(_In_ const tls_conn_state &o
|
||||
eap::tls_conn_state& eap::tls_conn_state::operator=(_Inout_ tls_conn_state &&other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
m_prov_name = std::move(other.m_prov_name );
|
||||
m_prov_type = std::move(other.m_prov_type );
|
||||
m_alg_encrypt = std::move(other.m_alg_encrypt );
|
||||
m_size_enc_key = std::move(other.m_size_enc_key );
|
||||
m_size_enc_iv = std::move(other.m_size_enc_iv );
|
||||
@@ -265,6 +277,8 @@ eap::tls_conn_state& eap::tls_conn_state::operator=(_Inout_ tls_conn_state &&oth
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Reinitialize other state primitive members for diagnostic purposes.
|
||||
other.m_prov_name = NULL;
|
||||
other.m_prov_type = 0;
|
||||
other.m_alg_encrypt = 0;
|
||||
other.m_size_enc_key = 0;
|
||||
other.m_size_enc_iv = 0;
|
||||
@@ -277,3 +291,142 @@ eap::tls_conn_state& eap::tls_conn_state::operator=(_Inout_ tls_conn_state &&oth
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::tls_conn_state::set_cipher(_In_ const unsigned char cipher[2])
|
||||
{
|
||||
if (cipher[0] == 0x00 && cipher[1] == 0x0a) {
|
||||
// TLS_RSA_WITH_3DES_EDE_CBC_SHA
|
||||
m_prov_name = NULL;
|
||||
m_prov_type = PROV_RSA_AES;
|
||||
m_alg_encrypt = CALG_3DES;
|
||||
m_size_enc_key = 192/8; // 3DES 192bits
|
||||
m_size_enc_iv = 64/8; // 3DES 64bits
|
||||
m_size_enc_block = 64/8; // 3DES 64bits
|
||||
m_alg_mac = CALG_SHA1;
|
||||
m_size_mac_key = 160/8; // SHA-1
|
||||
m_size_mac_hash = 160/8; // SHA-1
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x2f) {
|
||||
// TLS_RSA_WITH_AES_128_CBC_SHA
|
||||
m_prov_name = NULL;
|
||||
m_prov_type = PROV_RSA_AES;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA1;
|
||||
m_size_mac_key = 160/8; // SHA-1
|
||||
m_size_mac_hash = 160/8; // SHA-1
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x3c) {
|
||||
// AES128-SHA256
|
||||
m_prov_name = NULL;
|
||||
m_prov_type = PROV_RSA_AES;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x3d) {
|
||||
// AES256-SHA256
|
||||
m_prov_name = MS_ENH_RSA_AES_PROV;
|
||||
m_prov_type = PROV_RSA_AES;
|
||||
m_alg_encrypt = CALG_AES_256;
|
||||
m_size_enc_key = 256/8; // AES-256
|
||||
m_size_enc_iv = 128/8; // AES-256
|
||||
m_size_enc_block = 128/8; // AES-256
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x40) {
|
||||
// DHE-DSS-AES128-SHA256
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x67) {
|
||||
// DHE-RSA-AES128-SHA256
|
||||
m_prov_name = MS_DEF_DH_SCHANNEL_PROV;
|
||||
m_prov_type = PROV_DH_SCHANNEL;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x6a) {
|
||||
// DHE-DSS-AES256-SHA256
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_256;
|
||||
m_size_enc_key = 256/8; // AES-256
|
||||
m_size_enc_iv = 128/8; // AES-256
|
||||
m_size_enc_block = 128/8; // AES-256
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0x00 && cipher[1] == 0x6b) {
|
||||
// DHE-RSA-AES256-SHA256
|
||||
m_prov_name = MS_DEF_DH_SCHANNEL_PROV;
|
||||
m_prov_type = PROV_DH_SCHANNEL;
|
||||
m_alg_encrypt = CALG_AES_256;
|
||||
m_size_enc_key = 256/8; // AES-256
|
||||
m_size_enc_iv = 128/8; // AES-256
|
||||
m_size_enc_block = 128/8; // AES-256
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0xc0 && cipher[1] == 0x23) {
|
||||
// ECDHE-ECDSA-AES128-SHA256
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0xc0 && cipher[1] == 0x24) {
|
||||
// ECDHE-ECDSA-AES256-SHA384
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_256;
|
||||
m_size_enc_key = 256/8; // AES-256
|
||||
m_size_enc_iv = 128/8; // AES-256
|
||||
m_size_enc_block = 128/8; // AES-256
|
||||
m_alg_mac = CALG_SHA_384;
|
||||
m_size_mac_key = 384/8; // SHA-384
|
||||
m_size_mac_hash = 384/8; // SHA-384
|
||||
} else if (cipher[0] == 0xc0 && cipher[1] == 0x27) {
|
||||
// ECDHE-RSA-AES128-SHA256
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_128;
|
||||
m_size_enc_key = 128/8; // AES-128
|
||||
m_size_enc_iv = 128/8; // AES-128
|
||||
m_size_enc_block = 128/8; // AES-128
|
||||
m_alg_mac = CALG_SHA_256;
|
||||
m_size_mac_key = 256/8; // SHA-256
|
||||
m_size_mac_hash = 256/8; // SHA-256
|
||||
} else if (cipher[0] == 0xc0 && cipher[1] == 0x28) {
|
||||
// ECDHE-RSA-AES256-SHA384
|
||||
m_prov_name = MS_ENH_DSS_DH_PROV;
|
||||
m_prov_type = PROV_DSS_DH;
|
||||
m_alg_encrypt = CALG_AES_256;
|
||||
m_size_enc_key = 256/8; // AES-256
|
||||
m_size_enc_iv = 128/8; // AES-256
|
||||
m_size_enc_block = 128/8; // AES-256
|
||||
m_alg_mac = CALG_SHA_384;
|
||||
m_size_mac_key = 384/8; // SHA-384
|
||||
m_size_mac_hash = 384/8; // SHA-384
|
||||
} else
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, string_printf(__FUNCTION__ " Unknown cipher (received 0x%02x%02x).", cipher[0], cipher[1]));
|
||||
}
|
||||
|
@@ -269,10 +269,6 @@ protected:
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event);
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
@@ -309,8 +305,6 @@ protected:
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_method_tls &m_cfg; ///< TLS configuration
|
||||
winstd::library m_certmgr; ///< certmgr.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
std::list<std::wstring> m_server_names_val; ///< Acceptable authenticating server names
|
||||
};
|
||||
|
||||
@@ -331,7 +325,9 @@ public:
|
||||
protected:
|
||||
/// \cond internal
|
||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
virtual bool TransferDataFromWindow();
|
||||
#endif
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
|
@@ -161,6 +161,25 @@ wxTLSCredentialsPanelBase::wxTLSCredentialsPanelBase( wxWindow* parent, wxWindow
|
||||
|
||||
sb_credentials_vert->Add( sb_cert_radio, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* sb_identity;
|
||||
sb_identity = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_identity_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Custom &identity:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_identity_label->Wrap( -1 );
|
||||
sb_identity->Add( m_identity_label, 0, wxBOTTOM, 5 );
|
||||
|
||||
m_identity = new wxTextCtrl( sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_identity->SetToolTip( _("Your identity (username@domain) to override one from certificate; or blank to use one provided in certificate") );
|
||||
|
||||
sb_identity->Add( m_identity, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_identity_note = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("(Example: user@contoso.com)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_identity_note->Wrap( -1 );
|
||||
sb_identity->Add( m_identity_note, 0, wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
sb_credentials_vert->Add( sb_identity, 1, 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 certificate selection") );
|
||||
|
||||
|
@@ -1527,6 +1527,274 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">sb_identity</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Custom &identity:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_identity_label</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_identity</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Your identity (username@domain) to override one from certificate; or blank to use one provided in certificate</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">(Example: user@contoso.com)</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_identity_note</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
|
@@ -80,6 +80,9 @@ class wxTLSCredentialsPanelBase : public wxPanel
|
||||
wxRadioButton* m_cert_none;
|
||||
wxRadioButton* m_cert_select;
|
||||
wxChoice* m_cert_select_val;
|
||||
wxStaticText* m_identity_label;
|
||||
wxTextCtrl* m_identity;
|
||||
wxStaticText* m_identity_note;
|
||||
wxCheckBox* m_remember;
|
||||
|
||||
public:
|
||||
|
@@ -315,8 +315,9 @@ wxTLSCredentialsPanel::wxTLSCredentialsPanel(const eap::config_provider &prov, c
|
||||
wxEAPCredentialsPanelBase<eap::credentials_tls, wxTLSCredentialsPanelBase>(prov, cfg, 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));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_credentials_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(269)));
|
||||
}
|
||||
|
||||
|
||||
@@ -358,6 +359,8 @@ bool wxTLSCredentialsPanel::TransferDataToWindow()
|
||||
m_cert_select_val->SetSelection(0);
|
||||
}
|
||||
|
||||
m_identity->SetValue(m_cred.m_identity);
|
||||
|
||||
return wxEAPCredentialsPanelBase<eap::credentials_tls, wxTLSCredentialsPanelBase>::TransferDataToWindow();
|
||||
}
|
||||
|
||||
@@ -374,6 +377,8 @@ bool wxTLSCredentialsPanel::TransferDataFromWindow()
|
||||
m_cred.m_cert.free();
|
||||
}
|
||||
|
||||
m_cred.m_identity = m_identity->GetValue();
|
||||
|
||||
// Inherited TransferDataFromWindow() calls m_cred.store().
|
||||
// Therefore, call it only now, that m_cred is set.
|
||||
return wxEAPCredentialsPanelBase<eap::credentials_tls, wxTLSCredentialsPanelBase>::TransferDataFromWindow();
|
||||
@@ -393,9 +398,11 @@ void wxTLSCredentialsPanel::OnUpdateUI(wxUpdateUIEvent& event)
|
||||
m_cert_select->Enable(false);
|
||||
}
|
||||
m_cert_select_val->Enable(false);
|
||||
m_identity->Enable(false);
|
||||
} else {
|
||||
// Configuration mode or using own credentials. Selectively enable/disable controls.
|
||||
m_cert_select_val->Enable(m_cert_select->GetValue());
|
||||
m_identity->Enable(true);
|
||||
}
|
||||
|
||||
wxEAPCredentialsPanelBase<eap::credentials_tls, wxTLSCredentialsPanelBase>::OnUpdateUI(event);
|
||||
@@ -412,8 +419,9 @@ wxTLSServerTrustPanel::wxTLSServerTrustPanel(const eap::config_provider &prov, e
|
||||
wxEAPTLSServerTrustConfigPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
if (m_certmgr.load(_T("certmgr.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
wxSetIconFromResource(m_server_trust_icon, m_icon, m_certmgr, MAKEINTRESOURCE(218));
|
||||
winstd::library lib_certmgr;
|
||||
if (lib_certmgr.load(_T("certmgr.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_server_trust_icon->SetIcon(wxLoadIconFromResource(lib_certmgr, MAKEINTRESOURCE(218)));
|
||||
|
||||
// Do not use cfg.m_server_names directly, so we can decide not to store the value in case of provider-locked configuration.
|
||||
// Never rely on control disabled state alone, as they can be enabled using external tool like Spy++.
|
||||
@@ -605,6 +613,8 @@ void wxTLSConfigPanel::OnInitDialog(wxInitDialogEvent& event)
|
||||
}
|
||||
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
bool wxTLSConfigPanel::TransferDataFromWindow()
|
||||
{
|
||||
wxCHECK(wxPanel::TransferDataFromWindow(), false);
|
||||
@@ -620,4 +630,4 @@ bool wxTLSConfigPanel::TransferDataFromWindow()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -58,10 +58,10 @@ namespace eap
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Providers configuration
|
||||
/// \param[in] cfg Connection configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method_ttls(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials_ttls &cred);
|
||||
method_ttls(_In_ module &module, _In_ config_connection &cfg, _In_ credentials_ttls &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
@@ -83,7 +83,7 @@ namespace eap
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
@@ -112,6 +112,9 @@ namespace eap
|
||||
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
///
|
||||
/// Generates master session key
|
||||
///
|
||||
@@ -119,7 +122,18 @@ namespace eap
|
||||
///
|
||||
virtual void derive_msk();
|
||||
|
||||
protected:
|
||||
#else
|
||||
|
||||
///
|
||||
/// Processes an application message
|
||||
///
|
||||
/// \param[in] msg Application message data
|
||||
/// \param[in] size_msg Application message data size
|
||||
///
|
||||
virtual void process_application_data(_In_bytecount_(size_msg) const void *msg, _In_ size_t size_msg);
|
||||
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Makes a PAP client message
|
||||
///
|
||||
|
@@ -49,7 +49,7 @@ namespace eap
|
||||
virtual config_method* make_config_method();
|
||||
|
||||
///
|
||||
/// Initializes an EAP peer method for EAPHost.
|
||||
/// Initializes an EAP peer method for EapHost.
|
||||
///
|
||||
/// \sa [EapPeerGetInfo function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363613.aspx)
|
||||
///
|
||||
@@ -63,7 +63,7 @@ namespace eap
|
||||
virtual void shutdown();
|
||||
|
||||
///
|
||||
/// Returns the user data and user identity after being called by EAPHost.
|
||||
/// 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)
|
||||
///
|
||||
@@ -111,7 +111,7 @@ namespace eap
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
||||
/// Starts an EAP authentication session on the peer EapHost using the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
||||
///
|
||||
@@ -135,7 +135,7 @@ namespace eap
|
||||
virtual void end_session(_In_ EAP_SESSION_HANDLE hSession);
|
||||
|
||||
///
|
||||
/// Processes a packet received by EAPHost from a supplicant.
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
@@ -221,7 +221,7 @@ namespace eap
|
||||
{}
|
||||
|
||||
public:
|
||||
config_provider_list m_cfg; ///< Providers configuration
|
||||
config_connection m_cfg; ///< Connection configuration
|
||||
credentials_ttls m_cred; ///< User credentials
|
||||
method_ttls m_method; ///< EAP-TTLS method
|
||||
};
|
||||
|
@@ -189,6 +189,8 @@ void eap::credentials_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
|
||||
void eap::credentials_ttls::store(_In_z_ LPCTSTR pszTargetName) const
|
||||
{
|
||||
assert(0); // Not that we would ever store inner&outer credentials to Windows Credential Manager joined, but for completness sake... Here we go:
|
||||
|
||||
credentials_tls::store(pszTargetName);
|
||||
|
||||
if (m_inner)
|
||||
@@ -198,6 +200,8 @@ void eap::credentials_ttls::store(_In_z_ LPCTSTR pszTargetName) const
|
||||
|
||||
void eap::credentials_ttls::retrieve(_In_z_ LPCTSTR pszTargetName)
|
||||
{
|
||||
assert(0); // Not that we would ever retrieve inner&outer credentials to Windows Credential Manager joined, but for completness sake... Here we go:
|
||||
|
||||
credentials_tls::retrieve(pszTargetName);
|
||||
|
||||
if (m_inner)
|
||||
|
@@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::method_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method_ttls::method_ttls(_In_ module &module, _In_ config_provider_list &cfg, _In_ credentials_ttls &cred) :
|
||||
eap::method_ttls::method_ttls(_In_ module &module, _In_ config_connection &cfg, _In_ credentials_ttls &cred) :
|
||||
m_cred(cred),
|
||||
m_version(version_0),
|
||||
method_tls(module, cfg, cred)
|
||||
@@ -72,6 +72,7 @@ void eap::method_ttls::process_request_packet(
|
||||
// Do the TLS.
|
||||
method_tls::process_request_packet(pReceivedPacket, dwReceivedPacketSize, pEapOutput);
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
if (m_phase == phase_application_data) {
|
||||
// Send inner authentication.
|
||||
if (!m_state_client.m_alg_encrypt)
|
||||
@@ -84,10 +85,8 @@ void eap::method_ttls::process_request_packet(
|
||||
m_packet_res.m_flags = 0;
|
||||
sanitizing_blob msg_application(make_message(tls_message_type_application_data, make_pap_client()));
|
||||
m_packet_res.m_data.insert(m_packet_res.m_data.end(), msg_application.begin(), msg_application.end());
|
||||
|
||||
pEapOutput->fAllowNotifications = FALSE;
|
||||
pEapOutput->action = EapPeerMethodResponseActionSend;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -126,18 +125,30 @@ void eap::method_ttls::get_result(
|
||||
|
||||
case EapPeerMethodResultFailure:
|
||||
m_module.log_event(&EAPMETHOD_TTLS_INNER_FAILURE, event_data((unsigned int)eap_type_ttls), event_data::blank);
|
||||
cfg_method->m_inner->m_auth_failed = true;
|
||||
|
||||
// Mark credentials as failed, so GUI can re-prompt user.
|
||||
// But be careful: do so only if this happened after transition from handshake to application data phase.
|
||||
cfg_method->m_inner->m_auth_failed = m_phase_prev < phase_application_data;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Not supported.");
|
||||
}
|
||||
|
||||
#if EAP_TLS >= EAP_TLS_SCHANNEL
|
||||
// EAP-TTLS uses different label in PRF for MSK derivation than EAP-TLS.
|
||||
static const DWORD s_key_id = 0x01; // EAP-TTLSv0 Keying Material
|
||||
static const SecPkgContext_EapPrfInfo s_prf_info = { 0, sizeof(s_key_id), (PBYTE)&s_key_id };
|
||||
SECURITY_STATUS status = SetContextAttributes(m_sc_ctx, SECPKG_ATTR_EAP_PRF_INFO, (void*)&s_prf_info, sizeof(s_prf_info));
|
||||
if (FAILED(status))
|
||||
throw sec_runtime_error(status, __FUNCTION__ "Error setting EAP-TTLS PRF in Schannel.");
|
||||
#endif
|
||||
|
||||
// The TLS was OK.
|
||||
method_tls::get_result(EapPeerMethodResultSuccess, ppResult);
|
||||
|
||||
// Do not report failure to EAPHost, as it will not save updated configuration then. But we need it to save it, to alert user on next connection attempt.
|
||||
// EAPHost is well aware of the failed condition.
|
||||
// Do not report failure to EapHost, as it will not save updated configuration then. But we need it to save it, to alert user on next connection attempt.
|
||||
// EapHost is well aware of the failed condition.
|
||||
//if (reason == EapPeerMethodResultFailure) {
|
||||
// ppResult->fIsSuccess = FALSE;
|
||||
// ppResult->dwFailureReasonCode = EAP_E_AUTHENTICATION_FAILED;
|
||||
@@ -146,6 +157,8 @@ void eap::method_ttls::get_result(
|
||||
}
|
||||
|
||||
|
||||
#if EAP_TLS < EAP_TLS_SCHANNEL
|
||||
|
||||
void eap::method_ttls::derive_msk()
|
||||
{
|
||||
//
|
||||
@@ -179,6 +192,57 @@ void eap::method_ttls::derive_msk()
|
||||
_key_block += sizeof(tls_random);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void eap::method_ttls::process_application_data(_In_bytecount_(size_msg) const void *msg, _In_ size_t size_msg)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(msg);
|
||||
UNREFERENCED_PARAMETER(size_msg);
|
||||
|
||||
// Prepare inner authentication.
|
||||
if (!(m_sc_ctx.m_attrib & ISC_RET_CONFIDENTIALITY))
|
||||
throw runtime_error(__FUNCTION__ " Refusing to send credentials unencrypted.");
|
||||
|
||||
m_module.log_event(&EAPMETHOD_TTLS_INNER_CRED, event_data((unsigned int)eap_type_ttls), event_data(m_cred.m_inner->get_name()), event_data::blank);
|
||||
|
||||
SECURITY_STATUS status;
|
||||
|
||||
// Get maximum message sizes.
|
||||
SecPkgContext_StreamSizes sizes;
|
||||
status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_STREAM_SIZES, &sizes);
|
||||
if (FAILED(status))
|
||||
throw sec_runtime_error(status, __FUNCTION__ " Error getting Schannel required encryption sizes.");
|
||||
|
||||
// Make PAP message.
|
||||
sanitizing_blob msg_pap(make_pap_client());
|
||||
assert(msg_pap.size() < sizes.cbMaximumMessage);
|
||||
unsigned long size_data = std::min<unsigned long>(sizes.cbMaximumMessage, (unsigned long)msg_pap.size()); // Truncate
|
||||
|
||||
sanitizing_blob data(sizes.cbHeader + size_data + sizes.cbTrailer, 0);
|
||||
memcpy(data.data() + sizes.cbHeader, msg_pap.data(), size_data);
|
||||
|
||||
// Prepare input/output buffer(s).
|
||||
SecBuffer buf[] = {
|
||||
{ sizes.cbHeader, SECBUFFER_STREAM_HEADER , data.data() },
|
||||
{ size_data, SECBUFFER_DATA , data.data() + sizes.cbHeader },
|
||||
{ sizes.cbTrailer, SECBUFFER_STREAM_TRAILER, data.data() + sizes.cbHeader + size_data },
|
||||
{ 0, SECBUFFER_EMPTY , NULL },
|
||||
};
|
||||
SecBufferDesc buf_desc = {
|
||||
SECBUFFER_VERSION,
|
||||
_countof(buf),
|
||||
buf
|
||||
};
|
||||
|
||||
// Encrypt the message.
|
||||
status = EncryptMessage(m_sc_ctx, 0, &buf_desc, 0);
|
||||
if (FAILED(status))
|
||||
throw sec_runtime_error(status, __FUNCTION__ " Error encrypting message.");
|
||||
m_packet_res.m_data.insert(m_packet_res.m_data.end(), (const unsigned char*)buf[0].pvBuffer, (const unsigned char*)buf[0].pvBuffer + buf[0].cbBuffer + buf[1].cbBuffer + buf[2].cbBuffer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
eap::sanitizing_blob eap::method_ttls::make_pap_client() const
|
||||
{
|
||||
|
@@ -74,7 +74,7 @@ void eap::peer_ttls::get_identity(
|
||||
assert(ppwszIdentity);
|
||||
|
||||
// Unpack configuration.
|
||||
config_provider_list cfg(*this);
|
||||
config_connection cfg(*this);
|
||||
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
||||
if (cfg.m_providers.empty() || cfg.m_providers.front().m_methods.empty())
|
||||
throw invalid_argument(__FUNCTION__ " Configuration has no providers and/or methods.");
|
||||
|
@@ -30,3 +30,4 @@
|
||||
#include <WinStd/EAP.h>
|
||||
|
||||
#include <EapHostError.h>
|
||||
#include <schannel.h>
|
||||
|
@@ -68,8 +68,6 @@ protected:
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_method_ttls &m_cfg; ///< TTLS configuration
|
||||
winstd::library m_shell32; ///< shell32.dll resource library reference
|
||||
wxIcon m_icon; ///< Panel icon
|
||||
};
|
||||
|
||||
|
||||
|
@@ -32,7 +32,7 @@ wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, c
|
||||
wxBoxSizer* sb_outer_identity_radio;
|
||||
sb_outer_identity_radio = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_outer_identity_same = new wxRadioButton( sb_outer_identity->GetStaticBox(), wxID_ANY, _("&Same as inner identity"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
||||
m_outer_identity_same = new wxRadioButton( sb_outer_identity->GetStaticBox(), wxID_ANY, _("&True identity"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
||||
m_outer_identity_same->SetToolTip( _("Use my true user name") );
|
||||
|
||||
sb_outer_identity_radio->Add( m_outer_identity_same, 1, wxEXPAND, 5 );
|
||||
|
@@ -309,7 +309,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">&Same as inner identity</property>
|
||||
<property name="label">&True identity</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@@ -48,7 +48,7 @@ void eap::peer_ttls_ui::config_xml2blob(
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
|
||||
// Load configuration from XML.
|
||||
config_provider_list cfg(*this);
|
||||
config_connection cfg(*this);
|
||||
cfg.load(pConfigRoot);
|
||||
|
||||
// Pack configuration.
|
||||
@@ -66,7 +66,7 @@ void eap::peer_ttls_ui::config_blob2xml(
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
|
||||
// Unpack configuration.
|
||||
config_provider_list cfg(*this);
|
||||
config_connection cfg(*this);
|
||||
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
||||
|
||||
// Save configuration to XML.
|
||||
@@ -82,7 +82,7 @@ void eap::peer_ttls_ui::invoke_config_ui(
|
||||
_Inout_ DWORD *pdwConnectionDataOutSize)
|
||||
{
|
||||
// Unpack configuration.
|
||||
config_provider_list cfg(*this);
|
||||
config_connection cfg(*this);
|
||||
if (dwConnectionDataInSize) {
|
||||
// Load existing configuration.
|
||||
unpack(cfg, pConnectionDataIn, dwConnectionDataInSize);
|
||||
@@ -112,7 +112,7 @@ void eap::peer_ttls_ui::invoke_config_ui(
|
||||
{
|
||||
// Create wxWidget-approved parent window.
|
||||
wxWindow parent;
|
||||
parent.SetHWND((WXHWND)hwndParent);
|
||||
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
|
||||
parent.AdoptAttributesFromHWND();
|
||||
wxTopLevelWindows.Append(&parent);
|
||||
|
||||
@@ -148,7 +148,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
assert(ppwszIdentity);
|
||||
|
||||
// Unpack configuration.
|
||||
config_provider_list cfg(*this);
|
||||
config_connection cfg(*this);
|
||||
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
||||
if (cfg.m_providers.empty() || cfg.m_providers.front().m_methods.empty())
|
||||
throw invalid_argument(__FUNCTION__ " Configuration has no providers and/or methods.");
|
||||
@@ -204,7 +204,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
{
|
||||
// Create wxWidget-approved parent window.
|
||||
wxWindow parent;
|
||||
parent.SetHWND((WXHWND)hwndParent);
|
||||
parent.SetHWND((WXHWND)(hwndParent ? hwndParent : GetForegroundWindow()));
|
||||
parent.AdoptAttributesFromHWND();
|
||||
wxTopLevelWindows.Append(&parent);
|
||||
|
||||
|
@@ -31,8 +31,9 @@ wxTTLSConfigPanel::wxTTLSConfigPanel(const eap::config_provider &prov, eap::conf
|
||||
wxTTLSConfigPanelBase(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));
|
||||
winstd::library lib_shell32;
|
||||
if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE))
|
||||
m_outer_identity_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(265)));
|
||||
}
|
||||
|
||||
|
||||
|
Submodule lib/WinStd updated: f94b72379e...92f010b206
Submodule lib/wxExtend updated: d604e81604...6c94ff59be
2
output/Setup/.gitignore
vendored
2
output/Setup/.gitignore
vendored
@@ -1 +1,3 @@
|
||||
/GEANTLink*.msi
|
||||
/CredWrite.exe
|
||||
/MsiUseFeature.exe
|
||||
|
Reference in New Issue
Block a user