Compare commits
85 Commits
1.0-alpha1
...
1.0-alpha1
Author | SHA1 | Date | |
---|---|---|---|
3bdab93f04 | |||
1ae92e80d8 | |||
c9b192932b | |||
cbb35ffaef | |||
4076655e2e | |||
e4e9604297 | |||
8ec9f54f62 | |||
765466f535 | |||
c33c8b551b | |||
4ffccaf6b4 | |||
534f234641 | |||
0095ebbff6 | |||
ac3ff2d3ca | |||
7a3d4e0947 | |||
a8070e9bba | |||
bd7f3f4a38 | |||
621669828b | |||
00aee5bb78 | |||
198b9a576e | |||
0a0a28730b | |||
566785192a | |||
7cddd585b7 | |||
1c5f0b5c81 | |||
6c11b23267 | |||
56e2448f71 | |||
1e60d21860 | |||
0959217ee3 | |||
844b185887 | |||
98bd9f1935 | |||
6b2a71cc63 | |||
4d6ac7db3f | |||
ae66af02a2 | |||
2339b6b347 | |||
171e924dcf | |||
281c3ee083 | |||
145c21682e | |||
0d221d4401 | |||
d9bfcc3e49 | |||
60f1b4ccfb | |||
c9be6f4f7b | |||
452fa4b9dc | |||
68aec5dfb4 | |||
3f49f3e975 | |||
04213715b0 | |||
510bbe10f6 | |||
5dfd079686 | |||
858486412e | |||
8b266f086f | |||
c40306c624 | |||
24c10b592b | |||
cafd786e19 | |||
a7c8052ee2 | |||
a33da0d8d5 | |||
91f87aa3c7 | |||
b6ae394eaf | |||
79499d7afd | |||
92f05817fe | |||
a85833d41d | |||
8a8e6d08e0 | |||
aa7c5bebda | |||
ceece01b99 | |||
1d46db348a | |||
48a7ce91c3 | |||
75892b78c0 | |||
7c938fe291 | |||
497f4eca8a | |||
770b56e2cf | |||
df680e74f6 | |||
e66a7eb9ba | |||
6c66862eed | |||
fc5e54db05 | |||
d20aafb3ff | |||
8ce7154a77 | |||
d926ea66b0 | |||
3baa77d3bb | |||
25eb6d8d72 | |||
349508701c | |||
9f770bbb3f | |||
bc1c56174a | |||
db585975e8 | |||
8bf99423c8 | |||
249c4db1de | |||
3dd8f26c94 | |||
4a9d496ba1 | |||
6f5bbeffa2 |
@@ -107,6 +107,9 @@
|
||||
<ProjectReference Include="..\lib\PAP\build\PAP.vcxproj">
|
||||
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\lib\TLS\build\TLS.vcxproj">
|
||||
<Project>{4d40cb8a-812e-4f12-b23a-31af743878e8}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
|
||||
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
|
||||
</ProjectReference>
|
||||
|
@@ -40,7 +40,7 @@ static int CredWrite()
|
||||
return -1;
|
||||
}
|
||||
|
||||
eap::credentials_pap cred(g_module);
|
||||
eap::credentials_pap cred_pap(g_module);
|
||||
|
||||
// Prepare identity (user name).
|
||||
{
|
||||
@@ -50,7 +50,7 @@ static int CredWrite()
|
||||
bool is_last;
|
||||
dec.decode(identity_utf8, is_last, pwcArglist[1], (size_t)-1);
|
||||
|
||||
MultiByteToWideChar(CP_UTF8, 0, identity_utf8.data(), (int)identity_utf8.size(), cred.m_identity);
|
||||
MultiByteToWideChar(CP_UTF8, 0, identity_utf8.data(), (int)identity_utf8.size(), cred_pap.m_identity);
|
||||
}
|
||||
|
||||
// Prepare password.
|
||||
@@ -61,7 +61,7 @@ static int CredWrite()
|
||||
bool is_last;
|
||||
dec.decode(password_utf8, is_last, pwcArglist[2], (size_t)-1);
|
||||
|
||||
MultiByteToWideChar(CP_UTF8, 0, password_utf8.data(), (int)password_utf8.size(), cred.m_password);
|
||||
MultiByteToWideChar(CP_UTF8, 0, password_utf8.data(), (int)password_utf8.size(), cred_pap.m_password);
|
||||
}
|
||||
|
||||
// Generate target name (aka realm).
|
||||
@@ -71,12 +71,11 @@ static int CredWrite()
|
||||
target_name = pwcArglist[3];
|
||||
} else {
|
||||
// Get the realm from user name.
|
||||
LPCWSTR _identity = cred.m_identity.c_str(), domain;
|
||||
if ((domain = wcschr(_identity, L'@')) != NULL)
|
||||
target_name = domain + 1;
|
||||
else if ((domain = wcschr(_identity, L'\\')) != NULL)
|
||||
target_name.assign(_identity, domain);
|
||||
else
|
||||
LPCWSTR _identity = cred_pap.m_identity.c_str(), domain;
|
||||
if ((domain = wcschr(_identity, L'@')) != NULL) {
|
||||
target_name = L"urn:RFC4282:realm:";
|
||||
target_name += domain + 1;
|
||||
} else
|
||||
target_name = L"*";
|
||||
}
|
||||
|
||||
@@ -94,7 +93,7 @@ static int CredWrite()
|
||||
}
|
||||
#endif
|
||||
try {
|
||||
cred.store(target_name.c_str());
|
||||
cred_pap.store(target_name.c_str());
|
||||
} catch(win_runtime_error &err) {
|
||||
OutputDebugStr(_T("%hs (error %u)\n"), err.what(), err.number());
|
||||
return 2;
|
||||
@@ -103,6 +102,18 @@ static int CredWrite()
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Store empty TLS credentials.
|
||||
eap::credentials_tls cred_tls(g_module);
|
||||
try {
|
||||
cred_tls.store(target_name.c_str());
|
||||
} catch(win_runtime_error &err) {
|
||||
OutputDebugStr(_T("%hs (error %u)\n"), err.what(), err.number());
|
||||
return 3;
|
||||
} catch(...) {
|
||||
OutputDebugStr(_T("Writing credentials failed.\n"));
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -20,8 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../lib/PAP/include/Config.h"
|
||||
#include "../lib/PAP/include/Credentials.h"
|
||||
#include "../lib/TLS/include/Credentials.h"
|
||||
#include "../lib/EAPBase/include/Module.h"
|
||||
|
||||
#include <WinStd/Common.h>
|
||||
|
@@ -100,6 +100,9 @@
|
||||
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
|
||||
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj">
|
||||
<Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\lib\PAP\build\PAP.vcxproj">
|
||||
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
|
||||
</ProjectReference>
|
||||
|
Binary file not shown.
@@ -103,6 +103,12 @@
|
||||
<ProjectReference Include="..\..\lib\Events\build\Events.vcxproj">
|
||||
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\lib\MSCHAPv2\build\MSCHAPv2.vcxproj">
|
||||
<Project>{86a6d6a0-4b7d-4134-be81-a5755c77584d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\lib\MSCHAPv2_UI\build\MSCHAPv2_UI.vcxproj">
|
||||
<Project>{7af5b922-7c17-428a-97e0-09e3b41a684d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\lib\PAP\build\PAP.vcxproj">
|
||||
<Project>{36b0cf8a-7794-46c3-8099-825ba962b4c7}</Project>
|
||||
</ProjectReference>
|
||||
@@ -127,8 +133,13 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\build\EAPMethodUI.def" />
|
||||
<None Include="..\locale\EAPMethods.pot" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<POCompile Include="..\locale\sl_SI.po" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\include\xgettext.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -13,6 +13,10 @@
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files\Localization">
|
||||
<UniqueIdentifier>{e43059ae-37ac-4b28-84fb-18d1b3972b30}</UniqueIdentifier>
|
||||
<Extensions>po;pot</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h">
|
||||
@@ -36,5 +40,13 @@
|
||||
<None Include="..\build\EAPMethodUI.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="..\locale\EAPMethods.pot">
|
||||
<Filter>Resource Files\Localization</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<POCompile Include="..\locale\sl_SI.po">
|
||||
<Filter>Resource Files\Localization</Filter>
|
||||
</POCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
Binary file not shown.
1
EAPMethods/locale/.gitignore
vendored
Normal file
1
EAPMethods/locale/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/*.mo
|
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EAPMethods\n"
|
||||
"POT-Creation-Date: 2016-08-25 10:43+0200\n"
|
||||
"POT-Creation-Date: 2016-09-02 19:08+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"
|
||||
@@ -20,201 +20,240 @@ msgstr ""
|
||||
"X-Poedit-SearchPath-4: EAPMethods\n"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:37
|
||||
msgid "Advanced..."
|
||||
msgid "+"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:38
|
||||
msgid "Adds new provider"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:42
|
||||
msgid "-"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:43
|
||||
msgid "Removes selected provider"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:47
|
||||
msgid "Advanced..."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:48
|
||||
msgid "Opens dialog with provider settings"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:174 lib/EAPBase_UI/res/wxEAP_UI.cpp:296
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:230 lib/EAPBase_UI/res/wxEAP_UI.cpp:355
|
||||
msgid "Client Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:185
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:241
|
||||
msgid "Manage credentials used to connect."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:198
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:254
|
||||
msgid "Use &own credentials:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:199
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:255
|
||||
msgid "Select this option if you have your unique credentials to connect"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:204
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:260
|
||||
msgid "Your credentials loaded from Windows Credential Manager"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:214
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:270
|
||||
msgid "&Clear Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:215
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:271
|
||||
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:219 lib/EAPBase_UI/res/wxEAP_UI.cpp:252
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:275 lib/EAPBase_UI/res/wxEAP_UI.cpp:308
|
||||
msgid "&Set Credentials..."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:220 lib/EAPBase_UI/res/wxEAP_UI.cpp:253
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:276 lib/EAPBase_UI/res/wxEAP_UI.cpp:309
|
||||
msgid "Click here to set or modify your credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:236
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:292
|
||||
msgid "Use &pre-shared credentials:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:237
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:293
|
||||
msgid "Select this options if all clients connect using the same credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:242
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:298
|
||||
msgid "Common (pre-shared) credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:307
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:366
|
||||
msgid "Please provide your user ID and password."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:317
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:376
|
||||
msgid "User ID:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:322
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:381
|
||||
msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:326
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:385
|
||||
msgid "Password:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:331
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:390
|
||||
msgid "Enter your password here"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:338 lib/TLS_UI/res/wxTLS_UI.cpp:183
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:397 lib/TLS_UI/res/wxTLS_UI.cpp:183
|
||||
msgid "&Remember"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:339
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:398
|
||||
msgid "Check if you would like to save username and password"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:361
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:420
|
||||
msgid "Your Organization"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:372
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:431
|
||||
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
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:438
|
||||
msgid "Your organization &name:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:384
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:443
|
||||
msgid "Your organization name as it will appear on helpdesk contact notifications"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:388
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:447
|
||||
msgid "(Keep it short, please)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:398
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:457
|
||||
msgid "Helpdesk contact &information:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:408
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:467
|
||||
msgid "¶"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:415
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:474
|
||||
msgid "Your helpdesk website address"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:419
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:478
|
||||
msgid "*"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:426
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:485
|
||||
msgid "Your helpdesk e-mail address"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:430
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:489
|
||||
msgid ")"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:437
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:496
|
||||
msgid "Your helpdesk phone number"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:471
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:524
|
||||
msgid "Provider Unique Identifier"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:535
|
||||
msgid "Assign your organization a unique ID to allow sharing the same credential set across different network profiles."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:542
|
||||
msgid "&Namespace:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:546
|
||||
msgid "urn:RFC4282:realm"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:546
|
||||
msgid "urn:uuid"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:558
|
||||
msgid "Provider unique &identifier:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:563
|
||||
msgid "Your organization ID to assign same credentials from other profiles"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:588
|
||||
msgid "Configuration Lock"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:482
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:599
|
||||
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
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:606
|
||||
msgid "&Lock this configuration and prevent any further modification via user interface."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:492
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:609
|
||||
msgid "(Warning: Once locked, you can not revert using this dialog!)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:88
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:98
|
||||
#, c-format
|
||||
msgid "%s Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:118
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:123 lib/EAPBase_UI/include/EAP_UI.h:352
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:362 lib/EAPBase_UI/res/wxEAP_UI.h:119
|
||||
msgid "EAP Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:166
|
||||
#, 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
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:167
|
||||
msgid "your provider"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:139
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:186
|
||||
msgid "Open the default web browser"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:150
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:197
|
||||
msgid "Open your e-mail program"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:161
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:208
|
||||
msgid "Dial the phone number"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:180
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:228
|
||||
#, 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
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:229
|
||||
msgid "Your provider"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:201
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:249
|
||||
msgid "Previous attempt to connect failed. Please, make sure your credentials are correct, or try again later."
|
||||
msgstr ""
|
||||
|
||||
@@ -323,32 +362,32 @@ msgstr ""
|
||||
msgid "Validation conflict"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:514
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:511
|
||||
msgid "Add Certificate"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:515
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:512
|
||||
msgid "Certificate Files (*.cer;*.crt;*.der;*.p7b;*.pem)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:516
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:513
|
||||
msgid "X.509 Certificate Files (*.cer;*.crt;*.der;*.pem)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:517
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:514
|
||||
msgid "PKCS #7 Certificate Files (*.p7b)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:518
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:515
|
||||
msgid "All Files (*.*)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:534
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:531
|
||||
#, c-format
|
||||
msgid "Invalid or unsupported certificate file %s"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:534
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:531
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
@@ -388,18 +427,18 @@ msgstr ""
|
||||
msgid "Custom outer identity to use"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/Module.cpp:231 lib/TTLS_UI/src/Module.cpp:241
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:582
|
||||
#: lib/TTLS_UI/src/Module.cpp:275 lib/TTLS_UI/src/Module.cpp:285
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:689
|
||||
#, c-format
|
||||
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/Module.cpp:233 lib/TTLS_UI/src/Module.cpp:243
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:584
|
||||
#: lib/TTLS_UI/src/Module.cpp:277 lib/TTLS_UI/src/Module.cpp:287
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:692
|
||||
msgid "Writing credentials failed."
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:108 lib/TTLS_UI/src/TTLS_UI.cpp:215
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:108 lib/TTLS_UI/src/TTLS_UI.cpp:235
|
||||
msgid "Inner Authentication"
|
||||
msgstr ""
|
||||
|
||||
@@ -411,47 +450,55 @@ msgstr ""
|
||||
msgid "PAP"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:121 lib/TTLS_UI/src/TTLS_UI.cpp:236
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:118
|
||||
msgid "MSCHAPv2"
|
||||
msgstr ""
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:123 lib/TTLS_UI/src/TTLS_UI.cpp:256
|
||||
msgid "Outer Authentication"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:253
|
||||
msgid "EAP Credentials"
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:289
|
||||
#, c-format
|
||||
msgid "Are you sure you want to permanently remove %ls provider from configuration?"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:422
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:289
|
||||
msgid "Warning"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:549
|
||||
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:508
|
||||
#, c-format
|
||||
msgid "<error %u>"
|
||||
msgstr ""
|
||||
|
||||
#: 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
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:705
|
||||
#, c-format
|
||||
msgid "Deleting credentials failed (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:817
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:738
|
||||
#, c-format
|
||||
msgid "<error %u>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:742
|
||||
msgid "<error>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:753 lib/EAPBase_UI/include/EAP_UI.h:762
|
||||
msgid "<empty>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:753 lib/EAPBase_UI/include/EAP_UI.h:762
|
||||
msgid "<blank ID>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:962
|
||||
msgid "<Your Organization>"
|
||||
msgstr ""
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:60
|
||||
msgid "EAP Method Configuration"
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:69
|
||||
msgid "EAP Connection Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
|
587
EAPMethods/locale/sl_SI.po
Normal file
587
EAPMethods/locale/sl_SI.po
Normal file
@@ -0,0 +1,587 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EAPMethods\n"
|
||||
"POT-Creation-Date: 2016-09-02 19:08+0200\n"
|
||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
|
||||
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sl_SI\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"X-Poedit-Basepath: ../..\n"
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: lib/EAPBase_UI\n"
|
||||
"X-Poedit-SearchPath-1: lib/PAP_UI\n"
|
||||
"X-Poedit-SearchPath-2: lib/TLS_UI\n"
|
||||
"X-Poedit-SearchPath-3: lib/TTLS_UI\n"
|
||||
"X-Poedit-SearchPath-4: EAPMethods\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:37
|
||||
msgid "+"
|
||||
msgstr "+"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:38
|
||||
msgid "Adds new provider"
|
||||
msgstr "Doda novega ponudnika"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:42
|
||||
msgid "-"
|
||||
msgstr "-"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:43
|
||||
msgid "Removes selected provider"
|
||||
msgstr "Odstrani izbranega ponudnika"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:47
|
||||
msgid "Advanced..."
|
||||
msgstr "Napredno ..."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:48
|
||||
msgid "Opens dialog with provider settings"
|
||||
msgstr "Odpre dialog z nastavitvami ponudnika"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:230 lib/EAPBase_UI/res/wxEAP_UI.cpp:355
|
||||
msgid "Client Credentials"
|
||||
msgstr "Odjemalčeve poverilnice"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:241
|
||||
msgid "Manage credentials used to connect."
|
||||
msgstr "Upravljajte s poverilnicami za povezovanje."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:254
|
||||
msgid "Use &own credentials:"
|
||||
msgstr "Uporabi sv&oje poverilnice:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:255
|
||||
msgid "Select this option if you have your unique credentials to connect"
|
||||
msgstr "Izberite to možnost, če imate svoje lastne poverilnice za povezovanje"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:260
|
||||
msgid "Your credentials loaded from Windows Credential Manager"
|
||||
msgstr "Vaše poverilnice naložene iz upravitelja poverilnic Windows"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:270
|
||||
msgid "&Clear Credentials"
|
||||
msgstr "Počisti poverilni&ce"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:271
|
||||
msgid ""
|
||||
"Click to clear your credentials from Credential Manager.\n"
|
||||
"Note: You will be prompted to enter credentials when connecting."
|
||||
msgstr ""
|
||||
"Kliknite, da počistite svoje poverilnice iz upravitelja poverilnic.\n"
|
||||
"Opomba: Za vnos poverilnic boste pozvani ob povezovanju."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:275 lib/EAPBase_UI/res/wxEAP_UI.cpp:308
|
||||
msgid "&Set Credentials..."
|
||||
msgstr "Na&stavi poverilnice ..."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:276 lib/EAPBase_UI/res/wxEAP_UI.cpp:309
|
||||
msgid "Click here to set or modify your credentials"
|
||||
msgstr "Kliknite tukaj, da nastavite ali spremenite svoje poverilnice"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:292
|
||||
msgid "Use &pre-shared credentials:"
|
||||
msgstr "Uporabi sku&pne poverilnice:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:293
|
||||
msgid "Select this options if all clients connect using the same credentials"
|
||||
msgstr ""
|
||||
"Izberite to možnost, kadar se vsi odjemalci povezujejo z istimi "
|
||||
"poverilnicami"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:298
|
||||
msgid "Common (pre-shared) credentials"
|
||||
msgstr "Skupne (deljene) poverilnice"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:366
|
||||
msgid "Please provide your user ID and password."
|
||||
msgstr "Vnesite svoj uporabniški ID in geslo."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:376
|
||||
msgid "User ID:"
|
||||
msgstr "Uporabniški ID:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:381
|
||||
msgid "Enter your user name here (user@domain.org, DOMAIN\\User, etc.)"
|
||||
msgstr "Tukaj vnesite svoje up. ime (up. ime@domena.si, DOMENA\\Uporabnik ipd.)"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:385
|
||||
msgid "Password:"
|
||||
msgstr "Geslo:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:390
|
||||
msgid "Enter your password here"
|
||||
msgstr "Tukaj vnesite svoje geslo"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:397 lib/TLS_UI/res/wxTLS_UI.cpp:183
|
||||
msgid "&Remember"
|
||||
msgstr "Za&pomni si"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:398
|
||||
msgid "Check if you would like to save username and password"
|
||||
msgstr "Odkljukajte, če želite shraniti up. ime in geslo"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:420
|
||||
msgid "Your Organization"
|
||||
msgstr "Vaša organizacija"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:431
|
||||
msgid ""
|
||||
"Describe your organization to customize user prompts. When organization is "
|
||||
"introduced, end-users find program messages easier to understand and act."
|
||||
msgstr ""
|
||||
"Opišite svojo organizacijo za up. pozive po meri. Kadar se organizacija "
|
||||
"predstavi, uporabniki lažje razumejo sporočila programa in ustrezneje "
|
||||
"reagirajo."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:438
|
||||
msgid "Your organization &name:"
|
||||
msgstr "Ime vaše orga&nizacije:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:443
|
||||
msgid ""
|
||||
"Your organization name as it will appear on helpdesk contact notifications"
|
||||
msgstr ""
|
||||
"Ime vaše organizacije, kot bo nastopalo na obvestilih s stikom na center za "
|
||||
"pomoč"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:447
|
||||
msgid "(Keep it short, please)"
|
||||
msgstr "(Naj bo kratko, prosim)"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:457
|
||||
msgid "Helpdesk contact &information:"
|
||||
msgstr "Podatk&i centra za pomoč:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:467
|
||||
msgid "¶"
|
||||
msgstr "¶"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:474
|
||||
msgid "Your helpdesk website address"
|
||||
msgstr "Naslov spletne strani vašega centra za pomoč"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:478
|
||||
msgid "*"
|
||||
msgstr "*"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:485
|
||||
msgid "Your helpdesk e-mail address"
|
||||
msgstr "E-poštni naslov vašega centra za pomoč"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:489
|
||||
msgid ")"
|
||||
msgstr ")"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:496
|
||||
msgid "Your helpdesk phone number"
|
||||
msgstr "Telefonska številka vašega centra za pomoč"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:524
|
||||
msgid "Provider Unique Identifier"
|
||||
msgstr "Enolični identifikator ponudnika"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:535
|
||||
msgid ""
|
||||
"Assign your organization a unique ID to allow sharing the same credential "
|
||||
"set across different network profiles."
|
||||
msgstr ""
|
||||
"Dodelite svoji organizaciji enoznačen identifikator, da omogočite souporabo "
|
||||
"istih poverilnic različnim omrežnim profilom."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:542
|
||||
msgid "&Namespace:"
|
||||
msgstr "Ime&nski prostor:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:546
|
||||
msgid "urn:RFC4282:realm"
|
||||
msgstr "urn:RFC4282:realm"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:546
|
||||
msgid "urn:uuid"
|
||||
msgstr "urn:uuid"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:558
|
||||
msgid "Provider unique &identifier:"
|
||||
msgstr "Enolični &identifikator ponudnika:"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:563
|
||||
msgid "Your organization ID to assign same credentials from other profiles"
|
||||
msgstr ""
|
||||
"Identifikator vaše organizacije za souporabo istih poverilnic različnih "
|
||||
"profilov"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:588
|
||||
msgid "Configuration Lock"
|
||||
msgstr "Zaklep konfiguracije"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:599
|
||||
msgid ""
|
||||
"Your configuration can be locked to prevent accidental modification by end-"
|
||||
"users. Users will only be allowed to enter credentials."
|
||||
msgstr ""
|
||||
"Svojo konfiguracijo lahko zaklenete in preprečite končnim uporabnikom "
|
||||
"nenamerno spreminjanje. Uporabniki bodo lahko vnašali samo poverilnice."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:606
|
||||
msgid ""
|
||||
"&Lock this configuration and prevent any further modification via user "
|
||||
"interface."
|
||||
msgstr ""
|
||||
"Zak&leni to konfiguracijo in prepreči vse nadaljnje spremembe preko up. "
|
||||
"vmesnika."
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.cpp:609
|
||||
msgid "(Warning: Once locked, you can not revert using this dialog!)"
|
||||
msgstr "(Pozor: Ko zaklenete, vrnitev ne bo več možna preko tega dialoga!)"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:98
|
||||
#, c-format
|
||||
msgid "%s Credentials"
|
||||
msgstr "Poverilnice za %s"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:123 lib/EAPBase_UI/include/EAP_UI.h:352
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:362 lib/EAPBase_UI/res/wxEAP_UI.h:119
|
||||
msgid "EAP Credentials"
|
||||
msgstr "Poverilnice EAP"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:166
|
||||
#, c-format
|
||||
msgid "For additional help and instructions, please contact %s at:"
|
||||
msgstr "Za dodtano pomoč ali navodila se obrnite na %s na:"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:167
|
||||
msgid "your provider"
|
||||
msgstr "vaš ponudnik"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:186
|
||||
msgid "Open the default web browser"
|
||||
msgstr "Odpre privzeto nastavljen spletni brskalnik"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:197
|
||||
msgid "Open your e-mail program"
|
||||
msgstr "Odpre vaš program za e-pošto"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:208
|
||||
msgid "Dial the phone number"
|
||||
msgstr "Pokliče telefonsko številko"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:228
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s has pre-set parts of this configuration. Those parts are locked to "
|
||||
"prevent accidental modification."
|
||||
msgstr ""
|
||||
"%s je prednastavil dele te konfiguracije. Ti deli so zaklenjeni zaradi "
|
||||
"preprečevanja nenamernih sprememb."
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:229
|
||||
msgid "Your provider"
|
||||
msgstr "Vaš ponudnik"
|
||||
|
||||
#: lib/EAPBase_UI/src/EAP_UI.cpp:249
|
||||
msgid ""
|
||||
"Previous attempt to connect failed. Please, make sure your credentials are "
|
||||
"correct, or try again later."
|
||||
msgstr ""
|
||||
"Prejšnji poskus povezave ni uspel. Preverite, ali so vaše poverilnice "
|
||||
"pravilne ali poskusite kasneje."
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:17
|
||||
msgid "Server Trust"
|
||||
msgstr "Zaupanje strežniku"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:28
|
||||
msgid ""
|
||||
"Describe the servers you trust to prevent credential interception in case of"
|
||||
" man-in-the-middle attacks."
|
||||
msgstr ""
|
||||
"Opišite strežnike, ki jim zaupate in preprečite prestrezanje poverilnic v "
|
||||
"primeru napada \"vmesnega člena\"."
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:35
|
||||
msgid "Acceptable Certificate Authorities:"
|
||||
msgstr "Sprejemljivi izdajatelji potrdil:"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:40
|
||||
msgid "List of certificate authorities server's certificate must be issued by"
|
||||
msgstr ""
|
||||
"Seznam izdajateljev potrdil, od katerih mora biti izdano strežnikovo "
|
||||
"potrdilo"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:47
|
||||
msgid "Add CA from Store..."
|
||||
msgstr "Dodaj CA iz shrambe ..."
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:48
|
||||
msgid ""
|
||||
"Adds a new certificate authority from the certificate store to the list"
|
||||
msgstr "Doda novega izdajatelja potrdil iz shrambe potrdil na seznam"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:52
|
||||
msgid "Add CA from File..."
|
||||
msgstr "Dodaj CA iz datoteke ..."
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:53
|
||||
msgid "Adds a new certificate authority from the file to the list"
|
||||
msgstr "Doda novega izdajatelja potrdil iz datoteke na seznam"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:57
|
||||
msgid "&Remove CA"
|
||||
msgstr "Odst&rani CA"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:59
|
||||
msgid "Removes selected certificate authorities from the list"
|
||||
msgstr "Odstrani izbrane izdajatelje potrdil s seznama"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:72
|
||||
msgid "Acceptable server &names:"
|
||||
msgstr "Sprejemljiva ime&na strežnika:"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:77
|
||||
msgid ""
|
||||
"A semicolon delimited list of acceptable server FQDN names; blank to skip "
|
||||
"name check; Unicode characters allowed"
|
||||
msgstr ""
|
||||
"S podpičji ločen seznam sprejemljivih strežnikovih imen FQDN; prazno, da "
|
||||
"izpusti preverjanje imena; znaki Unicode dovoljeni"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:81
|
||||
msgid "(Example: foo.bar.com;server2.bar.com)"
|
||||
msgstr "(Primer: vzo.rec.si;streznik2.rec.si)"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:120
|
||||
msgid "TLS Client Certificate"
|
||||
msgstr "Odjemalčevo potrdilo TLS"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:131
|
||||
msgid "Please select your client certificate to use for authentication."
|
||||
msgstr "Izberite svoje odjemalčevo potrdilo za uporabo med overovljanjem."
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:138
|
||||
msgid "Co&nnect without providing a client certificate"
|
||||
msgstr "Poveži brez dostave &odjemalčevega potrdila"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:139
|
||||
msgid ""
|
||||
"Select if your server does not require you to provide a client certificate"
|
||||
msgstr ""
|
||||
"Izberite, če vaš strežnik ne zahteva, da mu dostavite odjemalčevo potrdilo"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:146
|
||||
msgid "Use the following &certificate:"
|
||||
msgstr "Uporabi naslednje &potrdilo:"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:147
|
||||
msgid "Select if you need to provide a client certificate when connecting"
|
||||
msgstr "Izberite, če morate dostaviti odjemalčevo potrdilo ob povezavi"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:154
|
||||
msgid "Client certificate to use for authentication"
|
||||
msgstr "Odjemalčevo potrdilo za overovljanje"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:167
|
||||
msgid "Custom &identity:"
|
||||
msgstr "&Identiteta po meri:"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:172
|
||||
msgid ""
|
||||
"Your identity (username@domain) to override one from certificate; or blank "
|
||||
"to use one provided in certificate"
|
||||
msgstr ""
|
||||
"Vaša identiteta (up. ime@domena), ki bo nadomestila tisto s potrdila; ali "
|
||||
"prazno, če želite uporabiti tisto s potrdila"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:176
|
||||
msgid "(Example: user@contoso.com)"
|
||||
msgstr "(Primer: uporabnik@vzorec.si)"
|
||||
|
||||
#: lib/TLS_UI/res/wxTLS_UI.cpp:184
|
||||
msgid "Check if you would like to save certificate selection"
|
||||
msgstr "Odkljukajte, če želite shraniti izbor potrdila"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:118
|
||||
#, c-format
|
||||
msgid "Invalid character in host name found: %c"
|
||||
msgstr "Napačen znak v imenu gostitelja: %c"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:118
|
||||
msgid "Validation conflict"
|
||||
msgstr "Nesoglasje pri preverjanju"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:511
|
||||
msgid "Add Certificate"
|
||||
msgstr "Dodaj potrdilo"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:512
|
||||
msgid "Certificate Files (*.cer;*.crt;*.der;*.p7b;*.pem)"
|
||||
msgstr "Datoteke s potrdili (*.cer;*.crt;*.der;*.p7b;*.pem)"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:513
|
||||
msgid "X.509 Certificate Files (*.cer;*.crt;*.der;*.pem)"
|
||||
msgstr "Datoteke s potrdili X.509 (*.cer;*.crt;*.der;*.pem)"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:514
|
||||
msgid "PKCS #7 Certificate Files (*.p7b)"
|
||||
msgstr "Datoteke s potrdili PKCS #7 (*.p7b)"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:515
|
||||
msgid "All Files (*.*)"
|
||||
msgstr "Vse datoteke (*.*)"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:531
|
||||
#, c-format
|
||||
msgid "Invalid or unsupported certificate file %s"
|
||||
msgstr "Napačna ali nepodprta datoteka s potrdilom %s"
|
||||
|
||||
#: lib/TLS_UI/src/TLS_UI.cpp:531
|
||||
msgid "Error"
|
||||
msgstr "Napaka"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:17
|
||||
msgid "Outer Identity"
|
||||
msgstr "Zunanja identiteta"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:28
|
||||
msgid "Select the user ID supplicant introduces itself as to authenticator:"
|
||||
msgstr ""
|
||||
"Izberite uporabniško identiteto, s katerim se prosilec predstavi "
|
||||
"overovitelju:"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:35
|
||||
msgid "&True identity"
|
||||
msgstr "Prava iden&titeta"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:36
|
||||
msgid "Use my true user name"
|
||||
msgstr "Uporabi moje pravo uporabniško ime"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:40
|
||||
msgid "Use &empty outer identity (RFC 4822)"
|
||||
msgstr "Uporabi prazno zunanjo id&entiteto (RFC 4822)"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:41
|
||||
msgid "Ommit my user name and use @mydomain.org only"
|
||||
msgstr "Izpusti moje uporabniško ime in uporabi samo @mojadomena.si"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:48
|
||||
msgid "&Custom outer identity:"
|
||||
msgstr "Zunanja identiteta po &meri:"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:49
|
||||
msgid "Specify custom outer identity"
|
||||
msgstr "Navedite zunanjo identiteto po meri"
|
||||
|
||||
#: lib/TTLS_UI/res/wxTTLS_UI.cpp:54
|
||||
msgid "Custom outer identity to use"
|
||||
msgstr "Zunanja identiteta po meri za uporabo"
|
||||
|
||||
#: lib/TTLS_UI/src/Module.cpp:275 lib/TTLS_UI/src/Module.cpp:285
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:689
|
||||
#, c-format
|
||||
msgid "Error writing credentials to Credential Manager: %hs (error %u)"
|
||||
msgstr ""
|
||||
"Napaka pri zapisovanju poverilnic v upravitelja poverilnic: %hs (napaka %u)"
|
||||
|
||||
#: lib/TTLS_UI/src/Module.cpp:277 lib/TTLS_UI/src/Module.cpp:287
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:692
|
||||
msgid "Writing credentials failed."
|
||||
msgstr "Zapisovanje poverilnic ni uspelo."
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:108 lib/TTLS_UI/src/TTLS_UI.cpp:235
|
||||
msgid "Inner Authentication"
|
||||
msgstr "Notranje overovljanje"
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:114
|
||||
msgid "Select inner authentication method from the list"
|
||||
msgstr "Izberite postopek notranjega overovljanja s seznama"
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:116
|
||||
msgid "PAP"
|
||||
msgstr "PAP"
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:118
|
||||
msgid "MSCHAPv2"
|
||||
msgstr "MSCHAPv2"
|
||||
|
||||
#: lib/TTLS_UI/src/TTLS_UI.cpp:123 lib/TTLS_UI/src/TTLS_UI.cpp:256
|
||||
msgid "Outer Authentication"
|
||||
msgstr "Zunanje overovljanje"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:289
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Are you sure you want to permanently remove %ls provider from configuration?"
|
||||
msgstr ""
|
||||
"Ali ste prepričani, da želite trajno izbrisati ponudnika %ls iz "
|
||||
"konfiguracije?"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:289
|
||||
msgid "Warning"
|
||||
msgstr "Opozorilo"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:549
|
||||
msgid "Provider Settings"
|
||||
msgstr "Nastavitve ponudnika"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:705
|
||||
#, c-format
|
||||
msgid "Deleting credentials failed (error %u)."
|
||||
msgstr "Izbris poverilnic ni uspel (napaka %u)."
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:738
|
||||
#, c-format
|
||||
msgid "<error %u>"
|
||||
msgstr "<napaka %u>"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:742
|
||||
msgid "<error>"
|
||||
msgstr "<napaka>"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:753 lib/EAPBase_UI/include/EAP_UI.h:762
|
||||
msgid "<empty>"
|
||||
msgstr "<napaka>"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:753 lib/EAPBase_UI/include/EAP_UI.h:762
|
||||
msgid "<blank ID>"
|
||||
msgstr "<prazen ID>"
|
||||
|
||||
#: lib/EAPBase_UI/include/EAP_UI.h:962
|
||||
msgid "<Your Organization>"
|
||||
msgstr "<vaša organizacija>"
|
||||
|
||||
#: lib/EAPBase_UI/res/wxEAP_UI.h:69
|
||||
msgid "EAP Connection Configuration"
|
||||
msgstr "Konfiguracija povezave EAP"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "EAP Methods"
|
||||
msgstr "Postopki EAP"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "Modules to support individual EAP methods"
|
||||
msgstr "Moduli, ki omogočajo posamezne postopke EAP"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
|
||||
msgid "TTLS"
|
||||
msgstr "TTLS"
|
||||
|
||||
#: EAPMethods/MSIBuild/En.Win32.Release.Feature-2.idtx:5
|
||||
#: EAPMethods/MSIBuild/En.x64.Release.Feature-2.idtx:5
|
||||
msgid "Tunneled Transport Layer Security"
|
||||
msgstr "Tunneled Transport Layer Security"
|
@@ -193,17 +193,17 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
|
||||
HRESULT hr;
|
||||
|
||||
// Create configuration XML document.
|
||||
com_obj<IXMLDOMDocument2> pDoc;
|
||||
if (FAILED(hr = pDoc.create(CLSID_DOMDocument60, NULL, CLSCTX_INPROC_SERVER))) {
|
||||
com_obj<IXMLDOMDocument2> pConfigDoc;
|
||||
if (FAILED(hr = pConfigDoc.create(CLSID_DOMDocument60, NULL, CLSCTX_INPROC_SERVER))) {
|
||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error creating XML document.")));
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
pDoc->put_async(VARIANT_FALSE);
|
||||
pConfigDoc->put_async(VARIANT_FALSE);
|
||||
|
||||
// Load empty XML configuration.
|
||||
VARIANT_BOOL isSuccess = VARIANT_FALSE;
|
||||
if (FAILED((hr = pDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"><EAPIdentityProviderList xmlns=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"></EAPIdentityProviderList></Config>", &isSuccess)))) {
|
||||
if (FAILED((hr = pConfigDoc->loadXML(L"<Config xmlns=\"http://www.microsoft.com/provisioning/EapHostConfig\"></Config>", &isSuccess)))) {
|
||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error loading XML document template.")));
|
||||
return dwResult;
|
||||
}
|
||||
@@ -214,16 +214,16 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
|
||||
|
||||
// Select <Config> node.
|
||||
com_obj<IXMLDOMNode> pXmlElConfig;
|
||||
pDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
|
||||
if (FAILED(eapxml::select_node(pDoc, bstr(L"eaphostconfig:Config"), &pXmlElConfig))) {
|
||||
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\""));
|
||||
if (FAILED(eapxml::select_node(pConfigDoc, bstr(L"eaphostconfig:Config"), &pXmlElConfig))) {
|
||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <Config> element.")));
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
// Save configuration.
|
||||
pDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
||||
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
||||
try {
|
||||
g_peer.config_blob2xml(dwFlags, pConnectionData, dwConnectionDataSize, pDoc, pXmlElConfig);
|
||||
g_peer.config_blob2xml(dwFlags, pConnectionData, dwConnectionDataSize, pConfigDoc, pXmlElConfig);
|
||||
} catch (std::exception &err) {
|
||||
g_peer.log_error(*ppEapError = g_peer.make_error(err));
|
||||
return dwResult = (*ppEapError)->dwWinError;
|
||||
@@ -231,7 +231,7 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
|
||||
return dwResult = ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
*ppConfigDoc = pDoc.detach();
|
||||
*ppConfigDoc = pConfigDoc.detach();
|
||||
}
|
||||
|
||||
return dwResult;
|
||||
|
@@ -46,23 +46,15 @@ bool wxEventMonitorApp::OnInit()
|
||||
::MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featEventMonitor"));
|
||||
#endif
|
||||
|
||||
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT("EventMonitor"), wxT(PRODUCT_NAME_STR)));
|
||||
if (cfgPrev) wxDELETE(cfgPrev);
|
||||
wxInitializeConfig();
|
||||
|
||||
if (!wxApp::OnInit())
|
||||
return false;
|
||||
|
||||
// Set desired locale.
|
||||
wxLanguage language = (wxLanguage)wxConfigBase::Get()->Read(wxT("Language"), wxLANGUAGE_DEFAULT);
|
||||
if (wxLocale::IsAvailable(language)) {
|
||||
wxString sPath;
|
||||
if (wxConfigBase::Get()->Read(wxT("LocalizationRepositoryPath"), &sPath))
|
||||
m_locale.AddCatalogLookupPathPrefix(sPath);
|
||||
if (m_locale.Init(language)) {
|
||||
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
|
||||
if (wxInitializeLocale(m_locale)) {
|
||||
//wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
|
||||
wxVERIFY(m_locale.AddCatalog(wxT("EventMonitor")));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Find EventMonitor window if already running.
|
||||
|
@@ -31,7 +31,7 @@ using namespace winstd;
|
||||
// Local helper functions declarations
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ LPCBYTE pData);
|
||||
static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ ULONG ulData);
|
||||
static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(nDataSize) LPCBYTE pData, _In_ SIZE_T nDataSize, _In_ const EVENT_MAP_INFO *pMapInfo, _In_ BYTE nPtrSize);
|
||||
static ULONG GetArraySize(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, ULONG i, ULONG *pulArraySize);
|
||||
static tstring PropertyToString(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, ULONG ulPropIndex, LPWSTR pStructureName, ULONG ulStructIndex, BYTE nPtrSize);
|
||||
@@ -164,11 +164,11 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
m_rec_idx(wxETWEVENT_RECORDS_MAX),
|
||||
wxListCtrl(parent, id, pos, size, style, validator, name)
|
||||
{
|
||||
this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, 100);
|
||||
this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, 50 );
|
||||
this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, 50 );
|
||||
this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, 100);
|
||||
this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE_USEHEADER);
|
||||
this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, 160);
|
||||
this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, 50);
|
||||
this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, 50);
|
||||
this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, 80);
|
||||
this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, 350);
|
||||
|
||||
// Maximum expected column widths for pre-formatted row display
|
||||
m_col_format_width[0] = 26;
|
||||
@@ -411,7 +411,7 @@ void wxETWListCtrl::RebuildItems()
|
||||
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;
|
||||
size_t center = (size_t)item_center < m_rec_idx.size() ? m_rec_idx[item_center] : -1;
|
||||
|
||||
// Rebuild the index.
|
||||
m_rec_idx.clear();
|
||||
@@ -706,12 +706,12 @@ void wxPersistentETWListCtrl::Save() const
|
||||
SaveValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), col.GetWidth());
|
||||
}
|
||||
|
||||
SaveValue(wxT("ScrollAuto" ), wnd->m_scroll_auto);
|
||||
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));
|
||||
wxString data_str;
|
||||
for (wxETWListCtrl::guidset::const_iterator src = wnd->m_sources.cbegin(), src_end = wnd->m_sources.cend(); src != src_end; ++src)
|
||||
data_str += tstring_guid(*src);
|
||||
SaveValue(wxT("Sources"), data_str);
|
||||
|
||||
SaveValue(wxT("Level"), (int)wnd->m_level);
|
||||
}
|
||||
@@ -735,24 +735,24 @@ bool wxPersistentETWListCtrl::Restore()
|
||||
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)) {
|
||||
wxString data_str;
|
||||
if (RestoreValue(wxT("Sources"), &data_str)) {
|
||||
for (size_t i = 0; (i = data_str.find(wxT('{'), i)) != std::string::npos;) {
|
||||
GUID guid;
|
||||
if (StringToGuid(guid_str.c_str(), &guid))
|
||||
if (StringToGuid(data_str.data() + i, &guid)) {
|
||||
wnd->m_sources.insert(guid);
|
||||
}
|
||||
i += 38;
|
||||
} else
|
||||
i++;
|
||||
}
|
||||
} 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);
|
||||
int data_int;
|
||||
if (RestoreValue(wxT("Level"), &data_int))
|
||||
wnd->m_level = (UCHAR)std::min<int>(std::max<int>(data_int, TRACE_LEVEL_ERROR), TRACE_LEVEL_VERBOSE);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -762,18 +762,18 @@ bool wxPersistentETWListCtrl::Restore()
|
||||
// Local helper functions
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ LPCBYTE pData)
|
||||
static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ ULONG ulData)
|
||||
{
|
||||
if ( (pMapInfo->Flag & EVENTMAP_INFO_FLAG_MANIFEST_VALUEMAP) ||
|
||||
((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_VALUEMAP ) && (pMapInfo->Flag & ~EVENTMAP_INFO_FLAG_WBEM_VALUEMAP) != EVENTMAP_INFO_FLAG_WBEM_FLAG))
|
||||
{
|
||||
if ((pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_NO_MAP) == EVENTMAP_INFO_FLAG_WBEM_NO_MAP)
|
||||
return tstring_printf(_T("%ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[*(PULONG)pData].OutputOffset);
|
||||
return tstring_printf(_T("%ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[ulData].OutputOffset);
|
||||
else {
|
||||
for (ULONG i = 0; ; i++) {
|
||||
if (i >= pMapInfo->EntryCount)
|
||||
return tstring_printf(_T("%lu"), *(PULONG)pData);
|
||||
else if (pMapInfo->MapEntryArray[i].Value == *(PULONG)pData)
|
||||
return tstring_printf(_T("%lu"), ulData);
|
||||
else if (pMapInfo->MapEntryArray[i].Value == ulData)
|
||||
return tstring_printf(_T("%ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[i].OutputOffset);
|
||||
}
|
||||
}
|
||||
@@ -786,15 +786,15 @@ static tstring MapToString(_In_ const EVENT_MAP_INFO *pMapInfo, _In_ LPCBYTE pDa
|
||||
|
||||
if (pMapInfo->Flag & EVENTMAP_INFO_FLAG_WBEM_NO_MAP) {
|
||||
for (ULONG i = 0; i < pMapInfo->EntryCount; i++)
|
||||
if (*(PULONG)pData & (1 << i))
|
||||
if (ulData & (1 << i))
|
||||
out.append(tstring_printf(out.empty() ? _T("%ls") : _T(" | %ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[i].OutputOffset));
|
||||
} else {
|
||||
for (ULONG i = 0; i < pMapInfo->EntryCount; i++)
|
||||
if ((pMapInfo->MapEntryArray[i].Value & *(PULONG)pData) == pMapInfo->MapEntryArray[i].Value)
|
||||
if ((pMapInfo->MapEntryArray[i].Value & ulData) == pMapInfo->MapEntryArray[i].Value)
|
||||
out.append(tstring_printf(out.empty() ? _T("%ls") : _T(" | %ls"), (PBYTE)pMapInfo + pMapInfo->MapEntryArray[i].OutputOffset));
|
||||
}
|
||||
|
||||
return out.empty() ? tstring_printf(_T("%lu"), *(PULONG)pData) : out;
|
||||
return out.empty() ? tstring_printf(_T("%lu"), ulData) : out;
|
||||
}
|
||||
|
||||
return _T("<unknown map>");
|
||||
@@ -875,7 +875,7 @@ static tstring DataToString(_In_ USHORT InType, _In_ USHORT OutType, _In_count_(
|
||||
case TDH_OUTTYPE_NTSTATUS :
|
||||
case TDH_OUTTYPE_HEXINT32 : return tstring_printf(_T("0x%x" ), *(PULONG)pData);
|
||||
case TDH_OUTTYPE_IPV4 : return tstring_printf(_T("%d.%d.%d.%d"), (*(PULONG)pData >> 0) & 0xff, (*(PULONG)pData >> 8) & 0xff, (*(PULONG)pData >> 16) & 0xff, (*(PULONG)pData >> 24) & 0xff);
|
||||
default: return pMapInfo ? MapToString(pMapInfo, pData) : tstring_printf(_T("%lu"), *(PULONG)pData);
|
||||
default: return pMapInfo ? MapToString(pMapInfo, *(PULONG)pData) : tstring_printf(_T("%lu"), *(PULONG)pData);
|
||||
}
|
||||
|
||||
case TDH_INTYPE_HEXINT32:
|
||||
@@ -1105,8 +1105,9 @@ static tstring PropertyToString(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, U
|
||||
// in the EVENT_MAP_ENTRY structure. Replace the trailing space with a null-
|
||||
// terminating character, so that the bit mapped strings are correctly formatted.
|
||||
for (ULONG i = 0; i < map_info->EntryCount; i++) {
|
||||
SIZE_T len = _tcslen((LPCTSTR)((PBYTE)map_info.get() + map_info->MapEntryArray[i].OutputOffset)) - 1;
|
||||
((LPWSTR)((PBYTE)map_info.get() + map_info->MapEntryArray[i].OutputOffset))[len] = 0;
|
||||
LPWSTR str = (LPWSTR)((PBYTE)map_info.get() + map_info->MapEntryArray[i].OutputOffset);
|
||||
SIZE_T len = wcslen(str);
|
||||
if (len) str[len - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -122,7 +122,11 @@
|
||||
<None Include="res\EventMonitor.ico" />
|
||||
<None Include="wxEventMonitor_UI.fbp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<POCompile Include="locale\sl_SI.po" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\include\xgettext.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -74,4 +74,9 @@
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<POCompile Include="locale\sl_SI.po">
|
||||
<Filter>Resource Files\Localization</Filter>
|
||||
</POCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -139,11 +139,11 @@ wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const
|
||||
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_menuViewToolbarEdit = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_EDIT, wxString::Format(_("%s toolbar"), _("&Edit")), wxString::Format(_("Toggles display of %s toolbar"), _("View")), wxITEM_CHECK);
|
||||
m_menuView->Append(m_menuViewToolbarEdit);
|
||||
|
||||
wxMenuItem* m_menuViewToolbarView;
|
||||
m_menuViewToolbarView = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_VIEW, _("&View toolbar"), _("Toggles display of View toolbar"), wxITEM_CHECK);
|
||||
m_menuViewToolbarView = new wxMenuItem(m_menuView, wxID_VIEW_TOOLBAR_VIEW, wxString::Format(_("%s toolbar"), _("&View")), wxString::Format(_("Toggles display of %s toolbar"), _("View")), wxITEM_CHECK);
|
||||
m_menuView->Append(m_menuViewToolbarView);
|
||||
|
||||
m_menubar->Append(m_menuView, _("&View"));
|
||||
@@ -186,7 +186,7 @@ wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const
|
||||
|
||||
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_mgr.AddPane(m_panel, wxAuiPaneInfo() .Name(wxT("LogPanel")).Center() .Caption(_("Trace Log")).CaptionVisible(false).CloseButton(false).PaneBorder(false).Dock().Resizable().FloatingSize(wxDefaultSize).Floatable(false));
|
||||
|
||||
m_statusBar = this->CreateStatusBar(1, wxST_SIZEGRIP, wxID_ANY);
|
||||
|
||||
|
Binary file not shown.
1
EventMonitor/locale/.gitignore
vendored
Normal file
1
EventMonitor/locale/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/*.mo
|
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EventMonitor\n"
|
||||
"POT-Creation-Date: 2016-08-27 07:52+0200\n"
|
||||
"POT-Creation-Date: 2016-08-31 02:51+0200\n"
|
||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||
@@ -17,7 +17,7 @@ msgstr ""
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: App.cpp:69 Frame.h:67 MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: App.cpp:61 Frame.h:67 MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "Event Monitor"
|
||||
msgstr ""
|
||||
@@ -27,41 +27,41 @@ msgstr ""
|
||||
msgid "Error opening event trace (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:171
|
||||
#: ETWLog.cpp:167
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:172
|
||||
#: ETWLog.cpp:168
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:173
|
||||
#: ETWLog.cpp:169
|
||||
msgid "TID"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:174
|
||||
#: ETWLog.cpp:170
|
||||
msgid "Source"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:175
|
||||
#: ETWLog.cpp:171
|
||||
msgid "Event"
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:232
|
||||
#: ETWLog.cpp:228
|
||||
msgid "Access denied creating event session: you need administrative privileges (Run As Administrator) or be a member of Performance Log Users group to start event tracing session."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:235
|
||||
#: ETWLog.cpp:231
|
||||
#, c-format
|
||||
msgid "The %s event session already exists."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:239
|
||||
#: ETWLog.cpp:235
|
||||
#, c-format
|
||||
msgid "Error creating event session (error %u)."
|
||||
msgstr ""
|
||||
|
||||
#: ETWLog.cpp:255 ETWLog.cpp:270 ETWLog.cpp:284
|
||||
#: ETWLog.cpp:251 ETWLog.cpp:267 ETWLog.cpp:281
|
||||
#, c-format
|
||||
msgid "Error enabling %s event provider (error %u)."
|
||||
msgstr ""
|
||||
@@ -80,9 +80,8 @@ msgid "Quits this program"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:69
|
||||
#, fuzzy
|
||||
msgid "&Program"
|
||||
msgstr "You don't have %s subscription yet."
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:78
|
||||
msgid "Copy A&ll"
|
||||
@@ -116,7 +115,7 @@ msgstr ""
|
||||
msgid "Clears record selection"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:97
|
||||
#: Frame.cpp:97 Frame.cpp:142
|
||||
msgid "&Edit"
|
||||
msgstr ""
|
||||
|
||||
@@ -153,31 +152,28 @@ 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!)."
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:135 Frame.cpp:182
|
||||
msgid "Displays error level records only"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:142
|
||||
msgid "&Edit toolbar"
|
||||
#: Frame.cpp:142 Frame.cpp:146
|
||||
#, c-format
|
||||
msgid "%s toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:142
|
||||
msgid "Toggles display of Edit toolbar"
|
||||
#: Frame.cpp:142 Frame.cpp:146
|
||||
#, c-format
|
||||
msgid "Toggles display of %s toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:146
|
||||
msgid "&View toolbar"
|
||||
#: Frame.cpp:142 Frame.cpp:146 Frame.cpp:185
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:146
|
||||
msgid "Toggles display of View toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:149
|
||||
#: Frame.cpp:146 Frame.cpp:149
|
||||
msgid "&View"
|
||||
msgstr ""
|
||||
|
||||
@@ -201,21 +197,16 @@ msgstr ""
|
||||
msgid "Auto Scroll"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:185
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#: Frame.cpp:189
|
||||
msgid "Log Trace"
|
||||
msgid "Trace Log"
|
||||
msgstr ""
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:3
|
||||
#, fuzzy
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
msgstr ""
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
|
||||
@@ -223,8 +214,6 @@ 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 ""
|
||||
|
226
EventMonitor/locale/sl_SI.po
Normal file
226
EventMonitor/locale/sl_SI.po
Normal file
@@ -0,0 +1,226 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: EventMonitor\n"
|
||||
"POT-Creation-Date: 2016-08-31 02:51+0200\n"
|
||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
|
||||
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sl_SI\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: App.cpp:61 Frame.h:67 MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "Event Monitor"
|
||||
msgstr "Nadzornik dogodkov"
|
||||
|
||||
#: ETWLog.cpp:83
|
||||
#, c-format
|
||||
msgid "Error opening event trace (error %u)."
|
||||
msgstr "Napaka pri odpiranju sledenja dogodkom (napaka %u)."
|
||||
|
||||
#: ETWLog.cpp:167
|
||||
msgid "Time"
|
||||
msgstr "Čas"
|
||||
|
||||
#: ETWLog.cpp:168
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: ETWLog.cpp:169
|
||||
msgid "TID"
|
||||
msgstr "TID"
|
||||
|
||||
#: ETWLog.cpp:170
|
||||
msgid "Source"
|
||||
msgstr "Vir"
|
||||
|
||||
#: ETWLog.cpp:171
|
||||
msgid "Event"
|
||||
msgstr "Dogodek"
|
||||
|
||||
#: ETWLog.cpp:228
|
||||
msgid ""
|
||||
"Access denied creating event session: you need administrative privileges "
|
||||
"(Run As Administrator) or be a member of Performance Log Users group to "
|
||||
"start event tracing session."
|
||||
msgstr ""
|
||||
"Dostop pri ustvarjanju seje dogodkov zavrnjen: potrebujete skrbniške pravice"
|
||||
" (Zaženi kot skrbnik) ali biti član skupine »Performance Log Users« za zagon"
|
||||
" seje sledenja dogodkov."
|
||||
|
||||
#: ETWLog.cpp:231
|
||||
#, c-format
|
||||
msgid "The %s event session already exists."
|
||||
msgstr "Seja dogodkov %s že obstaja."
|
||||
|
||||
#: ETWLog.cpp:235
|
||||
#, c-format
|
||||
msgid "Error creating event session (error %u)."
|
||||
msgstr "Napaka pri ustvarjanju seje dogodkov (napaka %u)."
|
||||
|
||||
#: ETWLog.cpp:251 ETWLog.cpp:267 ETWLog.cpp:281
|
||||
#, c-format
|
||||
msgid "Error enabling %s event provider (error %u)."
|
||||
msgstr "Napaka pri omogočanju ponudnika dogodkov %s (napaka %u)."
|
||||
|
||||
#: Frame.cpp:48 Frame.cpp:108 Frame.cpp:113 Frame.cpp:168 Frame.cpp:170
|
||||
#, c-format
|
||||
msgid "Toggles display of %s records"
|
||||
msgstr "Obrne prikaz zapisov %s"
|
||||
|
||||
#: Frame.cpp:65
|
||||
msgid "E&xit"
|
||||
msgstr "I&zhod"
|
||||
|
||||
#: Frame.cpp:65
|
||||
msgid "Quits this program"
|
||||
msgstr "Konča ta program"
|
||||
|
||||
#: Frame.cpp:69
|
||||
msgid "&Program"
|
||||
msgstr "&Program"
|
||||
|
||||
#: Frame.cpp:78
|
||||
msgid "Copy A&ll"
|
||||
msgstr "Kopiraj &vse"
|
||||
|
||||
#: Frame.cpp:78 Frame.cpp:156
|
||||
msgid "Copies all records to clipboard (including hidden)"
|
||||
msgstr "Kopira vse zapise na odložišče (tudi skrite)"
|
||||
|
||||
#: Frame.cpp:83 Frame.cpp:158
|
||||
msgid "Clear"
|
||||
msgstr "Počisti"
|
||||
|
||||
#: Frame.cpp:83 Frame.cpp:158
|
||||
msgid "Clears all records from the log"
|
||||
msgstr "Počisti vse zapise iz dnevnika"
|
||||
|
||||
#: Frame.cpp:90
|
||||
msgid "Select &All"
|
||||
msgstr "Izberi &vse"
|
||||
|
||||
#: Frame.cpp:90
|
||||
msgid "Selects all visible records"
|
||||
msgstr "Izbere vse vidne zapise"
|
||||
|
||||
#: Frame.cpp:94
|
||||
msgid "Select &None"
|
||||
msgstr "Izberi &nič"
|
||||
|
||||
#: Frame.cpp:94
|
||||
msgid "Clears record selection"
|
||||
msgstr "Počisti izbor zapisov"
|
||||
|
||||
#: Frame.cpp:97 Frame.cpp:142
|
||||
msgid "&Edit"
|
||||
msgstr "Ur&edi"
|
||||
|
||||
#: Frame.cpp:101
|
||||
msgid "Auto &Scroll"
|
||||
msgstr "&Samodrsenje"
|
||||
|
||||
#: Frame.cpp:101 Frame.cpp:164
|
||||
msgid "Automatically scrolls to the most recent records as they come-in"
|
||||
msgstr "Samodejno pomikaj do najbolj zadnjega zapisa, ko prihajajo"
|
||||
|
||||
#: Frame.cpp:123 Frame.cpp:176
|
||||
msgid "Verbose"
|
||||
msgstr "Podrobno"
|
||||
|
||||
#: Frame.cpp:123 Frame.cpp:176
|
||||
msgid "Displays all levels of records"
|
||||
msgstr "Prikaže vse ravni zapisov"
|
||||
|
||||
#: Frame.cpp:127 Frame.cpp:178
|
||||
msgid "Informational"
|
||||
msgstr "Informativno"
|
||||
|
||||
#: Frame.cpp:127 Frame.cpp:178
|
||||
msgid "Displays all records up to informational level"
|
||||
msgstr "Prikaže vse zapise do informativne ravni"
|
||||
|
||||
#: Frame.cpp:131 Frame.cpp:180
|
||||
msgid "Warning"
|
||||
msgstr "Opozorilo"
|
||||
|
||||
#: Frame.cpp:131 Frame.cpp:180
|
||||
msgid "Displays all records up to warning level"
|
||||
msgstr "Prikaže vse zapise do opozorilne ravni"
|
||||
|
||||
#: Frame.cpp:135 Frame.cpp:182
|
||||
msgid "Error"
|
||||
msgstr "Napaka"
|
||||
|
||||
#: Frame.cpp:135 Frame.cpp:182
|
||||
msgid "Displays error level records only"
|
||||
msgstr "Prikaže samo zapise ravni napak"
|
||||
|
||||
#: Frame.cpp:142 Frame.cpp:146
|
||||
#, c-format
|
||||
msgid "%s toolbar"
|
||||
msgstr "Orodna vrstica %s"
|
||||
|
||||
#: Frame.cpp:142 Frame.cpp:146
|
||||
#, c-format
|
||||
msgid "Toggles display of %s toolbar"
|
||||
msgstr "Obrne prikaz orodne vrstice %s"
|
||||
|
||||
#: Frame.cpp:142 Frame.cpp:146 Frame.cpp:185
|
||||
msgid "View"
|
||||
msgstr "Pogled"
|
||||
|
||||
#: Frame.cpp:146 Frame.cpp:149
|
||||
msgid "&View"
|
||||
msgstr "Po&gled"
|
||||
|
||||
#: Frame.cpp:154
|
||||
msgid "Copy"
|
||||
msgstr "Kopiraj"
|
||||
|
||||
#: Frame.cpp:154
|
||||
msgid "Copies selected records to clipboard"
|
||||
msgstr "Kopira izbrane zapise na odložišče"
|
||||
|
||||
#: Frame.cpp:156
|
||||
msgid "Copy All"
|
||||
msgstr "Kopiraj vse"
|
||||
|
||||
#: Frame.cpp:161
|
||||
msgid "Edit"
|
||||
msgstr "Uredi"
|
||||
|
||||
#: Frame.cpp:164
|
||||
msgid "Auto Scroll"
|
||||
msgstr "Samodrsenje"
|
||||
|
||||
#: Frame.cpp:189
|
||||
msgid "Trace Log"
|
||||
msgstr "Dnevnik sledenja"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:3
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
|
||||
msgid "EVENTM~1|GÉANTLink Event Monitor"
|
||||
msgstr "EVENTM~1|Nadzornik dogodkov GÉANTLink"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "Real-time display of internal events"
|
||||
msgstr "Prikazovalnik notranjih dogodkov v realnem času"
|
@@ -18,7 +18,7 @@ wxEventMonitorLogPanelBase::wxEventMonitorLogPanelBase( wxWindow* parent, wxWind
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER );
|
||||
m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER, wxDefaultValidator, wxT("EventMonitorLog") );
|
||||
bSizerMain->Add( m_log, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@@ -141,7 +141,7 @@
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_name">EventMonitorLog</property>
|
||||
<property name="window_style">wxNO_BORDER</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
|
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: GÉANTLink MSI\n"
|
||||
"POT-Creation-Date: 2016-07-15 10:51+0200\n"
|
||||
"POT-Creation-Date: 2016-08-31 14:33+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,25 +17,20 @@ msgstr ""
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: En.Win32.Release.Property-2.idtx:6 En.x64.Release.Property-2.idtx:6
|
||||
msgid "+386 1 8311 035"
|
||||
#: En.Win32.Release.LaunchCondition-2.idtx:4
|
||||
#: En.x64.Release.LaunchCondition-2.idtx:4
|
||||
msgid "[ProductName] requires Windows Vista or later version of Windows."
|
||||
msgstr ""
|
||||
|
||||
#: En.Win32.Release.Property-2.idtx:3 En.x64.Release.Property-2.idtx:3
|
||||
#, fuzzy
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
|
||||
#: En.Win32.Release.Property-2.idtx:5 En.x64.Release.Property-2.idtx:5
|
||||
msgid "Amebis, p. p. 69, SI-1241 Kamnik, Slovenia, E.U."
|
||||
msgstr ""
|
||||
|
||||
#: En.Win32.Release.Property-2.idtx:4 En.x64.Release.Property-2.idtx:4
|
||||
msgid "Amebis, Slovenia, E.U."
|
||||
#: En.Win32.Release.Property-2.idtx:4 En.Win32.Release.Property-2.idtx:5
|
||||
#: En.x64.Release.Property-2.idtx:4 En.x64.Release.Property-2.idtx:5
|
||||
msgid "http://www.geant.org/"
|
||||
msgstr ""
|
||||
|
||||
#: En.Win32.Release.Property-2.idtx:7 En.Win32.Release.Property-2.idtx:8
|
||||
#: En.Win32.Release.Property-2.idtx:9 En.x64.Release.Property-2.idtx:7
|
||||
#: En.x64.Release.Property-2.idtx:8 En.x64.Release.Property-2.idtx:9
|
||||
msgid "http://www.amebis.si/"
|
||||
#: En.Win32.Release.Property-2.idtx:6 En.x64.Release.Property-2.idtx:6
|
||||
msgid "https://github.com/Amebis/GEANTLink/releases"
|
||||
msgstr ""
|
||||
|
Submodule MSI/MSIBuild updated: 7a459c8c6c...43f8632406
@@ -42,7 +42,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MsiUseFeature", "MsiUseFeat
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventMonitor", "EventMonitor\EventMonitor.vcxproj", "{E0D0725B-B2FC-4225-9481-CA9B1B6306F2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtendLib", "lib\wxExtend\build\wxExtendLib.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WLANManager", "WLANManager\WLANManager.vcxproj", "{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2", "lib\MSCHAPv2\build\MSCHAPv2.vcxproj", "{86A6D6A0-4B7D-4134-BE81-A5755C77584D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2_UI", "lib\MSCHAPv2_UI\build\MSCHAPv2_UI.vcxproj", "{7AF5B922-7C17-428A-97E0-09E3B41A684D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -180,6 +186,30 @@ Global
|
||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.Build.0 = Release|Win32
|
||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.ActiveCfg = Release|x64
|
||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.Build.0 = Release|x64
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Debug|x64.Build.0 = Debug|x64
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|Win32.Build.0 = Release|Win32
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|x64.ActiveCfg = Release|x64
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}.Release|x64.Build.0 = Release|x64
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Debug|x64.Build.0 = Debug|x64
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Release|Win32.Build.0 = Release|Win32
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Release|x64.ActiveCfg = Release|x64
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D}.Release|x64.Build.0 = Release|x64
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Debug|x64.Build.0 = Debug|x64
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|Win32.Build.0 = Release|Win32
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x64.ActiveCfg = Release|x64
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -198,8 +228,11 @@ Global
|
||||
{9A25C261-8ADE-4938-8393-E857EF0E37E9} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
|
||||
{42F0F0F4-C928-4860-A4E4-94991C2C3D90} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
|
||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
|
||||
{86A6D6A0-4B7D-4134-BE81-A5755C77584D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
|
||||
{7AF5B922-7C17-428A-97E0-09E3B41A684D} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393}
|
||||
{2D3CE079-7EB1-4F47-B79E-F0310671ECCB} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
|
||||
{679D03C5-CD70-4FFA-93F8-A4AB3637509B} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
|
||||
{E0D0725B-B2FC-4225-9481-CA9B1B6306F2} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
|
||||
{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
2
WLANManager/.gitignore
vendored
Normal file
2
WLANManager/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/temp
|
||||
/*.user
|
9
WLANManager/MSIBuild/.gitignore
vendored
Normal file
9
WLANManager/MSIBuild/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/*-1.idt
|
||||
/*-2.idt
|
||||
/*-2.idtx
|
||||
/*.Binary-1
|
||||
/*.Binary-2
|
||||
/*.Icon-1
|
||||
/*.Icon-2
|
||||
/*.lst
|
||||
/*.msm
|
BIN
WLANManager/MSIBuild/Makefile
Normal file
BIN
WLANManager/MSIBuild/Makefile
Normal file
Binary file not shown.
136
WLANManager/Main.cpp
Normal file
136
WLANManager/Main.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#pragma comment(lib, "Wlanapi.lib")
|
||||
#pragma comment(lib, "Wlanui.lib")
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
DWORD (WINAPI *pfnWlanReasonCodeToString)(__in DWORD dwReasonCode, __in DWORD dwBufferSize, __in_ecount(dwBufferSize) PWCHAR pStringBuffer, __reserved PVOID pReserved);
|
||||
|
||||
|
||||
static int DisplayError(_In_z_ _Printf_format_string_ LPCTSTR format, ...)
|
||||
{
|
||||
va_list arg;
|
||||
va_start(arg, format);
|
||||
tstring msg;
|
||||
vsprintf(msg, format, arg);
|
||||
va_end(arg);
|
||||
|
||||
return MessageBox(NULL, msg.c_str(), _T("WLANManager"), MB_OK);
|
||||
}
|
||||
|
||||
|
||||
static int WLANManager()
|
||||
{
|
||||
int nArgs;
|
||||
unique_ptr<LPWSTR[], LocalFree_delete<LPWSTR[]> > pwcArglist(CommandLineToArgvW(GetCommandLineW(), &nArgs));
|
||||
if (pwcArglist == NULL) {
|
||||
DisplayError(_T("%s function failed (error %u)."), _T("CommandLineToArgvW"), GetLastError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (nArgs < 3) {
|
||||
DisplayError(_T("Not enough parameters."));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_wcsicmp(pwcArglist[1], L"profile") != 0) {
|
||||
DisplayError(_T("Unknown command (%ls)."), pwcArglist[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Open WLAN handle.
|
||||
DWORD dwNegotiatedVersion;
|
||||
wlan_handle wlan;
|
||||
if (!wlan.open(WLAN_API_MAKE_VERSION(2, 0), &dwNegotiatedVersion)) {
|
||||
DisplayError(_T("%s function failed (error %u)."), _T("WlanOpenHandle"), GetLastError());
|
||||
return 2;
|
||||
} else if (dwNegotiatedVersion < WLAN_API_MAKE_VERSION(2, 0)) {
|
||||
DisplayError(_T("WlanOpenHandle negotiated unsupported version (expected: %u, negotiated: %u)."), WLAN_API_MAKE_VERSION(2, 0), dwNegotiatedVersion);
|
||||
return 3;
|
||||
}
|
||||
|
||||
unique_ptr<WLAN_INTERFACE_INFO_LIST, WlanFreeMemory_delete<WLAN_INTERFACE_INFO_LIST> > interfaces;
|
||||
{
|
||||
// Get a list of WLAN interfaces.
|
||||
WLAN_INTERFACE_INFO_LIST *pInterfaceList;
|
||||
DWORD dwResult = WlanEnumInterfaces(wlan, NULL, &pInterfaceList);
|
||||
if (dwResult != ERROR_SUCCESS) {
|
||||
DisplayError(_T("%s function failed (error %u)."), _T("WlanEnumInterfaces"), dwResult);
|
||||
return 4;
|
||||
}
|
||||
interfaces.reset(pInterfaceList);
|
||||
}
|
||||
|
||||
for (DWORD i = 0; i < interfaces->dwNumberOfItems; i++) {
|
||||
if (interfaces->InterfaceInfo[i].isState == wlan_interface_state_not_ready) {
|
||||
// This interface is not ready.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Launch WLAN profile config dialog.
|
||||
// Note: When a debugger is attached to this process the WlanUIEditProfile() will raise an exception and fail.
|
||||
WLAN_REASON_CODE wlrc;
|
||||
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
|
||||
if (dwResult != ERROR_SUCCESS) {
|
||||
DisplayError(_T("%s function failed (error %u)."), _T("WlanUIEditProfile"), dwResult);
|
||||
return 5;
|
||||
}
|
||||
if (wlrc != WLAN_REASON_CODE_SUCCESS) {
|
||||
tstring reason;
|
||||
if (WlanReasonCodeToString(wlrc, reason, NULL) == ERROR_SUCCESS)
|
||||
DisplayError(_T("%s function failed: %s"), _T("WlanUIEditProfile"), reason.c_str());
|
||||
else
|
||||
DisplayError(_T("%s function failed (reason code: %u)."), _T("WlanUIEditProfile"), wlrc);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hInstance);
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
UNREFERENCED_PARAMETER(nCmdShow);
|
||||
|
||||
{
|
||||
// Initialize Windows XP visual styles
|
||||
INITCOMMONCONTROLSEX icc;
|
||||
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||
icc.dwICC = ICC_WIN95_CLASSES | ICC_STANDARD_CLASSES | ICC_LINK_CLASS;
|
||||
InitCommonControlsEx(&icc);
|
||||
}
|
||||
|
||||
pfnWlanReasonCodeToString = WlanReasonCodeToString;
|
||||
|
||||
int res = WLANManager();
|
||||
|
||||
assert(!_CrtDumpMemoryLeaks());
|
||||
return res;
|
||||
}
|
18
WLANManager/README.md
Normal file
18
WLANManager/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
#WLANManager
|
||||
Invokes standard Windows Wireless Network Properties dialog
|
||||
|
||||
##Usage
|
||||
```
|
||||
WLANManager profile <name>
|
||||
```
|
||||
|
||||
- `name` - The name of the network profile (not neccessarely the same as SSID)
|
||||
|
||||
Return codes:
|
||||
- -1 = Invalid parameters
|
||||
- 0 = Success
|
||||
- 1 = Error parsing command line
|
||||
- 2 = WLAN handle could not be opened
|
||||
- 3 = WLAN provider negotiated unsupported version
|
||||
- 4 = Interface enumeration failed
|
||||
- 5 = Edit profile UI failed
|
21
WLANManager/StdAfx.cpp
Normal file
21
WLANManager/StdAfx.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
33
WLANManager/StdAfx.h
Normal file
33
WLANManager/StdAfx.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../lib/EAPBase_UI/include/EAP_UI.h"
|
||||
|
||||
#include <WinStd/Common.h>
|
||||
#include <WinStd/Win.h>
|
||||
#include <WinStd/WLAN.h>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <CommCtrl.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include <memory>
|
14
WLANManager/WLANManager.props
Normal file
14
WLANManager/WLANManager.props
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\lib\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\lib\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
BIN
WLANManager/WLANManager.rc
Normal file
BIN
WLANManager/WLANManager.rc
Normal file
Binary file not shown.
112
WLANManager/WLANManager.vcxproj
Normal file
112
WLANManager/WLANManager.vcxproj
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{BFCAA3B4-97A9-4EA9-8FE1-F30280142BCC}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>WLANManager</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\include\Win32.props" />
|
||||
<Import Project="..\include\Debug.props" />
|
||||
<Import Project="WLANManager.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\include\x64.props" />
|
||||
<Import Project="..\include\Debug.props" />
|
||||
<Import Project="WLANManager.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\include\Win32.props" />
|
||||
<Import Project="..\include\Release.props" />
|
||||
<Import Project="WLANManager.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\include\x64.props" />
|
||||
<Import Project="..\include\Release.props" />
|
||||
<Import Project="WLANManager.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="WLANManager.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
|
||||
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
<None Include="res\WLANManager.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
41
WLANManager/WLANManager.vcxproj.filters
Normal file
41
WLANManager/WLANManager.vcxproj.filters
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="WLANManager.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
<None Include="res\WLANManager.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
1
WLANManager/locale/.gitignore
vendored
Normal file
1
WLANManager/locale/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/*.mo
|
32
WLANManager/locale/WLANManager.pot
Normal file
32
WLANManager/locale/WLANManager.pot
Normal file
@@ -0,0 +1,32 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WLANManager\n"
|
||||
"POT-Creation-Date: 2016-08-28 12:03+0200\n"
|
||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Language: en_US\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
msgid "1252"
|
||||
msgstr ""
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "Helper utility to support direct shortcuts to Wireless Network Properties"
|
||||
msgstr ""
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "WLAN Manager"
|
||||
msgstr ""
|
37
WLANManager/locale/sl_SI.po
Normal file
37
WLANManager/locale/sl_SI.po
Normal file
@@ -0,0 +1,37 @@
|
||||
# Translators:
|
||||
# Simon Rozman <simon@rozman.si>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WLANManager\n"
|
||||
"POT-Creation-Date: 2016-08-28 12:03+0200\n"
|
||||
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2016\n"
|
||||
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/eduroam_devel/teams/11799/sl_SI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sl_SI\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
|
||||
msgid "1252"
|
||||
msgstr "1250"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid ""
|
||||
"Helper utility to support direct shortcuts to Wireless Network Properties"
|
||||
msgstr ""
|
||||
"Orodje za pomoč, ki omogoča neposredne bližnjice do nastavitev brezžičnega "
|
||||
"omrežja"
|
||||
|
||||
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
|
||||
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
|
||||
msgid "WLAN Manager"
|
||||
msgstr "Upravitelj WLAN"
|
BIN
WLANManager/res/WLANManager.ico
Normal file
BIN
WLANManager/res/WLANManager.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
@@ -43,6 +43,9 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<ResourceCompile />
|
||||
<POCompile>
|
||||
<OutputFile>$(OutDir)..\locale\%(Filename)\$(ProjectName).mo</OutputFile>
|
||||
</POCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
Binary file not shown.
@@ -29,7 +29,7 @@
|
||||
// Product version as a single DWORD
|
||||
// Note: Used for version comparison within C/C++ code.
|
||||
//
|
||||
#define PRODUCT_VERSION 0x00ff0d00
|
||||
#define PRODUCT_VERSION 0x00ff1100
|
||||
|
||||
//
|
||||
// Product version by components
|
||||
@@ -39,26 +39,31 @@
|
||||
//
|
||||
#define PRODUCT_VERSION_MAJ 0
|
||||
#define PRODUCT_VERSION_MIN 255
|
||||
#define PRODUCT_VERSION_REV 13
|
||||
#define PRODUCT_VERSION_REV 17
|
||||
#define PRODUCT_VERSION_BUILD 0
|
||||
|
||||
//
|
||||
// Human readable product version and build year for UI
|
||||
//
|
||||
#define PRODUCT_VERSION_STR "1.0-alpha13"
|
||||
#define PRODUCT_VERSION_STR "1.0-alpha17"
|
||||
#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.13"
|
||||
#define PRODUCT_VERSION_INST "0.255.17"
|
||||
|
||||
//
|
||||
// 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 "{13ADDFF3-B249-4AB5-9FAD-E4CDCED62B11}"
|
||||
#define PRODUCT_VERSION_GUID "{7968E51E-8A49-4316-9444-057295392387}"
|
||||
|
||||
//
|
||||
// Product vendor
|
||||
//
|
||||
#define VENDOR_NAME_STR "GÉANT"
|
||||
|
||||
//
|
||||
// Since the product name is not finally confirmed at the time of
|
||||
|
@@ -90,6 +90,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\Config.cpp" />
|
||||
<ClCompile Include="..\src\Credentials.cpp" />
|
||||
<ClCompile Include="..\src\EAP.cpp" />
|
||||
<ClCompile Include="..\src\Module.cpp" />
|
||||
<ClCompile Include="..\src\Method.cpp" />
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
|
@@ -49,5 +49,8 @@
|
||||
<ClCompile Include="..\src\Module.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\EAP.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -89,6 +89,7 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val);
|
||||
#include <eaptypes.h> // Must include after <Windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
@@ -192,6 +193,9 @@ namespace eap
|
||||
|
||||
public:
|
||||
module &m_module; ///< EAP module
|
||||
|
||||
protected:
|
||||
static const winstd::bstr namespace_eapmetadata;
|
||||
};
|
||||
|
||||
|
||||
@@ -243,6 +247,11 @@ namespace eap
|
||||
/// \returns One of `winstd::eap_type_t` constants.
|
||||
///
|
||||
virtual winstd::eap_type_t get_method_id() const = 0;
|
||||
|
||||
///
|
||||
/// Returns a string identifier of the EAP method type of this configuration
|
||||
///
|
||||
virtual const wchar_t* get_method_str() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -337,6 +346,11 @@ namespace eap
|
||||
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// Creates a blank set of credentials suitable for this method
|
||||
///
|
||||
virtual credentials* make_credentials() const = 0;
|
||||
|
||||
public:
|
||||
bool m_allow_save; ///< Are credentials allowed to be saved to Windows Credential Manager?
|
||||
bool m_use_preshared; ///< Use pre-shared credentials
|
||||
@@ -440,9 +454,25 @@ namespace eap
|
||||
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// Returns provider namespace and ID concatenated
|
||||
///
|
||||
inline std::wstring get_id() const
|
||||
{
|
||||
if (m_namespace.empty())
|
||||
return m_id;
|
||||
else {
|
||||
std::wstring id(m_namespace);
|
||||
id += L':';
|
||||
id += m_id;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring m_namespace; ///< Provider namespace URI
|
||||
std::wstring m_id; ///< Provider ID
|
||||
bool m_read_only; ///< Is profile read-only
|
||||
std::wstring m_id; ///< Profile ID
|
||||
winstd::tstring m_name; ///< Provider name
|
||||
winstd::tstring m_help_email; ///< Helpdesk e-mail
|
||||
winstd::tstring m_help_web; ///< Helpdesk website URL
|
||||
@@ -456,6 +486,9 @@ namespace eap
|
||||
|
||||
class config_connection : public config
|
||||
{
|
||||
public:
|
||||
typedef std::list<eap::config_provider> provider_list;
|
||||
|
||||
public:
|
||||
///
|
||||
/// Constructs configuration
|
||||
@@ -550,7 +583,7 @@ namespace eap
|
||||
/// @}
|
||||
|
||||
public:
|
||||
std::vector<eap::config_provider> m_providers; ///< Array of provider configurations
|
||||
std::list<eap::config_provider> m_providers; ///< Provider configurations
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -31,6 +31,11 @@ namespace eap
|
||||
/// Password based method credentials
|
||||
///
|
||||
class credentials_pass;
|
||||
|
||||
///
|
||||
/// Connection credentials
|
||||
///
|
||||
class credentials_connection;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
@@ -47,6 +52,7 @@ namespace eap
|
||||
#include <tchar.h>
|
||||
#include <wincred.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -217,6 +223,27 @@ namespace eap
|
||||
///
|
||||
virtual winstd::tstring get_name() const;
|
||||
|
||||
///
|
||||
/// Combine credentials in the following order:
|
||||
///
|
||||
/// 1. Cached credentials
|
||||
/// 2. Pre-configured credentials
|
||||
/// 3. Stored credentials
|
||||
///
|
||||
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be the same type of credentials as `this`)
|
||||
/// \param[in] cfg Method configuration (must be the same type of configuration as `this` credentials belong to)
|
||||
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
|
||||
///
|
||||
/// \returns
|
||||
/// - \c source_cache Credentials were obtained from EapHost cache
|
||||
/// - \c source_preshared Credentials were set by method configuration
|
||||
/// - \c source_storage Credentials were loaded from Windows Credential Manager
|
||||
///
|
||||
virtual source_t combine(
|
||||
_In_ const credentials *cred_cached,
|
||||
_In_ const config_method_with_cred &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName) = 0;
|
||||
|
||||
public:
|
||||
std::wstring m_identity; ///< Identity (username\@domain, certificate name etc.)
|
||||
};
|
||||
@@ -351,4 +378,133 @@ namespace eap
|
||||
static const unsigned char s_entropy[1024];
|
||||
/// \endcond
|
||||
};
|
||||
|
||||
|
||||
class credentials_connection : public config
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs credentials
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Connection configuration
|
||||
///
|
||||
credentials_connection(_In_ module &mod, _In_ const config_connection &cfg);
|
||||
|
||||
///
|
||||
/// Copies credentials
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
credentials_connection(_In_ const credentials_connection &other);
|
||||
|
||||
///
|
||||
/// Moves credentials
|
||||
///
|
||||
/// \param[in] other Credentials to move from
|
||||
///
|
||||
credentials_connection(_Inout_ credentials_connection &&other);
|
||||
|
||||
///
|
||||
/// Copies credentials
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
credentials_connection& operator=(_In_ const credentials_connection &other);
|
||||
|
||||
///
|
||||
/// Moves credentials
|
||||
///
|
||||
/// \param[in] other Credentials to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
credentials_connection& operator=(_Inout_ credentials_connection &&other);
|
||||
|
||||
///
|
||||
/// Clones configuration
|
||||
///
|
||||
/// \returns Pointer to cloned configuration
|
||||
///
|
||||
virtual config* clone() 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);
|
||||
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// Returns provider namespace and ID concatenated
|
||||
///
|
||||
inline std::wstring get_id() const
|
||||
{
|
||||
if (m_namespace.empty())
|
||||
return m_id;
|
||||
else {
|
||||
std::wstring id(m_namespace);
|
||||
id += L':';
|
||||
id += m_id;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Checks if credentials match given provider.
|
||||
///
|
||||
inline bool match(_In_ const config_provider &cfg_provider) const
|
||||
{
|
||||
return
|
||||
_wcsicmp(m_namespace.c_str(), cfg_provider.m_namespace.c_str()) == 0 &&
|
||||
_wcsicmp(m_id .c_str(), cfg_provider.m_id .c_str()) == 0;
|
||||
}
|
||||
|
||||
public:
|
||||
const config_connection& m_cfg; ///< Connection configuration
|
||||
std::wstring m_namespace; ///< Provider namespace URI
|
||||
std::wstring m_id; ///< Provider ID
|
||||
std::unique_ptr<credentials> m_cred; ///< Credentials
|
||||
};
|
||||
}
|
||||
|
@@ -82,9 +82,19 @@ namespace eap
|
||||
enum diameter_avp_flags_t;
|
||||
|
||||
///
|
||||
/// Diameter AVP
|
||||
/// Diameter AVP header
|
||||
///
|
||||
struct diameter_avp;
|
||||
struct diameter_avp_header;
|
||||
|
||||
///
|
||||
/// Diameter AVP header with Vendor-ID
|
||||
///
|
||||
struct diameter_avp_header_ven;
|
||||
|
||||
///
|
||||
/// EAP packet
|
||||
///
|
||||
class packet;
|
||||
}
|
||||
|
||||
///
|
||||
@@ -418,15 +428,23 @@ 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.
|
||||
/// Converts an unsigned __int64 from host to TCP/IP network byte order.
|
||||
///
|
||||
/// \param[in] val A 64-bit unsigned number in host byte order.
|
||||
/// \param[in] val A 64-bit unsigned number in host byte order
|
||||
///
|
||||
/// \returns The value in TCP/IP's network byte order.
|
||||
/// \returns The value in TCP/IP's network byte order
|
||||
///
|
||||
inline unsigned __int64 htonll(unsigned __int64 val);
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Converts an 24-bit integer from host to TCP/IP network byte order.
|
||||
///
|
||||
/// \param[in ] val A 24-bit unsigned number in host byte order
|
||||
/// \param[out] out A 24-bit unsigned number in network byte order
|
||||
///
|
||||
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3]);
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -615,29 +633,79 @@ namespace eap
|
||||
enum diameter_avp_flags_t : unsigned char {
|
||||
diameter_avp_flag_vendor = 0x80, ///< Vendor-ID present
|
||||
diameter_avp_flag_mandatory = 0x40, ///< Mandatory
|
||||
diameter_avp_flag_protected = 0x20, ///< Protected
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct diameter_avp
|
||||
|
||||
struct diameter_avp_header
|
||||
{
|
||||
unsigned char code[4]; ///< AVP Code
|
||||
unsigned char flags; ///< AVP Flags
|
||||
unsigned char length[3]; ///< AVP Length
|
||||
};
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4201)
|
||||
union {
|
||||
struct {
|
||||
|
||||
struct diameter_avp_header_ven : public diameter_avp_header
|
||||
{
|
||||
unsigned char vendor[4]; ///< Vendor-ID
|
||||
unsigned char v_data[1]; ///< Data (when Vendor-ID present)
|
||||
};
|
||||
unsigned char data[1]; ///< Data (when Vendor-ID absent)
|
||||
};
|
||||
#pragma warning(pop)
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
class packet
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs an empty packet
|
||||
///
|
||||
packet();
|
||||
|
||||
///
|
||||
/// Copies a packet
|
||||
///
|
||||
/// \param[in] other Packet to copy from
|
||||
///
|
||||
packet(_In_ const packet &other);
|
||||
|
||||
///
|
||||
/// Moves a packet
|
||||
///
|
||||
/// \param[in] other Packet to move from
|
||||
///
|
||||
packet(_Inout_ packet &&other);
|
||||
|
||||
///
|
||||
/// Copies a packet
|
||||
///
|
||||
/// \param[in] other Packet to copy from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
packet& operator=(_In_ const packet &other);
|
||||
|
||||
///
|
||||
/// Moves a packet
|
||||
///
|
||||
/// \param[in] other Packet to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
packet& operator=(_Inout_ packet &&other);
|
||||
|
||||
///
|
||||
/// Empty the packet
|
||||
///
|
||||
virtual void clear();
|
||||
|
||||
public:
|
||||
EapCode m_code; ///< Packet code
|
||||
unsigned char m_id; ///< Packet ID
|
||||
sanitizing_blob m_data; ///< Packet data
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1036,4 +1104,13 @@ inline unsigned __int64 htonll(unsigned __int64 val)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3])
|
||||
{
|
||||
assert(val <= 0xffffff);
|
||||
out[0] = (val >> 16) & 0xff;
|
||||
out[1] = (val >> 8) & 0xff;
|
||||
out[2] = (val ) & 0xff;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -48,6 +48,17 @@ namespace eapxml
|
||||
inline HRESULT put_element_value(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_ bool bValue);
|
||||
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
|
||||
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ BSTR *pbstrValue);
|
||||
template<class _Traits, class _Ax> inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue);
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ DWORD *pdwValue);
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool *pbValue);
|
||||
template<class _Ty, class _Ax> inline HRESULT get_attrib_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue);
|
||||
template<class _Ty, class _Ax> inline HRESULT get_attrib_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue);
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_z_ const BSTR bstrValue);
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ DWORD dwValue);
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ bool bValue);
|
||||
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
|
||||
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
|
||||
inline std::wstring get_xpath(_In_ IXMLDOMNode *pXmlNode);
|
||||
}
|
||||
|
||||
@@ -384,6 +395,144 @@ namespace eapxml
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ BSTR *pbstrValue)
|
||||
{
|
||||
assert(pbstrValue);
|
||||
|
||||
HRESULT hr;
|
||||
winstd::com_obj<IXMLDOMNamedNodeMap> pXmlAttributes;
|
||||
winstd::com_obj<IXMLDOMNode> pXmlAt;
|
||||
VARIANT varValue;
|
||||
V_VT(&varValue) = VT_EMPTY;
|
||||
|
||||
return
|
||||
SUCCEEDED(hr = pXmlParent->get_attributes(&pXmlAttributes)) ?
|
||||
SUCCEEDED(hr = pXmlAttributes->getNamedItem(bstrAttributeName, &pXmlAt)) ?
|
||||
pXmlAt ?
|
||||
SUCCEEDED(hr = pXmlAt->get_nodeValue(&varValue)) ?
|
||||
V_VT(&varValue) == VT_BSTR ? *pbstrValue = V_BSTR(&varValue), S_OK : E_UNEXPECTED : hr : E_NOT_SET : hr : hr;
|
||||
}
|
||||
|
||||
|
||||
template<class _Traits, class _Ax>
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::basic_string<wchar_t, _Traits, _Ax> &sValue)
|
||||
{
|
||||
winstd::bstr bstr;
|
||||
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, &bstr);
|
||||
if (SUCCEEDED(hr))
|
||||
sValue.assign(bstr, bstr.length());
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ DWORD *pdwValue)
|
||||
{
|
||||
assert(pdwValue);
|
||||
|
||||
winstd::bstr bstr;
|
||||
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, &bstr);
|
||||
if (SUCCEEDED(hr))
|
||||
*pdwValue = wcstoul(bstr, NULL, 10);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool *pbValue)
|
||||
{
|
||||
assert(pbValue);
|
||||
|
||||
winstd::bstr bstr;
|
||||
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, &bstr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"true" , -1, NULL, NULL, 0) == CSTR_EQUAL ||
|
||||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"1" , -1, NULL, NULL, 0) == CSTR_EQUAL)
|
||||
*pbValue = true;
|
||||
else if (
|
||||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"false", -1, NULL, NULL, 0) == CSTR_EQUAL ||
|
||||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstr, bstr.length(), L"0" , -1, NULL, NULL, 0) == CSTR_EQUAL)
|
||||
*pbValue = false;
|
||||
else
|
||||
hr = E_NOT_VALID_STATE;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
template<class _Ty, class _Ax>
|
||||
inline HRESULT get_attrib_base64(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue)
|
||||
{
|
||||
winstd::bstr bstr;
|
||||
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, &bstr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
winstd::base64_dec dec;
|
||||
bool is_last;
|
||||
dec.decode(aValue, is_last, (BSTR)bstr, bstr.length());
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
template<class _Ty, class _Ax>
|
||||
inline HRESULT get_attrib_hex(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ std::vector<_Ty, _Ax> &aValue)
|
||||
{
|
||||
winstd::bstr bstr;
|
||||
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, &bstr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
winstd::hex_dec dec;
|
||||
bool is_last;
|
||||
dec.decode(aValue, is_last, (BSTR)bstr, bstr.length());
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_z_ const BSTR bstrValue)
|
||||
{
|
||||
HRESULT hr;
|
||||
winstd::com_obj<IXMLDOMElement> pXmlEl;
|
||||
VARIANT varValue;
|
||||
V_VT(&varValue) = VT_BSTR;
|
||||
V_BSTR(&varValue) = bstrValue;
|
||||
|
||||
return
|
||||
SUCCEEDED(hr = pCurrentDOMNode->QueryInterface(__uuidof(IXMLDOMElement), (void**)&pXmlEl)) &&
|
||||
SUCCEEDED(hr = pXmlEl->setAttribute(bstrAttributeName, varValue)) ? S_OK : hr;
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ DWORD dwValue)
|
||||
{
|
||||
return put_attrib_value(pCurrentDOMNode, bstrAttributeName, winstd::bstr(winstd::wstring_printf(L"%d", dwValue)));
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ bool bValue)
|
||||
{
|
||||
return put_attrib_value(pCurrentDOMNode, bstrAttributeName, winstd::bstr(bValue ? L"true": L"false"));
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
|
||||
{
|
||||
std::wstring sBase64;
|
||||
winstd::base64_enc enc;
|
||||
enc.encode(sBase64, pValue, nValueLen);
|
||||
return put_attrib_value(pCurrentDOMNode, bstrAttributeName, winstd::bstr(sBase64));
|
||||
}
|
||||
|
||||
|
||||
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
|
||||
{
|
||||
std::wstring sHex;
|
||||
winstd::hex_enc enc;
|
||||
enc.encode(sHex, pValue, nValueLen);
|
||||
return put_attrib_value(pCurrentDOMNode, bstrAttributeName, winstd::bstr(sHex));
|
||||
}
|
||||
|
||||
|
||||
inline std::wstring get_xpath(_In_ IXMLDOMNode *pXmlNode)
|
||||
{
|
||||
if (pXmlNode) {
|
||||
|
@@ -21,9 +21,14 @@
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// EAP method base class
|
||||
/// EAP and non-EAP method base class
|
||||
///
|
||||
class method;
|
||||
|
||||
///
|
||||
/// Non-EAP method base class
|
||||
///
|
||||
class method_noneap;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
@@ -51,11 +56,10 @@ namespace eap
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Connection configuration
|
||||
/// \param[in] cfg Method configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method(_In_ module &module, _In_ config_connection &cfg, _In_ credentials &cred);
|
||||
|
||||
method(_In_ module &module, _In_ config_method_with_cred &cfg, _In_ credentials &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
@@ -85,7 +89,7 @@ namespace eap
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_ DWORD dwMaxSendPacketSize);
|
||||
_In_opt_ DWORD dwMaxSendPacketSize = MAXDWORD);
|
||||
|
||||
///
|
||||
/// Ends an EAP authentication session for the EAP method.
|
||||
@@ -100,7 +104,7 @@ namespace eap
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
virtual void process_request_packet(
|
||||
_In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket,
|
||||
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
|
||||
_In_ DWORD dwReceivedPacketSize,
|
||||
_Inout_ EapPeerMethodOutput *pEapOutput) = 0;
|
||||
|
||||
@@ -110,7 +114,7 @@ namespace eap
|
||||
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
|
||||
///
|
||||
virtual void get_response_packet(
|
||||
_Inout_bytecap_(*dwSendPacketSize) EapPacket *pSendPacket,
|
||||
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket,
|
||||
_Inout_ DWORD *pdwSendPacketSize) = 0;
|
||||
|
||||
///
|
||||
@@ -131,7 +135,77 @@ namespace eap
|
||||
|
||||
public:
|
||||
module &m_module; ///< EAP module
|
||||
config_connection &m_cfg; ///< Connection configuration
|
||||
config_method_with_cred &m_cfg; ///< Connection configuration
|
||||
credentials &m_cred; ///< User credentials
|
||||
std::vector<winstd::eap_attr> m_eap_attr; ///< EAP attributes
|
||||
};
|
||||
|
||||
|
||||
class method_noneap : public method
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Method configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method_noneap(_In_ module &module, _In_ config_method_with_cred &cfg, _In_ credentials &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
method_noneap(_Inout_ method_noneap &&other);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
method_noneap& operator=(_Inout_ method_noneap &&other);
|
||||
|
||||
/// \name Packet processing
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Obtains a response packet from the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
|
||||
///
|
||||
virtual void get_response_packet(
|
||||
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket,
|
||||
_Inout_ DWORD *pdwSendPacketSize);
|
||||
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
///
|
||||
/// Appends Diameter AVP to response packet
|
||||
///
|
||||
/// \param[in] code AVP code
|
||||
/// \param[in] flags AVP flags
|
||||
/// \param[in] data AVP data (<16777212B)
|
||||
/// \param[in] size Size of \p data in bytes
|
||||
///
|
||||
void append_avp(_In_ unsigned int code, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size);
|
||||
|
||||
///
|
||||
/// Appends Diameter AVP to response packet
|
||||
///
|
||||
/// \param[in] code AVP code
|
||||
/// \param[in] vendor_id Vendor-ID
|
||||
/// \param[in] flags AVP flags
|
||||
/// \param[in] data AVP data (<16777212B)
|
||||
/// \param[in] size Size of \p data in bytes
|
||||
///
|
||||
void append_avp(_In_ unsigned int code, _In_ unsigned int vendor_id, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size);
|
||||
|
||||
protected:
|
||||
sanitizing_blob m_packet_res; ///< Response packet
|
||||
};
|
||||
}
|
||||
|
@@ -95,6 +95,9 @@ void eap::config::operator>>(_Inout_ cursor_in &cursor)
|
||||
}
|
||||
|
||||
|
||||
const bstr eap::config::namespace_eapmetadata(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::config_method
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -156,11 +159,11 @@ eap::config_method_with_cred::config_method_with_cred(_In_ const config_method_w
|
||||
|
||||
|
||||
eap::config_method_with_cred::config_method_with_cred(_Inout_ config_method_with_cred &&other) :
|
||||
m_allow_save(std::move(other.m_allow_save)),
|
||||
m_allow_save (std::move(other.m_allow_save )),
|
||||
m_use_preshared(std::move(other.m_use_preshared)),
|
||||
m_preshared(std::move(other.m_preshared)),
|
||||
m_auth_failed(std::move(other.m_auth_failed)),
|
||||
config_method(std::move(other))
|
||||
m_preshared (std::move(other.m_preshared )),
|
||||
m_auth_failed (std::move(other.m_auth_failed )),
|
||||
config_method (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -198,16 +201,15 @@ void eap::config_method_with_cred::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOM
|
||||
assert(pDoc);
|
||||
assert(pConfigRoot);
|
||||
|
||||
const winstd::bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// <ClientSideCredential>
|
||||
winstd::com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), winstd::bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), winstd::bstr(L"ClientSideCredential"), namespace_eapmetadata, &pXmlElClientSideCredential)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <ClientSideCredential> element.");
|
||||
|
||||
// <ClientSideCredential>/<allow-save>
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"allow-save"), bstrNamespace, m_allow_save)))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"allow-save"), namespace_eapmetadata, m_allow_save)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <allow-save> element.");
|
||||
|
||||
if (m_use_preshared)
|
||||
@@ -285,16 +287,17 @@ eap::config_provider::config_provider(_In_ module &mod) :
|
||||
|
||||
|
||||
eap::config_provider::config_provider(_In_ const config_provider &other) :
|
||||
m_read_only(other.m_read_only),
|
||||
m_id(other.m_id),
|
||||
m_name(other.m_name),
|
||||
m_help_email(other.m_help_email),
|
||||
m_help_web(other.m_help_web),
|
||||
m_help_phone(other.m_help_phone),
|
||||
m_namespace (other.m_namespace ),
|
||||
m_id (other.m_id ),
|
||||
m_read_only (other.m_read_only ),
|
||||
m_name (other.m_name ),
|
||||
m_help_email (other.m_help_email ),
|
||||
m_help_web (other.m_help_web ),
|
||||
m_help_phone (other.m_help_phone ),
|
||||
m_lbl_alt_credential(other.m_lbl_alt_credential),
|
||||
m_lbl_alt_identity(other.m_lbl_alt_identity),
|
||||
m_lbl_alt_password(other.m_lbl_alt_password),
|
||||
config(other)
|
||||
m_lbl_alt_identity (other.m_lbl_alt_identity ),
|
||||
m_lbl_alt_password (other.m_lbl_alt_password ),
|
||||
config (other )
|
||||
{
|
||||
m_methods.reserve(other.m_methods.size());
|
||||
for (vector<unique_ptr<config_method> >::const_iterator method = other.m_methods.cbegin(), method_end = other.m_methods.cend(); method != method_end; ++method)
|
||||
@@ -303,17 +306,18 @@ eap::config_provider::config_provider(_In_ const config_provider &other) :
|
||||
|
||||
|
||||
eap::config_provider::config_provider(_Inout_ config_provider &&other) :
|
||||
m_read_only(std::move(other.m_read_only)),
|
||||
m_id(std::move(other.m_id)),
|
||||
m_name(std::move(other.m_name)),
|
||||
m_help_email(std::move(other.m_help_email)),
|
||||
m_help_web(std::move(other.m_help_web)),
|
||||
m_help_phone(std::move(other.m_help_phone)),
|
||||
m_namespace (std::move(other.m_namespace )),
|
||||
m_id (std::move(other.m_id )),
|
||||
m_read_only (std::move(other.m_read_only )),
|
||||
m_name (std::move(other.m_name )),
|
||||
m_help_email (std::move(other.m_help_email )),
|
||||
m_help_web (std::move(other.m_help_web )),
|
||||
m_help_phone (std::move(other.m_help_phone )),
|
||||
m_lbl_alt_credential(std::move(other.m_lbl_alt_credential)),
|
||||
m_lbl_alt_identity(std::move(other.m_lbl_alt_identity)),
|
||||
m_lbl_alt_password(std::move(other.m_lbl_alt_password)),
|
||||
m_methods(std::move(other.m_methods)),
|
||||
config(std::move(other))
|
||||
m_lbl_alt_identity (std::move(other.m_lbl_alt_identity )),
|
||||
m_lbl_alt_password (std::move(other.m_lbl_alt_password )),
|
||||
m_methods (std::move(other.m_methods )),
|
||||
config (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -322,8 +326,9 @@ eap::config_provider& eap::config_provider::operator=(_In_ const config_provider
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&)*this = other;
|
||||
m_read_only = other.m_read_only;
|
||||
m_namespace = other.m_namespace;
|
||||
m_id = other.m_id;
|
||||
m_read_only = other.m_read_only;
|
||||
m_name = other.m_name;
|
||||
m_help_email = other.m_help_email;
|
||||
m_help_web = other.m_help_web;
|
||||
@@ -345,17 +350,18 @@ eap::config_provider& eap::config_provider::operator=(_In_ const config_provider
|
||||
eap::config_provider& eap::config_provider::operator=(_Inout_ config_provider &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&&)*this = std::move(other);
|
||||
m_read_only = std::move(m_read_only);
|
||||
m_id = std::move(other.m_id);
|
||||
m_name = std::move(other.m_name);
|
||||
m_help_email = std::move(other.m_help_email);
|
||||
m_help_web = std::move(other.m_help_web);
|
||||
m_help_phone = std::move(other.m_help_phone);
|
||||
(config&&)*this = std::move(other );
|
||||
m_namespace = std::move(other.m_namespace );
|
||||
m_id = std::move(other.m_id );
|
||||
m_read_only = std::move(other.m_read_only );
|
||||
m_name = std::move(other.m_name );
|
||||
m_help_email = std::move(other.m_help_email );
|
||||
m_help_web = std::move(other.m_help_web );
|
||||
m_help_phone = std::move(other.m_help_phone );
|
||||
m_lbl_alt_credential = std::move(other.m_lbl_alt_credential);
|
||||
m_lbl_alt_identity = std::move(other.m_lbl_alt_identity);
|
||||
m_lbl_alt_password = std::move(other.m_lbl_alt_password);
|
||||
m_methods = std::move(other.m_methods);
|
||||
m_lbl_alt_identity = std::move(other.m_lbl_alt_identity );
|
||||
m_lbl_alt_password = std::move(other.m_lbl_alt_password );
|
||||
m_methods = std::move(other.m_methods );
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -372,72 +378,76 @@ void eap::config_provider::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC
|
||||
{
|
||||
config::save(pDoc, pConfigRoot);
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// <read-only>
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"read-only"), bstrNamespace, m_read_only)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <read-only> element.");
|
||||
// namespace
|
||||
if (!m_namespace.empty())
|
||||
if (FAILED(hr = eapxml::put_attrib_value(pConfigRoot, bstr(L"namespace"), bstr(m_namespace))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating namespace attribute.");
|
||||
|
||||
// <ID>
|
||||
// ID
|
||||
if (!m_id.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"ID"), bstrNamespace, bstr(m_id))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <ID> element.");
|
||||
if (FAILED(hr = eapxml::put_attrib_value(pConfigRoot, bstr(L"ID"), bstr(m_id))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating ID attribute.");
|
||||
|
||||
// <read-only>
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"read-only"), namespace_eapmetadata, m_read_only)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <read-only> element.");
|
||||
|
||||
// <ProviderInfo>
|
||||
com_obj<IXMLDOMElement> pXmlElProviderInfo;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), bstr(L"ProviderInfo"), bstrNamespace, &pXmlElProviderInfo)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), bstr(L"ProviderInfo"), namespace_eapmetadata, &pXmlElProviderInfo)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <ProviderInfo> element.");
|
||||
|
||||
// <ProviderInfo>/<DisplayName>
|
||||
if (!m_name.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"DisplayName"), bstrNamespace, bstr(m_name))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"DisplayName"), namespace_eapmetadata, bstr(m_name))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <DisplayName> element.");
|
||||
|
||||
// <ProviderInfo>/<Helpdesk>
|
||||
com_obj<IXMLDOMElement> pXmlElHelpdesk;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), bstr(L"Helpdesk"), bstrNamespace, &pXmlElHelpdesk)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), bstr(L"Helpdesk"), namespace_eapmetadata, &pXmlElHelpdesk)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <Helpdesk> element.");
|
||||
|
||||
// <ProviderInfo>/<Helpdesk>/<EmailAddress>
|
||||
if (!m_help_email.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"EmailAddress"), bstrNamespace, bstr(m_help_email))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"EmailAddress"), namespace_eapmetadata, bstr(m_help_email))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <EmailAddress> element.");
|
||||
|
||||
// <ProviderInfo>/<Helpdesk>/<WebAddress>
|
||||
if (!m_help_web.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"WebAddress"), bstrNamespace, bstr(m_help_web))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"WebAddress"), namespace_eapmetadata, bstr(m_help_web))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <WebAddress> element.");
|
||||
|
||||
// <ProviderInfo>/<Helpdesk>/<Phone>
|
||||
if (!m_help_phone.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"Phone"), bstrNamespace, bstr(m_help_phone))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"Phone"), namespace_eapmetadata, bstr(m_help_phone))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <Phone> element.");
|
||||
|
||||
// <ProviderInfo>/<CredentialPrompt>
|
||||
if (!m_lbl_alt_credential.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"CredentialPrompt"), bstrNamespace, bstr(m_lbl_alt_credential))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"CredentialPrompt"), namespace_eapmetadata, bstr(m_lbl_alt_credential))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <CredentialPrompt> element.");
|
||||
|
||||
// <ProviderInfo>/<UserNameLabel>
|
||||
if (!m_lbl_alt_identity.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"UserNameLabel"), bstrNamespace, bstr(m_lbl_alt_identity))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"UserNameLabel"), namespace_eapmetadata, bstr(m_lbl_alt_identity))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <UserNameLabel> element.");
|
||||
|
||||
// <ProviderInfo>/<PasswordLabel>
|
||||
if (!m_lbl_alt_password.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"PasswordLabel"), bstrNamespace, bstr(m_lbl_alt_password))))
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"PasswordLabel"), namespace_eapmetadata, bstr(m_lbl_alt_password))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <PasswordLabel> element.");
|
||||
|
||||
// <AuthenticationMethods>
|
||||
com_obj<IXMLDOMElement> pXmlElAuthenticationMethods;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods"), bstr(L"AuthenticationMethods"), bstrNamespace, &pXmlElAuthenticationMethods)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods"), bstr(L"AuthenticationMethods"), namespace_eapmetadata, &pXmlElAuthenticationMethods)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <AuthenticationMethods> element.");
|
||||
|
||||
for (vector<unique_ptr<config_method> >::const_iterator method = m_methods.cbegin(), method_end = m_methods.cend(); method != method_end; ++method) {
|
||||
// <AuthenticationMethod>
|
||||
com_obj<IXMLDOMElement> pXmlElAuthenticationMethod;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"AuthenticationMethod"), bstrNamespace, &pXmlElAuthenticationMethod)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"AuthenticationMethod"), namespace_eapmetadata, &pXmlElAuthenticationMethod)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <AuthenticationMethod> element.");
|
||||
|
||||
// <AuthenticationMethod>/...
|
||||
@@ -457,16 +467,21 @@ void eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
|
||||
config::load(pConfigRoot);
|
||||
|
||||
// namespace
|
||||
m_namespace.clear();
|
||||
eapxml::get_attrib_value(pConfigRoot, bstr(L"namespace"), m_namespace);
|
||||
m_module.log_config((xpath + L" namespace").c_str(), m_namespace.c_str());
|
||||
|
||||
// ID
|
||||
m_id.clear();
|
||||
eapxml::get_attrib_value(pConfigRoot, bstr(L"ID"), m_id);
|
||||
m_module.log_config((xpath + L" ID").c_str(), m_id.c_str());
|
||||
|
||||
// <read-only>
|
||||
if (FAILED(hr = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:read-only"), &m_read_only)))
|
||||
m_read_only = true;
|
||||
m_module.log_config((xpath + L"/read-only").c_str(), m_read_only);
|
||||
|
||||
// <ID>
|
||||
m_id.clear();
|
||||
eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:ID"), m_id);
|
||||
m_module.log_config((xpath + L"/ID").c_str(), m_id.c_str());
|
||||
|
||||
// <ProviderInfo>
|
||||
m_name.clear();
|
||||
m_help_email.clear();
|
||||
@@ -549,8 +564,9 @@ void eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
void eap::config_provider::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
config::operator<<(cursor);
|
||||
cursor << m_read_only ;
|
||||
cursor << m_namespace ;
|
||||
cursor << m_id ;
|
||||
cursor << m_read_only ;
|
||||
cursor << m_name ;
|
||||
cursor << m_help_email ;
|
||||
cursor << m_help_web ;
|
||||
@@ -566,8 +582,9 @@ size_t eap::config_provider::get_pk_size() const
|
||||
{
|
||||
return
|
||||
config::get_pk_size() +
|
||||
pksizeof(m_read_only ) +
|
||||
pksizeof(m_namespace ) +
|
||||
pksizeof(m_id ) +
|
||||
pksizeof(m_read_only ) +
|
||||
pksizeof(m_name ) +
|
||||
pksizeof(m_help_email ) +
|
||||
pksizeof(m_help_web ) +
|
||||
@@ -582,8 +599,9 @@ size_t eap::config_provider::get_pk_size() const
|
||||
void eap::config_provider::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
config::operator>>(cursor);
|
||||
cursor >> m_read_only ;
|
||||
cursor >> m_namespace ;
|
||||
cursor >> m_id ;
|
||||
cursor >> m_read_only ;
|
||||
cursor >> m_name ;
|
||||
cursor >> m_help_email ;
|
||||
cursor >> m_help_web ;
|
||||
@@ -619,14 +637,14 @@ eap::config_connection::config_connection(_In_ module &mod) : config(mod)
|
||||
|
||||
eap::config_connection::config_connection(_In_ const config_connection &other) :
|
||||
m_providers(other.m_providers),
|
||||
config(other)
|
||||
config (other )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_connection::config_connection(_Inout_ config_connection &&other) :
|
||||
m_providers(std::move(other.m_providers)),
|
||||
config(std::move(other))
|
||||
config (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -645,7 +663,7 @@ eap::config_connection& eap::config_connection::operator=(_In_ const config_conn
|
||||
eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&&)*this = std::move(other);
|
||||
(config&&)*this = std::move(other );
|
||||
m_providers = std::move(other.m_providers);
|
||||
}
|
||||
|
||||
@@ -663,18 +681,17 @@ void eap::config_connection::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *
|
||||
{
|
||||
config::save(pDoc, pConfigRoot);
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// Select <EAPIdentityProviderList> node.
|
||||
com_obj<IXMLDOMNode> pXmlElIdentityProviderList;
|
||||
if (FAILED(hr = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList"), &pXmlElIdentityProviderList)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error selecting <EAPIdentityProviderList> element.");
|
||||
// Create <EAPIdentityProviderList> node.
|
||||
com_obj<IXMLDOMElement> pXmlElIdentityProviderList;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList"), bstr(L"EAPIdentityProviderList"), namespace_eapmetadata, &pXmlElIdentityProviderList)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <EAPIdentityProviderList> element.");
|
||||
|
||||
for (vector<config_provider>::const_iterator provider = m_providers.cbegin(), provider_end = m_providers.cend(); provider != provider_end; ++provider) {
|
||||
for (provider_list::const_iterator provider = m_providers.cbegin(), provider_end = m_providers.cend(); provider != provider_end; ++provider) {
|
||||
// <EAPIdentityProvider>
|
||||
com_obj<IXMLDOMElement> pXmlElIdentityProvider;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"EAPIdentityProvider"), bstrNamespace, &pXmlElIdentityProvider)))
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"EAPIdentityProvider"), namespace_eapmetadata, &pXmlElIdentityProvider)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <EAPIdentityProvider> element.");
|
||||
|
||||
// <EAPIdentityProvider>/...
|
||||
@@ -733,10 +750,10 @@ void eap::config_connection::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
config::operator>>(cursor);
|
||||
|
||||
list<config_provider>::size_type count;
|
||||
provider_list::size_type count;
|
||||
cursor >> count;
|
||||
m_providers.clear();
|
||||
for (list<config_provider>::size_type i = 0; i < count; i++) {
|
||||
for (provider_list::size_type i = 0; i < count; i++) {
|
||||
config_provider el(m_module);
|
||||
cursor >> el;
|
||||
m_providers.push_back(std::move(el));
|
||||
|
@@ -90,11 +90,11 @@ void eap::credentials::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfi
|
||||
|
||||
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))))
|
||||
if (!m_identity.empty())
|
||||
if (FAILED(hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), namespace_eapmetadata, bstr(m_identity))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <UserName> element.");
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void eap::credentials::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_identity.clear();
|
||||
|
||||
m_module.log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
|
||||
}
|
||||
@@ -145,7 +145,10 @@ wstring eap::credentials::get_identity() const
|
||||
|
||||
tstring eap::credentials::get_name() const
|
||||
{
|
||||
return !empty() ? get_identity() : _T("<blank>");
|
||||
tstring identity(std::move(get_identity()));
|
||||
return
|
||||
!identity.empty() ? identity :
|
||||
empty() ? _T("<empty>") : _T("<blank ID>");
|
||||
}
|
||||
|
||||
|
||||
@@ -214,12 +217,11 @@ void eap::credentials_pass::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
||||
|
||||
credentials::save(pDoc, pConfigRoot);
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
|
||||
// <Password>
|
||||
bstr pass(m_password);
|
||||
hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"Password"), bstrNamespace, pass);
|
||||
hr = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"Password"), namespace_eapmetadata, pass);
|
||||
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
|
||||
if (FAILED(hr))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <Password> element.");
|
||||
@@ -415,3 +417,179 @@ const unsigned char eap::credentials_pass::s_entropy[1024] = {
|
||||
0x30, 0x29, 0x39, 0x9a, 0xd6, 0xab, 0x2e, 0xc6, 0x42, 0x47, 0x5e, 0x54, 0xbb, 0x90, 0xe6, 0x98,
|
||||
0xe6, 0x52, 0x58, 0x58, 0x1e, 0xd0, 0x00, 0x9c, 0x8f, 0x4a, 0x17, 0x7e, 0x8a, 0x5a, 0xef, 0x3e,
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::credentials_connection
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::credentials_connection::credentials_connection(_In_ module &mod, _In_ const config_connection &cfg) :
|
||||
m_cfg(cfg),
|
||||
config(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_connection::credentials_connection(_In_ const credentials_connection &other) :
|
||||
m_cfg (other.m_cfg ),
|
||||
m_namespace(other.m_namespace),
|
||||
m_id (other.m_id ),
|
||||
m_cred (other.m_cred ? (credentials*)other.m_cred->clone() : nullptr),
|
||||
config (other )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_connection::credentials_connection(_Inout_ credentials_connection &&other) :
|
||||
m_cfg ( other.m_cfg ),
|
||||
m_namespace(std::move(other.m_namespace)),
|
||||
m_id (std::move(other.m_id )),
|
||||
m_cred (std::move(other.m_cred )),
|
||||
config (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_connection& eap::credentials_connection::operator=(_In_ const credentials_connection &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&)*this = other;
|
||||
m_namespace = other.m_namespace;
|
||||
m_id = other.m_id;
|
||||
m_cred.reset(other.m_cred ? (credentials*)other.m_cred->clone() : nullptr);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_connection& eap::credentials_connection::operator=(_Inout_ credentials_connection &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config&)*this = std::move(other );
|
||||
m_namespace = std::move(other.m_namespace);
|
||||
m_id = std::move(other.m_id );
|
||||
m_cred = std::move(other.m_cred );
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::credentials_connection::clone() const
|
||||
{
|
||||
return new credentials_connection(*this);
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials_connection::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const
|
||||
{
|
||||
assert(pDoc);
|
||||
assert(pConfigRoot);
|
||||
|
||||
config::save(pDoc, pConfigRoot);
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
// Create <EAPIdentityProvider> node.
|
||||
com_obj<IXMLDOMElement> pXmlElIdentityProvider;
|
||||
if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:EAPIdentityProvider"), bstr(L"EAPIdentityProvider"), namespace_eapmetadata, &pXmlElIdentityProvider)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating <EAPIdentityProvider> element.");
|
||||
|
||||
// namespace
|
||||
if (!m_namespace.empty())
|
||||
if (FAILED(hr = eapxml::put_attrib_value(pXmlElIdentityProvider, bstr(L"namespace"), bstr(m_namespace))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating namespace attribute.");
|
||||
|
||||
// ID
|
||||
if (!m_id.empty())
|
||||
if (FAILED(hr = eapxml::put_attrib_value(pXmlElIdentityProvider, bstr(L"ID"), bstr(m_id))))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error creating ID attribute.");
|
||||
|
||||
m_cred->save(pDoc, pXmlElIdentityProvider);
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials_connection::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
{
|
||||
assert(pConfigRoot);
|
||||
HRESULT hr;
|
||||
|
||||
config::load(pConfigRoot);
|
||||
|
||||
// <EAPIdentityProvider>
|
||||
winstd::com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
||||
if (FAILED(hr = eapxml::select_element(pConfigRoot, winstd::bstr(L"eap-metadata:EAPIdentityProvider"), &pXmlElClientSideCredential)))
|
||||
throw com_runtime_error(hr, __FUNCTION__ " Error loading <EAPIdentityProvider> element.");
|
||||
|
||||
std::wstring xpath(eapxml::get_xpath(pXmlElClientSideCredential));
|
||||
|
||||
// namespace
|
||||
m_namespace.clear();
|
||||
eapxml::get_attrib_value(pXmlElClientSideCredential, bstr(L"namespace"), m_namespace);
|
||||
m_module.log_config((xpath + L" namespace").c_str(), m_namespace.c_str());
|
||||
|
||||
// ID
|
||||
m_id.clear();
|
||||
eapxml::get_attrib_value(pXmlElClientSideCredential, bstr(L"ID"), m_id);
|
||||
m_module.log_config((xpath + L" ID").c_str(), m_id.c_str());
|
||||
|
||||
// Look-up the provider.
|
||||
for (config_connection::provider_list::const_iterator cfg_prov = m_cfg.m_providers.cbegin(), cfg_prov_end = m_cfg.m_providers.cend(); ; ++cfg_prov) {
|
||||
if (cfg_prov != cfg_prov_end) {
|
||||
if (match(*cfg_prov)) {
|
||||
// Matching provider found. Create matching blank credential set, then load.
|
||||
if (cfg_prov->m_methods.empty())
|
||||
throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str()).c_str());
|
||||
const config_method_with_cred *cfg_method = dynamic_cast<const config_method_with_cred*>(cfg_prov->m_methods.front().get());
|
||||
m_cred.reset(cfg_method->make_credentials());
|
||||
m_cred->load(pXmlElClientSideCredential);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
throw invalid_argument(string_printf(__FUNCTION__ " Credentials do not match to any provider within this connection configuration (provider: %ls).", get_id().c_str()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials_connection::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
config::operator<<(cursor);
|
||||
cursor << m_namespace;
|
||||
cursor << m_id ;
|
||||
cursor << *m_cred ;
|
||||
}
|
||||
|
||||
|
||||
size_t eap::credentials_connection::get_pk_size() const
|
||||
{
|
||||
return
|
||||
config::get_pk_size() +
|
||||
pksizeof( m_namespace) +
|
||||
pksizeof( m_id ) +
|
||||
pksizeof(*m_cred );
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials_connection::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
config::operator>>(cursor);
|
||||
cursor >> m_namespace;
|
||||
cursor >> m_id ;
|
||||
|
||||
// Look-up the provider.
|
||||
for (config_connection::provider_list::const_iterator cfg_prov = m_cfg.m_providers.cbegin(), cfg_prov_end = m_cfg.m_providers.cend(); ; ++cfg_prov) {
|
||||
if (cfg_prov != cfg_prov_end) {
|
||||
if (match(*cfg_prov)) {
|
||||
// Matching provider found. Create matching blank credential set, then read.
|
||||
if (cfg_prov->m_methods.empty())
|
||||
throw invalid_argument(string_printf(__FUNCTION__ " %ls provider has no methods.", cfg_prov->get_id().c_str()).c_str());
|
||||
const config_method_with_cred *cfg_method = dynamic_cast<const config_method_with_cred*>(cfg_prov->m_methods.front().get());
|
||||
m_cred.reset(cfg_method->make_credentials());
|
||||
cursor >> *m_cred;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
throw invalid_argument(string_printf(__FUNCTION__ " Credentials do not match to any provider within this connection configuration (provider: %ls).", get_id().c_str()).c_str());
|
||||
}
|
||||
}
|
||||
|
83
lib/EAPBase/src/EAP.cpp
Normal file
83
lib/EAPBase/src/EAP.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::packet
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::packet::packet() :
|
||||
m_code((EapCode)0),
|
||||
m_id(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::packet::packet(_In_ const packet &other) :
|
||||
m_code(other.m_code),
|
||||
m_id (other.m_id ),
|
||||
m_data(other.m_data)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::packet::packet(_Inout_ packet &&other) :
|
||||
m_code(std::move(other.m_code)),
|
||||
m_id (std::move(other.m_id )),
|
||||
m_data(std::move(other.m_data))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::packet& eap::packet::operator=(_In_ const packet &other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
m_code = other.m_code;
|
||||
m_id = other.m_id ;
|
||||
m_data = other.m_data;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::packet& eap::packet::operator=(_Inout_ packet &&other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
m_code = std::move(other.m_code);
|
||||
m_id = std::move(other.m_id );
|
||||
m_data = std::move(other.m_data);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::packet::clear()
|
||||
{
|
||||
m_code = (EapCode)0;
|
||||
m_id = 0;
|
||||
m_data.clear();
|
||||
}
|
@@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::method
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method::method(_In_ module &module, _In_ config_connection &cfg, _In_ credentials &cred) :
|
||||
eap::method::method(_In_ module &module, _In_ config_method_with_cred &cfg, _In_ credentials &cred) :
|
||||
m_module(module),
|
||||
m_cfg(cfg),
|
||||
m_cred(cred)
|
||||
@@ -37,9 +37,10 @@ eap::method::method(_In_ module &module, _In_ config_connection &cfg, _In_ crede
|
||||
|
||||
|
||||
eap::method::method(_Inout_ method &&other) :
|
||||
m_module(other.m_module),
|
||||
m_cfg(other.m_cfg),
|
||||
m_cred(other.m_cred)
|
||||
m_module ( other.m_module ),
|
||||
m_cfg ( other.m_cfg ),
|
||||
m_cred ( other.m_cred ),
|
||||
m_eap_attr(std::move(other.m_eap_attr))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,6 +51,7 @@ eap::method& eap::method::operator=(_Inout_ method &&other)
|
||||
assert(std::addressof(m_module) == std::addressof(other.m_module)); // Move method within same module only!
|
||||
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move method with same configuration only!
|
||||
assert(std::addressof(m_cred ) == std::addressof(other.m_cred )); // Move method with same credentials only!
|
||||
m_eap_attr = std::move(other.m_eap_attr);
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -60,7 +62,7 @@ void eap::method::begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_ DWORD dwMaxSendPacketSize)
|
||||
_In_opt_ DWORD dwMaxSendPacketSize)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
UNREFERENCED_PARAMETER(pAttributeArray);
|
||||
@@ -72,3 +74,101 @@ void eap::method::begin_session(
|
||||
void eap::method::end_session()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::method_noneap
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method_noneap::method_noneap(_In_ module &module, _In_ config_method_with_cred &cfg, _In_ credentials &cred) : method(module, cfg, cred)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_noneap::method_noneap(_Inout_ method_noneap &&other) :
|
||||
m_packet_res(std::move(other.m_packet_res)),
|
||||
method (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_noneap& eap::method_noneap::operator=(_Inout_ method_noneap &&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_packet_res = std::move(other.m_packet_res);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_noneap::get_response_packet(
|
||||
_Inout_bytecap_(*dwSendPacketSize) void *pSendPacket,
|
||||
_Inout_ DWORD *pdwSendPacketSize)
|
||||
{
|
||||
assert(pdwSendPacketSize);
|
||||
assert(pSendPacket);
|
||||
|
||||
size_t size_packet = m_packet_res.size();
|
||||
if (size_packet > *pdwSendPacketSize)
|
||||
throw invalid_argument(string_printf(__FUNCTION__ " This method does not support packet fragmentation, but the data size is too big to fit in one packet (packet: %u, maximum: %u).", size_packet, *pdwSendPacketSize).c_str());
|
||||
|
||||
memcpy(pSendPacket, m_packet_res.data(), size_packet);
|
||||
*pdwSendPacketSize = (DWORD)size_packet;
|
||||
m_packet_res.clear();
|
||||
}
|
||||
|
||||
|
||||
void eap::method_noneap::append_avp(_In_ unsigned int code, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size)
|
||||
{
|
||||
unsigned int
|
||||
padding = (unsigned int)((4 - size) % 4),
|
||||
size_outer;
|
||||
|
||||
m_packet_res.reserve(
|
||||
m_packet_res.size() +
|
||||
(size_outer =
|
||||
sizeof(diameter_avp_header) + // Diameter header
|
||||
size) + // Data
|
||||
padding); // Data padding
|
||||
|
||||
// Diameter AVP header
|
||||
diameter_avp_header hdr;
|
||||
*(unsigned int*)hdr.code = htonl(code);
|
||||
hdr.flags = flags;
|
||||
hton24(size_outer, hdr.length);
|
||||
m_packet_res.insert(m_packet_res.end(), (unsigned char*)&hdr, (unsigned char*)(&hdr + 1));
|
||||
|
||||
// Data
|
||||
m_packet_res.insert(m_packet_res.end(), (unsigned char*)data, (unsigned char*)data + size);
|
||||
m_packet_res.insert(m_packet_res.end(), padding, 0);
|
||||
}
|
||||
|
||||
|
||||
void eap::method_noneap::append_avp(_In_ unsigned int code, _In_ unsigned int vendor_id, _In_ unsigned char flags, _In_bytecount_(size) const void *data, _In_ unsigned int size)
|
||||
{
|
||||
unsigned int
|
||||
padding = (unsigned int)((4 - size) % 4),
|
||||
size_outer;
|
||||
|
||||
m_packet_res.reserve(
|
||||
m_packet_res.size() +
|
||||
(size_outer =
|
||||
sizeof(diameter_avp_header_ven) + // Diameter header
|
||||
size) + // Data
|
||||
padding); // Data padding
|
||||
|
||||
// Diameter AVP header
|
||||
diameter_avp_header_ven hdr;
|
||||
*(unsigned int*)hdr.code = htonl(code);
|
||||
hdr.flags = flags | diameter_avp_flag_vendor;
|
||||
hton24(size_outer, hdr.length);
|
||||
*(unsigned int*)hdr.vendor = htonl(vendor_id);
|
||||
m_packet_res.insert(m_packet_res.end(), (unsigned char*)&hdr, (unsigned char*)(&hdr + 1));
|
||||
|
||||
// Data
|
||||
m_packet_res.insert(m_packet_res.end(), (unsigned char*)data, (unsigned char*)data + size);
|
||||
m_packet_res.insert(m_packet_res.end(), padding, 0);
|
||||
}
|
||||
|
@@ -81,6 +81,7 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\EAP_UI.h" />
|
||||
<ClInclude Include="..\include\Module.h" />
|
||||
<ClInclude Include="..\include\wxEAP_UIBase.h" />
|
||||
<ClInclude Include="..\res\wxEAP_UI.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
|
@@ -27,6 +27,9 @@
|
||||
<ClInclude Include="..\include\Module.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\wxEAP_UIBase.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
|
@@ -20,7 +20,10 @@
|
||||
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/textdlg.h>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
@@ -40,10 +43,15 @@ template <class _wxT> class wxEAPConfigDialog;
|
||||
class wxEAPGeneralDialog;
|
||||
|
||||
///
|
||||
/// EAP top-most credential dialog
|
||||
/// EAP method credential dialog
|
||||
///
|
||||
class wxEAPCredentialsDialog;
|
||||
|
||||
///
|
||||
/// EAP connection credential dialog
|
||||
///
|
||||
class wxEAPCredentialsConnectionDialog;
|
||||
|
||||
///
|
||||
/// EAP general note
|
||||
///
|
||||
@@ -64,10 +72,15 @@ class wxEAPCredentialWarningPanel;
|
||||
///
|
||||
class wxEAPConfigWindow;
|
||||
|
||||
///
|
||||
/// EAP provider contact info config panel
|
||||
///
|
||||
class wxEAPProviderContactInfoPanel;
|
||||
|
||||
///
|
||||
/// EAP provider identity config panel
|
||||
///
|
||||
class wxEAPProviderIdentityPanel;
|
||||
class wxEAPProviderIDPanel;
|
||||
|
||||
///
|
||||
/// EAP provider configuration dialog
|
||||
@@ -80,9 +93,9 @@ class wxEAPConfigProvider;
|
||||
template <class _Tcred, class _wxT> class wxEAPCredentialsConfigPanel;
|
||||
|
||||
///
|
||||
/// Base template for all credential entry panels
|
||||
/// Helper template for all credential entry panels
|
||||
///
|
||||
template <class _Tcred, class _Tbase> class wxEAPCredentialsPanelBase;
|
||||
template <class _Tcred, class _Tbase> class wxEAPCredentialsPanel;
|
||||
|
||||
///
|
||||
/// Generic password credential entry panel
|
||||
@@ -104,6 +117,17 @@ inline wxIcon wxLoadIconFromResource(HINSTANCE hinst, PCWSTR pszName, const wxSi
|
||||
///
|
||||
inline wxString wxEAPGetProviderName(const std::wstring &id);
|
||||
|
||||
///
|
||||
/// Initializes wxWidgets application configuration scheme
|
||||
///
|
||||
inline void wxInitializeConfig();
|
||||
|
||||
///
|
||||
/// Inizializes wxWidgets localization scheme
|
||||
///
|
||||
inline bool wxInitializeLocale(wxLocale &locale);
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
@@ -124,6 +148,7 @@ namespace eap
|
||||
#include <WinStd/Cred.h>
|
||||
#include <WinStd/Win.h>
|
||||
|
||||
#include <wx/config.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
#include <CommCtrl.h>
|
||||
@@ -174,20 +199,21 @@ public:
|
||||
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) {
|
||||
wstring target_name;
|
||||
for (eap::config_connection::provider_list::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;
|
||||
std::vector<std::unique_ptr<eap::config_method> >::iterator method = provider->m_methods.begin(), method_end = provider->m_methods.end();
|
||||
for (; method != method_end; ++method, count++)
|
||||
for (; method != method_end; ++method, count++) {
|
||||
m_providers->AddPage(
|
||||
new _wxT(
|
||||
*provider,
|
||||
*method->get(),
|
||||
provider->m_id.c_str(),
|
||||
m_providers),
|
||||
is_single ?
|
||||
wxEAPGetProviderName(provider->m_id) :
|
||||
winstd::tstring_printf(_T("%s (%u)"), wxEAPGetProviderName(provider->m_id), count));
|
||||
wxEAPGetProviderName(provider->m_name) :
|
||||
winstd::tstring_printf(_T("%s (%u)"), wxEAPGetProviderName(provider->m_name), count));
|
||||
}
|
||||
}
|
||||
|
||||
this->Layout();
|
||||
@@ -210,24 +236,83 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
m_advanced->Enable(!m_cfg.m_providers.at(m_providers->GetSelection()).m_read_only);
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& /*event*/)
|
||||
{
|
||||
int idx = m_providers->GetSelection();
|
||||
if (idx != wxNOT_FOUND) {
|
||||
eap::config_provider &cfg_provider = ((_wxT*)m_providers->GetPage(idx))->GetProvider();
|
||||
m_prov_remove->Enable(true);
|
||||
m_prov_advanced->Enable(!cfg_provider.m_read_only);
|
||||
} else {
|
||||
m_prov_remove->Enable(false);
|
||||
m_prov_advanced->Enable(false);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnAdvanced(wxCommandEvent& event)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
wxEAPConfigProvider dlg(m_cfg.m_providers.at(m_providers->GetSelection()), this);
|
||||
dlg.ShowModal();
|
||||
virtual void OnProvAdd(wxCommandEvent& /*event*/)
|
||||
{
|
||||
// One method
|
||||
std::unique_ptr<eap::config_method> cfg_method(m_cfg.m_module.make_config_method());
|
||||
|
||||
// Create provider.
|
||||
eap::config_provider cfg_provider(m_cfg.m_module);
|
||||
GUID guid;
|
||||
CoCreateGuid(&guid);
|
||||
cfg_provider.m_namespace = L"urn:uuid";
|
||||
cfg_provider.m_id = winstd::wstring_guid(guid).substr(1, 36);
|
||||
cfg_provider.m_methods.push_back(std::move(cfg_method));
|
||||
|
||||
// Append provider.
|
||||
m_cfg.m_providers.push_back(std::move(cfg_provider));
|
||||
eap::config_provider &cfg_provider2 = m_cfg.m_providers.back();
|
||||
eap::config_method *cfg_method2 = cfg_provider2.m_methods.front().get();
|
||||
m_providers->InsertPage(
|
||||
m_providers->GetSelection() + 1,
|
||||
new _wxT(
|
||||
cfg_provider2,
|
||||
*cfg_method2,
|
||||
m_providers),
|
||||
wxEAPGetProviderName(cfg_provider2.m_name), true);
|
||||
|
||||
this->Layout();
|
||||
this->Fit();
|
||||
}
|
||||
|
||||
|
||||
virtual void OnProvRemove(wxCommandEvent& /*event*/)
|
||||
{
|
||||
int idx = m_providers->GetSelection();
|
||||
eap::config_provider &cfg_provider = ((_wxT*)m_providers->GetPage(idx))->GetProvider();
|
||||
|
||||
if (wxMessageBox(tstring_printf(_("Are you sure you want to permanently remove %ls provider from configuration?"), cfg_provider.m_name.c_str()), _("Warning"), wxYES_NO, this) == wxYES) {
|
||||
// Delete provider.
|
||||
eap::config_connection::provider_list::iterator it(m_cfg.m_providers.begin());
|
||||
for (int i = 0; i < idx; i++, ++it);
|
||||
m_cfg.m_providers.erase(it);
|
||||
m_providers->DeletePage(idx);
|
||||
if ((size_t)idx < m_providers->GetPageCount())
|
||||
m_providers->SetSelection(idx);
|
||||
|
||||
this->Layout();
|
||||
this->Fit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual void OnProvAdvanced(wxCommandEvent& /*event*/)
|
||||
{
|
||||
int idx = m_providers->GetSelection();
|
||||
eap::config_provider &cfg_provider = ((_wxT*)m_providers->GetPage(idx))->GetProvider();
|
||||
|
||||
wxEAPConfigProvider dlg(cfg_provider, this);
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
m_providers->SetPageText(idx, wxEAPGetProviderName(cfg_provider.m_name));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
||||
protected:
|
||||
eap::config_connection &m_cfg; ///< Connection configuration
|
||||
};
|
||||
@@ -268,6 +353,21 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class wxEAPCredentialsConnectionDialog : public wxEAPCredentialsConnectionDialogBase
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a credential dialog
|
||||
///
|
||||
wxEAPCredentialsConnectionDialog(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = _("EAP Credentials"), const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
protected:
|
||||
/// \cond internal
|
||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
||||
/// \endcond
|
||||
};
|
||||
|
||||
|
||||
class wxEAPNotePanel : public wxEAPNotePanelBase
|
||||
{
|
||||
public:
|
||||
@@ -347,35 +447,38 @@ public:
|
||||
/// \param[inout] cfg Configuration data
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPConfigWindow(const eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent);
|
||||
wxEAPConfigWindow(eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent);
|
||||
|
||||
///
|
||||
/// Destructs the configuration window
|
||||
///
|
||||
virtual ~wxEAPConfigWindow();
|
||||
|
||||
public:
|
||||
inline eap::config_provider& GetProvider() const { return m_prov; }
|
||||
inline eap::config_method & GetConfig () const { return m_cfg ; }
|
||||
|
||||
protected:
|
||||
/// \cond internal
|
||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event);
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_method &m_cfg; ///< Method configuration
|
||||
};
|
||||
|
||||
|
||||
class wxEAPProviderIdentityPanel : public wxEAPProviderIdentityPanelBase
|
||||
class wxEAPProviderContactInfoPanel : public wxEAPProviderContactInfoPanelBase
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a provider identity pannel
|
||||
/// Constructs a provider contact info pannel
|
||||
///
|
||||
/// \param[inout] prov Provider configuration data
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPProviderIdentityPanel(eap::config_provider &prov, wxWindow* parent);
|
||||
wxEAPProviderContactInfoPanel(eap::config_provider &prov, wxWindow* parent);
|
||||
|
||||
friend class wxEAPConfigProvider; // Allows direct setting of keyboard focus
|
||||
|
||||
@@ -386,7 +489,29 @@ protected:
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< EAP method configuration
|
||||
eap::config_provider &m_prov; ///< Provider configuration
|
||||
};
|
||||
|
||||
|
||||
class wxEAPProviderIDPanel : public wxEAPProviderIDPanelBase
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a provider identity pannel
|
||||
///
|
||||
/// \param[inout] prov Provider configuration data
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPProviderIDPanel(eap::config_provider &prov, wxWindow* parent);
|
||||
|
||||
protected:
|
||||
/// \cond internal
|
||||
virtual bool TransferDataToWindow();
|
||||
virtual bool TransferDataFromWindow();
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< Provider configuration
|
||||
};
|
||||
|
||||
|
||||
@@ -425,7 +550,8 @@ public:
|
||||
|
||||
protected:
|
||||
eap::config_provider &m_prov; ///< EAP method configuration
|
||||
wxEAPProviderIdentityPanel *m_identity; ///< Provider identity panel
|
||||
wxEAPProviderContactInfoPanel *m_contact; ///< Provider contact info panel
|
||||
wxEAPProviderIDPanel *m_identity; ///< Provider identity panel
|
||||
wxEAPProviderLockPanel *m_lock; ///< Provider lock panel
|
||||
};
|
||||
|
||||
@@ -439,14 +565,14 @@ public:
|
||||
///
|
||||
/// \param[in] prov Provider configuration data
|
||||
/// \param[inout] cfg Configuration data
|
||||
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
|
||||
/// \param[in] parent Parent window
|
||||
///
|
||||
wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, LPCTSTR pszCredTarget, wxWindow *parent) :
|
||||
wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, wxWindow *parent) :
|
||||
m_prov(prov),
|
||||
m_cfg(cfg),
|
||||
m_target(pszCredTarget),
|
||||
m_cred(cfg.m_module),
|
||||
m_has_own(false),
|
||||
m_cred_own(cfg.m_module),
|
||||
m_cred_preshared(cfg.m_module),
|
||||
wxEAPCredentialsConfigPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
@@ -473,7 +599,13 @@ protected:
|
||||
else
|
||||
m_preshared->SetValue(true);
|
||||
|
||||
m_cred = *(_Tcred*)m_cfg.m_preshared.get();
|
||||
if (m_cfg.m_allow_save) {
|
||||
RetrieveOwnCredentials();
|
||||
m_timer_own.Start(3000);
|
||||
}
|
||||
|
||||
m_cred_preshared = *(_Tcred*)m_cfg.m_preshared.get();
|
||||
UpdatePresharedIdentity();
|
||||
|
||||
return wxEAPCredentialsConfigPanelBase::TransferDataToWindow();
|
||||
}
|
||||
@@ -486,51 +618,31 @@ protected:
|
||||
if (!m_prov.m_read_only) {
|
||||
// This is not a provider-locked configuration. Save the data.
|
||||
m_cfg.m_use_preshared = !m_own->GetValue();
|
||||
*m_cfg.m_preshared = m_cred;
|
||||
*m_cfg.m_preshared = m_cred_preshared;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event)
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& /*event*/)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
DWORD dwResult;
|
||||
|
||||
if (m_cfg.m_allow_save) {
|
||||
bool has_own;
|
||||
std::unique_ptr<CREDENTIAL, winstd::CredFree_delete<CREDENTIAL> > cred;
|
||||
if (CredRead(m_cred.target_name(m_target.c_str()).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
|
||||
m_own_identity->SetValue(cred->UserName && cred->UserName[0] != 0 ? cred->UserName : _("<blank>"));
|
||||
has_own = true;
|
||||
} else if ((dwResult = GetLastError()) == ERROR_NOT_FOUND) {
|
||||
m_own_identity->Clear();
|
||||
has_own = false;
|
||||
} else {
|
||||
m_own_identity->SetValue(wxString::Format(_("<error %u>"), dwResult));
|
||||
has_own = true;
|
||||
}
|
||||
|
||||
if (m_own->GetValue()) {
|
||||
m_own_identity->Enable(true);
|
||||
m_own_set ->Enable(true);
|
||||
m_own_clear ->Enable(has_own);
|
||||
m_own_clear ->Enable(m_has_own);
|
||||
} else {
|
||||
m_own_identity->Enable(false);
|
||||
m_own_set ->Enable(false);
|
||||
m_own_clear ->Enable(false);
|
||||
}
|
||||
} else {
|
||||
m_own_identity->Clear();
|
||||
|
||||
m_own_identity->Enable(false);
|
||||
m_own_set ->Enable(false);
|
||||
m_own_clear ->Enable(false);
|
||||
}
|
||||
|
||||
m_preshared_identity->SetValue(!m_cred.empty() ? m_cred.get_name() : _("<blank>"));
|
||||
|
||||
if (m_prov.m_read_only) {
|
||||
// This is provider-locked configuration. Disable controls.
|
||||
// To avoid run-away selection of radio buttons, disable the selected one last.
|
||||
@@ -546,7 +658,7 @@ protected:
|
||||
} else {
|
||||
// This is not a provider-locked configuration. Selectively enable/disable controls.
|
||||
m_own ->Enable(true);
|
||||
m_preshared ->Enable(true);
|
||||
m_preshared->Enable(true);
|
||||
if (m_own->GetValue()) {
|
||||
m_preshared_identity->Enable(false);
|
||||
m_preshared_set ->Enable(false);
|
||||
@@ -558,57 +670,96 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
virtual void OnSetOwn(wxCommandEvent& event)
|
||||
virtual void OnSetOwn(wxCommandEvent& /*event*/)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
// Read credentials from Credential Manager
|
||||
_Tcred cred(m_cfg.m_module);
|
||||
try {
|
||||
cred.retrieve(m_target.c_str());
|
||||
} catch (winstd::win_runtime_error &err) {
|
||||
if (err.number() != ERROR_NOT_FOUND)
|
||||
wxLogError(winstd::tstring_printf(_("Error reading credentials from Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||
} catch (...) {
|
||||
wxLogError(_("Reading credentials failed."));
|
||||
}
|
||||
// Read credentials from Credential Manager.
|
||||
RetrieveOwnCredentials();
|
||||
|
||||
// Display credential prompt.
|
||||
wxEAPCredentialsDialog dlg(m_prov, this);
|
||||
_wxT *panel = new _wxT(m_prov, m_cfg, cred, m_target.c_str(), &dlg, true);
|
||||
_wxT *panel = new _wxT(m_prov, m_cfg, m_cred_own, &dlg, true);
|
||||
dlg.AddContent(panel);
|
||||
if (dlg.ShowModal() == wxID_OK && panel->GetRememberValue()) {
|
||||
if (dlg.ShowModal() == wxID_OK && panel->GetRemember()) {
|
||||
// Write credentials to credential manager.
|
||||
try {
|
||||
cred.store(m_target.c_str());
|
||||
m_cred_own.store(m_prov.get_id().c_str());
|
||||
m_has_own = TRUE;
|
||||
UpdateOwnIdentity();
|
||||
} catch (winstd::win_runtime_error &err) {
|
||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||
RetrieveOwnCredentials();
|
||||
} catch (...) {
|
||||
wxLogError(_("Writing credentials failed."));
|
||||
RetrieveOwnCredentials();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual void OnClearOwn(wxCommandEvent& event)
|
||||
virtual void OnClearOwn(wxCommandEvent& /*event*/)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
if (!CredDelete(m_cred.target_name(m_target.c_str()).c_str(), CRED_TYPE_GENERIC, 0))
|
||||
if (CredDelete(m_cred_own.target_name(m_prov.get_id().c_str()).c_str(), CRED_TYPE_GENERIC, 0)) {
|
||||
m_own_identity->Clear();
|
||||
m_has_own = false;
|
||||
} else
|
||||
wxLogError(_("Deleting credentials failed (error %u)."), GetLastError());
|
||||
}
|
||||
|
||||
|
||||
virtual void OnSetPreshared(wxCommandEvent& event)
|
||||
virtual void OnSetPreshared(wxCommandEvent& /*event*/)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
wxEAPCredentialsDialog dlg(m_prov, this);
|
||||
|
||||
_wxT *panel = new _wxT(m_prov, m_cfg, m_cred, _T(""), &dlg, true);
|
||||
_wxT *panel = new _wxT(m_prov, m_cfg, m_cred_preshared, &dlg, true);
|
||||
|
||||
dlg.AddContent(panel);
|
||||
dlg.ShowModal();
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
UpdatePresharedIdentity();
|
||||
}
|
||||
|
||||
|
||||
virtual void OnTimerOwn(wxTimerEvent& /*event*/)
|
||||
{
|
||||
RetrieveOwnCredentials();
|
||||
}
|
||||
|
||||
|
||||
void RetrieveOwnCredentials()
|
||||
{
|
||||
try {
|
||||
m_cred_own.retrieve(m_prov.get_id().c_str());
|
||||
m_has_own = true;
|
||||
UpdateOwnIdentity();
|
||||
} catch (winstd::win_runtime_error &err) {
|
||||
if (err.number() == ERROR_NOT_FOUND) {
|
||||
m_own_identity->Clear();
|
||||
m_has_own = false;
|
||||
} else {
|
||||
m_own_identity->SetValue(wxString::Format(_("<error %u>"), err.number()));
|
||||
m_has_own = true;
|
||||
}
|
||||
} catch (...) {
|
||||
m_own_identity->SetValue(_("<error>"));
|
||||
m_has_own = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void UpdateOwnIdentity()
|
||||
{
|
||||
wxString identity(m_cred_own.get_identity());
|
||||
m_own_identity->SetValue(
|
||||
!identity.empty() ? identity :
|
||||
m_cred_own.empty() ? _("<empty>") : _("<blank ID>"));
|
||||
}
|
||||
|
||||
|
||||
inline void UpdatePresharedIdentity()
|
||||
{
|
||||
wxString identity(m_cred_preshared.get_identity());
|
||||
m_preshared_identity->SetValue(
|
||||
!identity.empty() ? identity :
|
||||
m_cred_preshared.empty() ? _("<empty>") : _("<blank ID>"));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
@@ -616,19 +767,20 @@ protected:
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
eap::config_method_with_cred &m_cfg; ///< EAP method configuration
|
||||
winstd::tstring m_target; ///< Credential Manager target
|
||||
|
||||
private:
|
||||
_Tcred m_cred; ///< Temporary credential data
|
||||
bool m_has_own; ///< Does the user has (some sort of) credentials stored in Credential Manager?
|
||||
_Tcred m_cred_own; ///< Temporary own credential data
|
||||
_Tcred m_cred_preshared; ///< Temporary pre-shared credential data
|
||||
};
|
||||
|
||||
|
||||
template <class _Tcred, class _Tbase>
|
||||
class wxEAPCredentialsPanelBase : public _Tbase
|
||||
class wxEAPCredentialsPanel : public _Tbase
|
||||
{
|
||||
private:
|
||||
/// \cond internal
|
||||
typedef wxEAPCredentialsPanelBase<_Tcred, _Tbase> _Tthis;
|
||||
typedef wxEAPCredentialsPanel<_Tcred, _Tbase> _Tthis;
|
||||
/// \endcond
|
||||
|
||||
public:
|
||||
@@ -638,32 +790,24 @@ public:
|
||||
/// \param[in] prov Provider configuration data
|
||||
/// \param[in] cfg Configuration data
|
||||
/// \param[inout] cred Credentials data
|
||||
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
|
||||
/// \param[in] parent Parent window
|
||||
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
|
||||
///
|
||||
wxEAPCredentialsPanelBase(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
|
||||
wxEAPCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) :
|
||||
m_prov(prov),
|
||||
m_cfg(cfg),
|
||||
m_cred(cred),
|
||||
m_target(pszCredTarget),
|
||||
m_is_config(is_config),
|
||||
_Tbase(parent)
|
||||
{
|
||||
this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(_Tthis::OnUpdateUI));
|
||||
}
|
||||
|
||||
virtual ~wxEAPCredentialsPanelBase()
|
||||
{
|
||||
this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(_Tthis::OnUpdateUI));
|
||||
}
|
||||
|
||||
inline void SetRememberValue(bool val)
|
||||
virtual void SetRemember(bool val)
|
||||
{
|
||||
return m_remember->SetValue(val);
|
||||
}
|
||||
|
||||
inline bool GetRememberValue() const
|
||||
virtual bool GetRemember() const
|
||||
{
|
||||
return m_remember->GetValue();
|
||||
}
|
||||
@@ -671,10 +815,8 @@ public:
|
||||
protected:
|
||||
/// \cond internal
|
||||
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event)
|
||||
virtual bool TransferDataToWindow()
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
if (m_is_config) {
|
||||
// Configuration mode
|
||||
// Always store credentials (somewhere).
|
||||
@@ -689,6 +831,8 @@ protected:
|
||||
m_remember->SetValue(false);
|
||||
m_remember->Enable(false);
|
||||
}
|
||||
|
||||
return _Tbase::TransferDataToWindow();
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
@@ -697,13 +841,12 @@ protected:
|
||||
const eap::config_provider &m_prov; ///< Provider configuration
|
||||
const eap::config_method_with_cred &m_cfg; ///< Method configuration
|
||||
_Tcred &m_cred; ///< Credentials
|
||||
winstd::tstring m_target; ///< Credential Manager target
|
||||
bool m_is_config; ///< Is this a configuration dialog?
|
||||
};
|
||||
|
||||
|
||||
template <class _Tcred, class _Tbase>
|
||||
class wxPasswordCredentialsPanel : public wxEAPCredentialsPanelBase<_Tcred, _Tbase>
|
||||
class wxPasswordCredentialsPanel : public wxEAPCredentialsPanel<_Tcred, _Tbase>
|
||||
{
|
||||
public:
|
||||
///
|
||||
@@ -712,12 +855,11 @@ public:
|
||||
/// \param[in] prov Provider configuration data
|
||||
/// \param[in] cfg Configuration data
|
||||
/// \param[inout] cred Credentials data
|
||||
/// \param[in] pszCredTarget Target name of credentials in Windows Credential Manager. Can be further decorated to create final target name.
|
||||
/// \param[in] parent Parent window
|
||||
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
|
||||
///
|
||||
wxPasswordCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
|
||||
wxEAPCredentialsPanelBase<_Tcred, _Tbase>(prov, cfg, cred, pszCredTarget, parent, is_config)
|
||||
wxPasswordCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, wxWindow* parent, bool is_config = false) :
|
||||
wxEAPCredentialsPanel<_Tcred, _Tbase>(prov, cfg, cred, parent, is_config)
|
||||
{
|
||||
// Load and set icon.
|
||||
winstd::library lib_shell32;
|
||||
@@ -727,7 +869,7 @@ public:
|
||||
bool layout = false;
|
||||
if (!m_prov.m_lbl_alt_credential.empty()) {
|
||||
m_credentials_label->SetLabel(m_prov.m_lbl_alt_credential);
|
||||
m_credentials_label->Wrap( 446 );
|
||||
m_credentials_label->Wrap( 440 );
|
||||
layout = true;
|
||||
}
|
||||
|
||||
@@ -754,12 +896,20 @@ protected:
|
||||
m_identity->SetSelection(0, -1);
|
||||
m_password->SetValue(m_cred.m_password.empty() ? wxEmptyString : s_dummy_password);
|
||||
|
||||
return wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataToWindow();
|
||||
if (!m_is_config && m_cfg.m_use_preshared) {
|
||||
// Credential prompt mode & Using pre-shared credentials
|
||||
m_identity_label->Enable(false);
|
||||
m_identity ->Enable(false);
|
||||
m_password_label->Enable(false);
|
||||
m_password ->Enable(false);
|
||||
}
|
||||
|
||||
return wxEAPCredentialsPanel<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataToWindow();
|
||||
}
|
||||
|
||||
virtual bool TransferDataFromWindow()
|
||||
{
|
||||
if (!wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataFromWindow())
|
||||
if (!wxEAPCredentialsPanel<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataFromWindow())
|
||||
return false;
|
||||
|
||||
m_cred.m_identity = m_identity->GetValue();
|
||||
@@ -772,19 +922,6 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnUpdateUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
if (!m_is_config && m_cfg.m_use_preshared) {
|
||||
// Credential prompt mode & Using pre-shared credentials
|
||||
m_identity_label->Enable(false);
|
||||
m_identity ->Enable(false);
|
||||
m_password_label->Enable(false);
|
||||
m_password ->Enable(false);
|
||||
}
|
||||
|
||||
wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::OnUpdateUI(event);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
private:
|
||||
@@ -826,6 +963,36 @@ inline wxString wxEAPGetProviderName(const std::wstring &id)
|
||||
}
|
||||
|
||||
|
||||
inline void wxInitializeConfig()
|
||||
{
|
||||
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(PRODUCT_NAME_STR), wxT(VENDOR_NAME_STR)));
|
||||
if (cfgPrev) wxDELETE(cfgPrev);
|
||||
}
|
||||
|
||||
|
||||
inline bool wxInitializeLocale(wxLocale &locale)
|
||||
{
|
||||
// Read language from configuration.
|
||||
wxLanguage lang_code;
|
||||
wxString lang;
|
||||
if (wxConfigBase::Get()->Read(wxT("Language"), &lang)) {
|
||||
const wxLanguageInfo *lang_info = wxLocale::FindLanguageInfo(lang);
|
||||
lang_code = lang_info ? (wxLanguage)lang_info->Language : wxLANGUAGE_DEFAULT;
|
||||
} else
|
||||
lang_code = wxLANGUAGE_DEFAULT;
|
||||
|
||||
if (wxLocale::IsAvailable(lang_code)) {
|
||||
// Language is "available". Well... Known actually.
|
||||
wxString sPath;
|
||||
if (wxConfigBase::Get()->Read(wxT("LocalizationRepositoryPath"), &sPath))
|
||||
locale.AddCatalogLookupPathPrefix(sPath);
|
||||
return locale.Init(lang_code);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class monitor_ui
|
||||
|
48
lib/EAPBase_UI/include/wxEAP_UIBase.h
Normal file
48
lib/EAPBase_UI/include/wxEAP_UIBase.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
///
|
||||
/// Base class for all credential entry panel that must provide "Remember" credentials checkbox
|
||||
///
|
||||
class wxEAPCredentialsPanelBase;
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/panel.h>
|
||||
|
||||
|
||||
class wxEAPCredentialsPanelBase : public wxPanel
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a wxPanel with "Remember" credentials checkbox
|
||||
///
|
||||
wxEAPCredentialsPanelBase(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr) : wxPanel(parent, winid, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetRemember(bool val) = 0;
|
||||
virtual bool GetRemember() const = 0;
|
||||
};
|
@@ -34,10 +34,20 @@ wxEAPConfigDialogBase::wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id, c
|
||||
wxBoxSizer* sb_bottom_horiz_inner;
|
||||
sb_bottom_horiz_inner = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_advanced = new wxButton( this, wxID_ANY, _("Advanced..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_advanced->SetToolTip( _("Opens dialog with provider settings") );
|
||||
m_prov_add = new wxButton( this, wxID_ANY, _("+"), wxDefaultPosition, wxSize( 30,-1 ), 0 );
|
||||
m_prov_add->SetToolTip( _("Adds new provider") );
|
||||
|
||||
sb_bottom_horiz_inner->Add( m_advanced, 0, wxALL, 5 );
|
||||
sb_bottom_horiz_inner->Add( m_prov_add, 0, wxALL, 5 );
|
||||
|
||||
m_prov_remove = new wxButton( this, wxID_ANY, _("-"), wxDefaultPosition, wxSize( 30,-1 ), 0 );
|
||||
m_prov_remove->SetToolTip( _("Removes selected provider") );
|
||||
|
||||
sb_bottom_horiz_inner->Add( m_prov_remove, 0, wxALL, 5 );
|
||||
|
||||
m_prov_advanced = new wxButton( this, wxID_ANY, _("Advanced..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_prov_advanced->SetToolTip( _("Opens dialog with provider settings") );
|
||||
|
||||
sb_bottom_horiz_inner->Add( m_prov_advanced, 0, wxALL, 5 );
|
||||
|
||||
|
||||
sb_bottom_horiz->Add( sb_bottom_horiz_inner, 1, wxEXPAND, 5 );
|
||||
@@ -62,7 +72,9 @@ wxEAPConfigDialogBase::wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id, c
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPConfigDialogBase::OnInitDialog ) );
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPConfigDialogBase::OnUpdateUI ) );
|
||||
m_advanced->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnAdvanced ), NULL, this );
|
||||
m_prov_add->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvAdd ), NULL, this );
|
||||
m_prov_remove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvRemove ), NULL, this );
|
||||
m_prov_advanced->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvAdvanced ), NULL, this );
|
||||
}
|
||||
|
||||
wxEAPConfigDialogBase::~wxEAPConfigDialogBase()
|
||||
@@ -70,7 +82,9 @@ wxEAPConfigDialogBase::~wxEAPConfigDialogBase()
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPConfigDialogBase::OnInitDialog ) );
|
||||
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPConfigDialogBase::OnUpdateUI ) );
|
||||
m_advanced->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnAdvanced ), NULL, this );
|
||||
m_prov_add->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvAdd ), NULL, this );
|
||||
m_prov_remove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvRemove ), NULL, this );
|
||||
m_prov_advanced->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPConfigDialogBase::OnProvAdvanced ), NULL, this );
|
||||
|
||||
}
|
||||
|
||||
@@ -115,6 +129,48 @@ wxEAPGeneralDialogBase::~wxEAPGeneralDialogBase()
|
||||
|
||||
}
|
||||
|
||||
wxEAPCredentialsConnectionDialogBase::wxEAPCredentialsConnectionDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* sb_content;
|
||||
sb_content = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_banner = new wxEAPBannerPanel( this );
|
||||
|
||||
sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_providers = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_providers->SetExtraStyle( wxWS_EX_VALIDATE_RECURSIVELY );
|
||||
|
||||
|
||||
sb_content->Add( m_providers, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_buttons = new wxStdDialogButtonSizer();
|
||||
m_buttonsOK = new wxButton( this, wxID_OK );
|
||||
m_buttons->AddButton( m_buttonsOK );
|
||||
m_buttonsCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_buttons->AddButton( m_buttonsCancel );
|
||||
m_buttons->Realize();
|
||||
|
||||
sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
this->SetSizer( sb_content );
|
||||
this->Layout();
|
||||
sb_content->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPCredentialsConnectionDialogBase::OnInitDialog ) );
|
||||
}
|
||||
|
||||
wxEAPCredentialsConnectionDialogBase::~wxEAPCredentialsConnectionDialogBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxEAPCredentialsConnectionDialogBase::OnInitDialog ) );
|
||||
|
||||
}
|
||||
|
||||
wxEAPBannerPanelBase::wxEAPBannerPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
{
|
||||
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
@@ -183,7 +239,7 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare
|
||||
sb_credentials_vert = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_credentials_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Manage credentials used to connect."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_credentials_label->Wrap( 446 );
|
||||
m_credentials_label->Wrap( 440 );
|
||||
sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* sb_cred_radio;
|
||||
@@ -272,12 +328,14 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare
|
||||
|
||||
this->SetSizer( sb_credentials );
|
||||
this->Layout();
|
||||
m_timer_own.SetOwner( this, wxID_ANY );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPCredentialsConfigPanelBase::OnUpdateUI ) );
|
||||
m_own_clear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnClearOwn ), NULL, this );
|
||||
m_own_set->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSetOwn ), NULL, this );
|
||||
m_preshared_set->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSetPreshared ), NULL, this );
|
||||
this->Connect( wxID_ANY, wxEVT_TIMER, wxTimerEventHandler( wxEAPCredentialsConfigPanelBase::OnTimerOwn ) );
|
||||
}
|
||||
|
||||
wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase()
|
||||
@@ -287,10 +345,11 @@ wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase()
|
||||
m_own_clear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnClearOwn ), NULL, this );
|
||||
m_own_set->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSetOwn ), NULL, this );
|
||||
m_preshared_set->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPCredentialsConfigPanelBase::OnSetPreshared ), NULL, this );
|
||||
this->Disconnect( wxID_ANY, wxEVT_TIMER, wxTimerEventHandler( wxEAPCredentialsConfigPanelBase::OnTimerOwn ) );
|
||||
|
||||
}
|
||||
|
||||
wxEAPCredentialsPassPanelBase::wxEAPCredentialsPassPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
wxEAPCredentialsPassPanelBase::wxEAPCredentialsPassPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style )
|
||||
{
|
||||
wxStaticBoxSizer* sb_credentials;
|
||||
sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Client Credentials") ), wxVERTICAL );
|
||||
@@ -305,7 +364,7 @@ wxEAPCredentialsPassPanelBase::wxEAPCredentialsPassPanelBase( wxWindow* parent,
|
||||
sb_credentials_vert = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_credentials_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Please provide your user ID and password."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_credentials_label->Wrap( 446 );
|
||||
m_credentials_label->Wrap( 440 );
|
||||
sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* sb_credentials_tbl;
|
||||
@@ -355,10 +414,114 @@ wxEAPCredentialsPassPanelBase::~wxEAPCredentialsPassPanelBase()
|
||||
{
|
||||
}
|
||||
|
||||
wxEAPProviderIdentityPanelBase::wxEAPProviderIdentityPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
{
|
||||
wxStaticBoxSizer* sb_provider_contact;
|
||||
sb_provider_contact = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Your Organization") ), wxVERTICAL );
|
||||
|
||||
wxBoxSizer* sb_provider_contact_horiz;
|
||||
sb_provider_contact_horiz = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_provider_contact_icon = new wxStaticBitmap( sb_provider_contact->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sb_provider_contact_horiz->Add( m_provider_contact_icon, 0, wxALL, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_contact_vert;
|
||||
sb_provider_contact_vert = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_contact_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Describe your organization to customize user prompts. When organization is introduced, end-users find program messages easier to understand and act."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_contact_label->Wrap( 440 );
|
||||
sb_provider_contact_vert->Add( m_provider_contact_label, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_name;
|
||||
sb_provider_name = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_name_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Your organization &name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name_label->Wrap( -1 );
|
||||
sb_provider_name->Add( m_provider_name_label, 0, wxBOTTOM, 5 );
|
||||
|
||||
m_provider_name = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name->SetToolTip( _("Your organization name as it will appear on helpdesk contact notifications") );
|
||||
|
||||
sb_provider_name->Add( m_provider_name, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_name_note = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("(Keep it short, please)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name_note->Wrap( -1 );
|
||||
sb_provider_name->Add( m_provider_name_note, 0, wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
sb_provider_contact_vert->Add( sb_provider_name, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_helpdesk;
|
||||
sb_provider_helpdesk = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_helpdesk_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Helpdesk contact &information:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_helpdesk_label->Wrap( -1 );
|
||||
sb_provider_helpdesk->Add( m_provider_helpdesk_label, 0, wxBOTTOM, 5 );
|
||||
|
||||
wxFlexGridSizer* sb_provider_helpdesk_inner;
|
||||
sb_provider_helpdesk_inner = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
sb_provider_helpdesk_inner->AddGrowableCol( 1 );
|
||||
sb_provider_helpdesk_inner->SetFlexibleDirection( wxBOTH );
|
||||
sb_provider_helpdesk_inner->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_provider_web_icon = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("¶"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_web_icon->Wrap( -1 );
|
||||
m_provider_web_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_web_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_provider_web = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_web->SetToolTip( _("Your helpdesk website address") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_web, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_email_icon = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_email_icon->Wrap( -1 );
|
||||
m_provider_email_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_email_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_provider_email = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_email->SetToolTip( _("Your helpdesk e-mail address") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_email, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_phone_icon = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_phone_icon->Wrap( -1 );
|
||||
m_provider_phone_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_phone_icon, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_provider_phone = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_phone->SetToolTip( _("Your helpdesk phone number") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_phone, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
sb_provider_helpdesk->Add( sb_provider_helpdesk_inner, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sb_provider_contact_vert->Add( sb_provider_helpdesk, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
sb_provider_contact_horiz->Add( sb_provider_contact_vert, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sb_provider_contact->Add( sb_provider_contact_horiz, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( sb_provider_contact );
|
||||
this->Layout();
|
||||
}
|
||||
|
||||
wxEAPProviderContactInfoPanelBase::~wxEAPProviderContactInfoPanelBase()
|
||||
{
|
||||
}
|
||||
|
||||
wxEAPProviderIDPanelBase::wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
{
|
||||
wxStaticBoxSizer* sb_provider_id;
|
||||
sb_provider_id = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Your Organization") ), wxVERTICAL );
|
||||
sb_provider_id = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Provider Unique Identifier") ), wxVERTICAL );
|
||||
|
||||
wxBoxSizer* sb_provider_id_horiz;
|
||||
sb_provider_id_horiz = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -369,80 +532,40 @@ wxEAPProviderIdentityPanelBase::wxEAPProviderIdentityPanelBase( wxWindow* parent
|
||||
wxBoxSizer* sb_provider_id_vert;
|
||||
sb_provider_id_vert = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_id_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Describe your organization to customize user prompts. When organization is introduced, end-users find program messages easier to understand and act."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_id_label->Wrap( 446 );
|
||||
sb_provider_id_vert->Add( m_provider_id_label, 0, wxALL|wxEXPAND, 5 );
|
||||
m_provider_id_label_outer = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Assign your organization a unique ID to allow sharing the same credential set across different network profiles."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_id_label_outer->Wrap( 440 );
|
||||
sb_provider_id_vert->Add( m_provider_id_label_outer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_name;
|
||||
sb_provider_name = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* sb_provider_namespace;
|
||||
sb_provider_namespace = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_name_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Your organization &name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name_label->Wrap( -1 );
|
||||
sb_provider_name->Add( m_provider_name_label, 0, wxBOTTOM, 5 );
|
||||
m_provider_namespace_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("&Namespace:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_namespace_label->Wrap( -1 );
|
||||
sb_provider_namespace->Add( m_provider_namespace_label, 0, wxBOTTOM, 5 );
|
||||
|
||||
m_provider_name = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name->SetToolTip( _("Your organization name as it will appear on helpdesk contact notifications") );
|
||||
|
||||
sb_provider_name->Add( m_provider_name, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_name_note = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("(Keep it short, please)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_name_note->Wrap( -1 );
|
||||
sb_provider_name->Add( m_provider_name_note, 0, wxALIGN_RIGHT, 5 );
|
||||
wxString m_provider_namespaceChoices[] = { _("urn:RFC4282:realm"), _("urn:uuid") };
|
||||
int m_provider_namespaceNChoices = sizeof( m_provider_namespaceChoices ) / sizeof( wxString );
|
||||
m_provider_namespace = new wxChoice( sb_provider_id->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_provider_namespaceNChoices, m_provider_namespaceChoices, 0 );
|
||||
m_provider_namespace->SetSelection( 0 );
|
||||
sb_provider_namespace->Add( m_provider_namespace, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sb_provider_id_vert->Add( sb_provider_name, 0, wxEXPAND|wxALL, 5 );
|
||||
sb_provider_id_vert->Add( sb_provider_namespace, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_helpdesk;
|
||||
sb_provider_helpdesk = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* sb_provider_id_inner;
|
||||
sb_provider_id_inner = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_helpdesk_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Helpdesk contact &information:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_helpdesk_label->Wrap( -1 );
|
||||
sb_provider_helpdesk->Add( m_provider_helpdesk_label, 0, wxBOTTOM, 5 );
|
||||
m_provider_id_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Provider unique &identifier:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_id_label->Wrap( -1 );
|
||||
sb_provider_id_inner->Add( m_provider_id_label, 0, wxBOTTOM, 5 );
|
||||
|
||||
wxFlexGridSizer* sb_provider_helpdesk_inner;
|
||||
sb_provider_helpdesk_inner = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
sb_provider_helpdesk_inner->AddGrowableCol( 1 );
|
||||
sb_provider_helpdesk_inner->SetFlexibleDirection( wxBOTH );
|
||||
sb_provider_helpdesk_inner->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
m_provider_id = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_id->SetToolTip( _("Your organization ID to assign same credentials from other profiles") );
|
||||
|
||||
m_provider_web_icon = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("¶"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_web_icon->Wrap( -1 );
|
||||
m_provider_web_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
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 address") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_web, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_email_icon = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_email_icon->Wrap( -1 );
|
||||
m_provider_email_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_email_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_provider_email = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_email->SetToolTip( _("Your helpdesk e-mail address") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_email, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_phone_icon = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_phone_icon->Wrap( -1 );
|
||||
m_provider_phone_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Wingdings") ) );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_phone_icon, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_provider_phone = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_phone->SetToolTip( _("Your helpdesk phone number") );
|
||||
|
||||
sb_provider_helpdesk_inner->Add( m_provider_phone, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
sb_provider_id_inner->Add( m_provider_id, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sb_provider_helpdesk->Add( sb_provider_helpdesk_inner, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sb_provider_id_vert->Add( sb_provider_helpdesk, 1, wxEXPAND, 5 );
|
||||
sb_provider_id_vert->Add( sb_provider_id_inner, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
sb_provider_id_horiz->Add( sb_provider_id_vert, 1, wxEXPAND, 5 );
|
||||
@@ -453,16 +576,10 @@ wxEAPProviderIdentityPanelBase::wxEAPProviderIdentityPanelBase( wxWindow* parent
|
||||
|
||||
this->SetSizer( sb_provider_id );
|
||||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPProviderIdentityPanelBase::OnUpdateUI ) );
|
||||
}
|
||||
|
||||
wxEAPProviderIdentityPanelBase::~wxEAPProviderIdentityPanelBase()
|
||||
wxEAPProviderIDPanelBase::~wxEAPProviderIDPanelBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPProviderIdentityPanelBase::OnUpdateUI ) );
|
||||
|
||||
}
|
||||
|
||||
wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
@@ -480,21 +597,21 @@ wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWind
|
||||
sb_provider_lock_vert = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_lock_label = new wxStaticText( sb_provider_lock->GetStaticBox(), wxID_ANY, _("Your configuration can be locked to prevent accidental modification by end-users. Users will only be allowed to enter credentials."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_lock_label->Wrap( 446 );
|
||||
m_provider_lock_label->Wrap( 440 );
|
||||
sb_provider_lock_vert->Add( m_provider_lock_label, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* sb_provider_name;
|
||||
sb_provider_name = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* sb_provider_lock_inner;
|
||||
sb_provider_lock_inner = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_provider_lock = new wxCheckBox( sb_provider_lock->GetStaticBox(), wxID_ANY, _("&Lock this configuration and prevent any further modification via user interface."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sb_provider_name->Add( m_provider_lock, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
sb_provider_lock_inner->Add( m_provider_lock, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_provider_lock_note = new wxStaticText( sb_provider_lock->GetStaticBox(), wxID_ANY, _("(Warning: Once locked, you can not revert using this dialog!)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_provider_lock_note->Wrap( -1 );
|
||||
sb_provider_name->Add( m_provider_lock_note, 0, wxALIGN_RIGHT, 5 );
|
||||
sb_provider_lock_inner->Add( m_provider_lock_note, 0, wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
sb_provider_lock_vert->Add( sb_provider_name, 0, wxEXPAND|wxALL, 5 );
|
||||
sb_provider_lock_vert->Add( sb_provider_lock_inner, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
sb_provider_lock_horiz->Add( sb_provider_lock_vert, 1, wxEXPAND, 5 );
|
||||
@@ -505,14 +622,8 @@ wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWind
|
||||
|
||||
this->SetSizer( sb_provider_lock );
|
||||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPProviderLockPanelBase::OnUpdateUI ) );
|
||||
}
|
||||
|
||||
wxEAPProviderLockPanelBase::~wxEAPProviderLockPanelBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxEAPProviderLockPanelBase::OnUpdateUI ) );
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,9 @@
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class wxEAPCredentialsPanelBase;
|
||||
|
||||
#include "../include/wxEAP_UIBase.h"
|
||||
class wxEAPBannerPanel;
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
@@ -30,7 +33,9 @@ class wxEAPBannerPanel;
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -44,7 +49,9 @@ class wxEAPConfigDialogBase : public wxDialog
|
||||
protected:
|
||||
wxEAPBannerPanel *m_banner;
|
||||
wxNotebook* m_providers;
|
||||
wxButton* m_advanced;
|
||||
wxButton* m_prov_add;
|
||||
wxButton* m_prov_remove;
|
||||
wxButton* m_prov_advanced;
|
||||
wxStdDialogButtonSizer* m_buttons;
|
||||
wxButton* m_buttonsOK;
|
||||
wxButton* m_buttonsCancel;
|
||||
@@ -52,12 +59,14 @@ class wxEAPConfigDialogBase : public wxDialog
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnAdvanced( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnProvAdd( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnProvRemove( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnProvAdvanced( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EAP Method Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
|
||||
wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EAP Connection Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
|
||||
~wxEAPConfigDialogBase();
|
||||
|
||||
};
|
||||
@@ -87,6 +96,31 @@ class wxEAPGeneralDialogBase : public wxDialog
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPCredentialsConnectionDialogBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEAPCredentialsConnectionDialogBase : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxEAPBannerPanel *m_banner;
|
||||
wxStdDialogButtonSizer* m_buttons;
|
||||
wxButton* m_buttonsOK;
|
||||
wxButton* m_buttonsCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
wxNotebook* m_providers;
|
||||
|
||||
wxEAPCredentialsConnectionDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EAP Credentials"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
|
||||
~wxEAPCredentialsConnectionDialogBase();
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPBannerPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -140,12 +174,14 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel
|
||||
wxRadioButton* m_preshared;
|
||||
wxTextCtrl* m_preshared_identity;
|
||||
wxButton* m_preshared_set;
|
||||
wxTimer m_timer_own;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnClearOwn( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSetOwn( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSetPreshared( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnTimerOwn( wxTimerEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
@@ -158,7 +194,7 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPCredentialsPassPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEAPCredentialsPassPanelBase : public wxPanel
|
||||
class wxEAPCredentialsPassPanelBase : public wxEAPCredentialsPanelBase
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -179,15 +215,15 @@ class wxEAPCredentialsPassPanelBase : public wxPanel
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPProviderIdentityPanelBase
|
||||
/// Class wxEAPProviderContactInfoPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEAPProviderIdentityPanelBase : public wxPanel
|
||||
class wxEAPProviderContactInfoPanelBase : public wxPanel
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticBitmap* m_provider_id_icon;
|
||||
wxStaticText* m_provider_id_label;
|
||||
wxStaticBitmap* m_provider_contact_icon;
|
||||
wxStaticText* m_provider_contact_label;
|
||||
wxStaticText* m_provider_name_label;
|
||||
wxTextCtrl* m_provider_name;
|
||||
wxStaticText* m_provider_name_note;
|
||||
@@ -199,14 +235,32 @@ class wxEAPProviderIdentityPanelBase : public wxPanel
|
||||
wxStaticText* m_provider_phone_icon;
|
||||
wxTextCtrl* m_provider_phone;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
public:
|
||||
|
||||
wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL );
|
||||
~wxEAPProviderContactInfoPanelBase();
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPProviderIDPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEAPProviderIDPanelBase : public wxPanel
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticBitmap* m_provider_id_icon;
|
||||
wxStaticText* m_provider_id_label_outer;
|
||||
wxStaticText* m_provider_namespace_label;
|
||||
wxChoice* m_provider_namespace;
|
||||
wxStaticText* m_provider_id_label;
|
||||
wxTextCtrl* m_provider_id;
|
||||
|
||||
public:
|
||||
|
||||
wxEAPProviderIdentityPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL );
|
||||
~wxEAPProviderIdentityPanelBase();
|
||||
wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL );
|
||||
~wxEAPProviderIDPanelBase();
|
||||
|
||||
};
|
||||
|
||||
@@ -223,10 +277,6 @@ class wxEAPProviderLockPanelBase : public wxPanel
|
||||
wxCheckBox* m_provider_lock;
|
||||
wxStaticText* m_provider_lock_note;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL );
|
||||
|
@@ -95,7 +95,45 @@ wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov,
|
||||
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()));
|
||||
m_banner->m_title->SetLabel(wxString::Format(_("%s Credentials"), wxEAPGetProviderName(prov.m_name).c_str()));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// wxEAPCredentialsConnectionDialog
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPCredentialsConnectionDialog::wxEAPCredentialsConnectionDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style) :
|
||||
wxEAPCredentialsConnectionDialogBase(parent, id, title, pos, size, style)
|
||||
{
|
||||
// Set extra style here, as wxFormBuilder overrides all default flags.
|
||||
this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
|
||||
|
||||
// Load window icons.
|
||||
#ifdef __WINDOWS__
|
||||
wxIconBundle icons;
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
|
||||
icons.AddIcon(wxIcon(wxT("product.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
|
||||
this->SetIcons(icons);
|
||||
#else
|
||||
this->SetIcon(wxIcon(wxICON(product.ico)));
|
||||
#endif
|
||||
|
||||
// Set banner title.
|
||||
m_banner->m_title->SetLabel(_("EAP Credentials"));
|
||||
|
||||
m_buttonsOK->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
void wxEAPCredentialsConnectionDialog::OnInitDialog(wxInitDialogEvent& event)
|
||||
{
|
||||
// Forward the event to child panels.
|
||||
for (wxWindowList::compatibility_iterator provider = m_providers->GetChildren().GetFirst(); provider; provider = provider->GetNext()) {
|
||||
wxWindow *prov = wxDynamicCast(provider->GetData(), wxWindow);
|
||||
if (prov)
|
||||
prov->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +164,7 @@ void wxEAPNotePanel::CreateContactFields(const eap::config_provider &prov)
|
||||
{
|
||||
if (!prov.m_help_email.empty() || !prov.m_help_web.empty() || !prov.m_help_phone.empty()) {
|
||||
m_provider_notice = new wxStaticText(this, wxID_ANY, wxString::Format(_("For additional help and instructions, please contact %s at:"),
|
||||
!prov.m_name.empty() ? prov.m_name.c_str() :
|
||||
!prov.m_id .empty() ? winstd::tstring_printf(_("your %ls provider"), prov.m_id.c_str()).c_str() : _("your provider")), wxDefaultPosition, wxDefaultSize, 0);
|
||||
!prov.m_name.empty() ? prov.m_name.c_str() : _("your provider")), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_provider_notice->Wrap(449);
|
||||
m_note_vert->Add(m_provider_notice, 0, wxUP|wxLEFT|wxRIGHT|wxEXPAND, 5);
|
||||
|
||||
@@ -189,8 +226,7 @@ wxEAPProviderLockedPanel::wxEAPProviderLockedPanel(const eap::config_provider &p
|
||||
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() :
|
||||
!prov.m_id .empty() ? winstd::tstring_printf(_("Your %ls provider"), prov.m_id.c_str()).c_str() : _("Your provider")));
|
||||
!prov.m_name.empty() ? prov.m_name.c_str() : _("Your provider")));
|
||||
m_note_label->Wrap(449);
|
||||
|
||||
CreateContactFields(prov);
|
||||
@@ -223,7 +259,7 @@ wxEAPCredentialWarningPanel::wxEAPCredentialWarningPanel(const eap::config_provi
|
||||
// wxEAPConfigWindow
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPConfigWindow::wxEAPConfigWindow(const eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent) :
|
||||
wxEAPConfigWindow::wxEAPConfigWindow(eap::config_provider &prov, eap::config_method &cfg, wxWindow* parent) :
|
||||
m_prov(prov),
|
||||
m_cfg(cfg),
|
||||
wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL)
|
||||
@@ -232,73 +268,54 @@ wxEAPConfigWindow::wxEAPConfigWindow(const eap::config_provider &prov, eap::conf
|
||||
|
||||
// Connect Events
|
||||
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPConfigWindow::OnInitDialog));
|
||||
this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEAPConfigWindow::OnUpdateUI));
|
||||
}
|
||||
|
||||
|
||||
wxEAPConfigWindow::~wxEAPConfigWindow()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxEAPConfigWindow::OnUpdateUI));
|
||||
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPConfigWindow::OnInitDialog));
|
||||
}
|
||||
|
||||
|
||||
void wxEAPConfigWindow::OnInitDialog(wxInitDialogEvent& event)
|
||||
void wxEAPConfigWindow::OnInitDialog(wxInitDialogEvent& /*event*/)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
// Call TransferDataToWindow() manually, as wxScrolledWindow somehow skips that.
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
|
||||
void wxEAPConfigWindow::OnUpdateUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(event);
|
||||
|
||||
if (m_parent && m_parent->IsKindOf(wxCLASSINFO(wxNotebook))) {
|
||||
// We're a notebook page. Set the ID of our provider as our page label.
|
||||
wxNotebook *notebook = (wxNotebook*)m_parent;
|
||||
int idx = notebook->FindPage(this);
|
||||
if (idx != wxNOT_FOUND)
|
||||
notebook->SetPageText(idx, wxEAPGetProviderName(m_prov.m_id));
|
||||
} else
|
||||
this->SetLabel(wxEAPGetProviderName(m_prov.m_id));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// wxEAPProviderIdentityPanel
|
||||
// wxEAPProviderContactInfoPanel
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPProviderIdentityPanel::wxEAPProviderIdentityPanel(eap::config_provider &prov, wxWindow* parent) :
|
||||
wxEAPProviderContactInfoPanel::wxEAPProviderContactInfoPanel(eap::config_provider &prov, wxWindow* parent) :
|
||||
m_prov(prov),
|
||||
wxEAPProviderIdentityPanelBase(parent)
|
||||
wxEAPProviderContactInfoPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
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)));
|
||||
m_provider_contact_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(259)));
|
||||
}
|
||||
|
||||
|
||||
bool wxEAPProviderIdentityPanel::TransferDataToWindow()
|
||||
bool wxEAPProviderContactInfoPanel::TransferDataToWindow()
|
||||
{
|
||||
m_provider_name ->SetValue(m_prov.m_id );
|
||||
m_provider_name ->SetValue(m_prov.m_name );
|
||||
m_provider_web ->SetValue(m_prov.m_help_web );
|
||||
m_provider_email->SetValue(m_prov.m_help_email);
|
||||
m_provider_phone->SetValue(m_prov.m_help_phone);
|
||||
|
||||
return wxEAPProviderIdentityPanelBase::TransferDataToWindow();
|
||||
return wxEAPProviderContactInfoPanelBase::TransferDataToWindow();
|
||||
}
|
||||
|
||||
|
||||
bool wxEAPProviderIdentityPanel::TransferDataFromWindow()
|
||||
bool wxEAPProviderContactInfoPanel::TransferDataFromWindow()
|
||||
{
|
||||
wxCHECK(wxEAPProviderIdentityPanelBase::TransferDataFromWindow(), false);
|
||||
wxCHECK(wxEAPProviderContactInfoPanelBase::TransferDataFromWindow(), false);
|
||||
|
||||
m_prov.m_id = m_provider_name ->GetValue();
|
||||
m_prov.m_name = m_provider_name ->GetValue();
|
||||
m_prov.m_help_web = m_provider_web ->GetValue();
|
||||
m_prov.m_help_email = m_provider_email->GetValue();
|
||||
m_prov.m_help_phone = m_provider_phone->GetValue();
|
||||
@@ -307,6 +324,41 @@ bool wxEAPProviderIdentityPanel::TransferDataFromWindow()
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// wxEAPProviderIDPanel
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxEAPProviderIDPanel::wxEAPProviderIDPanel(eap::config_provider &prov, wxWindow* parent) :
|
||||
m_prov(prov),
|
||||
wxEAPProviderIDPanelBase(parent)
|
||||
{
|
||||
// Load and set icon.
|
||||
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(29)));
|
||||
}
|
||||
|
||||
|
||||
bool wxEAPProviderIDPanel::TransferDataToWindow()
|
||||
{
|
||||
m_provider_namespace->SetStringSelection(m_prov.m_namespace);
|
||||
m_provider_id ->SetValue(m_prov.m_id);
|
||||
|
||||
return wxEAPProviderIDPanelBase::TransferDataToWindow();
|
||||
}
|
||||
|
||||
|
||||
bool wxEAPProviderIDPanel::TransferDataFromWindow()
|
||||
{
|
||||
wxCHECK(wxEAPProviderIDPanelBase::TransferDataFromWindow(), false);
|
||||
|
||||
m_prov.m_namespace = m_provider_namespace->GetStringSelection();
|
||||
m_prov.m_id = m_provider_id ->GetValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// wxEAPProviderLockPanel
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -351,13 +403,16 @@ wxEAPConfigProvider::wxEAPConfigProvider(eap::config_provider &prov, wxWindow *p
|
||||
// Set banner title.
|
||||
m_banner->m_title->SetLabel(title);
|
||||
|
||||
m_identity = new wxEAPProviderIdentityPanel(prov, this);
|
||||
m_contact = new wxEAPProviderContactInfoPanel(prov, this);
|
||||
AddContent(m_contact);
|
||||
|
||||
m_identity = new wxEAPProviderIDPanel(prov, this);
|
||||
AddContent(m_identity);
|
||||
|
||||
m_lock = new wxEAPProviderLockPanel(prov, this);
|
||||
AddContent(m_lock);
|
||||
|
||||
m_identity->m_provider_name->SetFocusFromKbd();
|
||||
m_contact->m_provider_name->SetFocusFromKbd();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>temp\Events.$(Platform).$(Configuration).$(PlatformToolset);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>AFX_TARG_NEU;AFX_TARG_ENU;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
|
Binary file not shown.
2
lib/MSCHAPv2/build/.gitignore
vendored
Normal file
2
lib/MSCHAPv2/build/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/temp
|
||||
/*.user
|
12
lib/MSCHAPv2/build/MSCHAPv2.props
Normal file
12
lib/MSCHAPv2/build/MSCHAPv2.props
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\..\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
103
lib/MSCHAPv2/build/MSCHAPv2.vcxproj
Normal file
103
lib/MSCHAPv2/build/MSCHAPv2.vcxproj
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{86A6D6A0-4B7D-4134-BE81-A5755C77584D}</ProjectGuid>
|
||||
<RootNamespace>MSCHAPv2</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\Win32.props" />
|
||||
<Import Project="..\..\..\include\Debug.props" />
|
||||
<Import Project="MSCHAPv2.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\x64.props" />
|
||||
<Import Project="..\..\..\include\Debug.props" />
|
||||
<Import Project="MSCHAPv2.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\Win32.props" />
|
||||
<Import Project="..\..\..\include\Release.props" />
|
||||
<Import Project="MSCHAPv2.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\x64.props" />
|
||||
<Import Project="..\..\..\include\Release.props" />
|
||||
<Import Project="MSCHAPv2.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\Config.h" />
|
||||
<ClInclude Include="..\include\Credentials.h" />
|
||||
<ClInclude Include="..\include\Method.h" />
|
||||
<ClInclude Include="..\include\MSCHAPv2.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\Config.cpp" />
|
||||
<ClCompile Include="..\src\Credentials.cpp" />
|
||||
<ClCompile Include="..\src\Method.cpp" />
|
||||
<ClCompile Include="..\src\MSCHAPv2.cpp" />
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
47
lib/MSCHAPv2/build/MSCHAPv2.vcxproj.filters
Normal file
47
lib/MSCHAPv2/build/MSCHAPv2.vcxproj.filters
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\Config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\Credentials.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\Method.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\MSCHAPv2.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\Config.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\Credentials.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\Method.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\MSCHAPv2.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
109
lib/MSCHAPv2/include/Config.h
Normal file
109
lib/MSCHAPv2/include/Config.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sal.h>
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// MSCHAPv2 configuration
|
||||
///
|
||||
class config_method_mschapv2;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Credentials.h"
|
||||
#include "../../EAPBase/include/Config.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <sal.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class config_method_mschapv2 : public config_method_with_cred
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs configuration
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
///
|
||||
config_method_mschapv2(_In_ module &mod);
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
///
|
||||
/// \param[in] other Configuration to copy from
|
||||
///
|
||||
config_method_mschapv2(_In_ const config_method_mschapv2 &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
///
|
||||
/// \param[in] other Configuration to move from
|
||||
///
|
||||
config_method_mschapv2(_Inout_ config_method_mschapv2 &&other);
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
///
|
||||
/// \param[in] other Configuration to copy from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_method_mschapv2& operator=(_In_ const config_method_mschapv2 &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
///
|
||||
/// \param[in] other Configuration to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_method_mschapv2& operator=(_Inout_ config_method_mschapv2 &&other);
|
||||
|
||||
///
|
||||
/// Clones configuration
|
||||
///
|
||||
/// \returns Pointer to cloned configuration
|
||||
///
|
||||
virtual config* clone() const;
|
||||
|
||||
///
|
||||
/// Returns EAP method type of this configuration
|
||||
///
|
||||
/// \returns `eap::type_mschapv2`
|
||||
///
|
||||
virtual winstd::eap_type_t get_method_id() const;
|
||||
|
||||
///
|
||||
/// Returns a string \c L"MSCHAPv2"
|
||||
///
|
||||
virtual const wchar_t* get_method_str() const;
|
||||
|
||||
///
|
||||
/// Creates a blank set of credentials suitable for this method
|
||||
///
|
||||
virtual credentials* make_credentials() const;
|
||||
};
|
||||
}
|
122
lib/MSCHAPv2/include/Credentials.h
Normal file
122
lib/MSCHAPv2/include/Credentials.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// MSCHAPv2 credentials
|
||||
///
|
||||
class credentials_mschapv2;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#include "../../EAPBase/include/Credentials.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <sal.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class credentials_mschapv2 : public credentials_pass
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs credentials
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
///
|
||||
credentials_mschapv2(_In_ module &mod);
|
||||
|
||||
///
|
||||
/// Copies credentials
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
credentials_mschapv2(_In_ const credentials_mschapv2 &other);
|
||||
|
||||
///
|
||||
/// Moves credentials
|
||||
///
|
||||
/// \param[in] other Credentials to move from
|
||||
///
|
||||
credentials_mschapv2(_Inout_ credentials_mschapv2 &&other);
|
||||
|
||||
///
|
||||
/// Copies credentials
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
credentials_mschapv2& operator=(_In_ const credentials_mschapv2 &other);
|
||||
|
||||
///
|
||||
/// Moves credentials
|
||||
///
|
||||
/// \param[in] other Credentials to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
credentials_mschapv2& operator=(_Inout_ credentials_mschapv2 &&other);
|
||||
|
||||
///
|
||||
/// Clones credentials
|
||||
///
|
||||
/// \returns Pointer to cloned credentials
|
||||
///
|
||||
virtual config* clone() const;
|
||||
|
||||
/// \name Storage
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// Return target suffix for Windows Credential Manager credential name
|
||||
///
|
||||
virtual LPCTSTR target_suffix() const;
|
||||
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// Combine credentials in the following order:
|
||||
///
|
||||
/// 1. Cached credentials
|
||||
/// 2. Pre-configured credentials
|
||||
/// 3. Stored credentials
|
||||
///
|
||||
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be credentials_mschapv2* type)
|
||||
/// \param[in] cfg Method configuration (must be config_method_mschapv2 type)
|
||||
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
|
||||
///
|
||||
/// \returns
|
||||
/// - \c source_cache Credentials were obtained from EapHost cache
|
||||
/// - \c source_preshared Credentials were set by method configuration
|
||||
/// - \c source_storage Credentials were loaded from Windows Credential Manager
|
||||
///
|
||||
virtual source_t combine(
|
||||
_In_ const credentials *cred_cached,
|
||||
_In_ const config_method_with_cred &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName);
|
||||
};
|
||||
}
|
260
lib/MSCHAPv2/include/MSCHAPv2.h
Normal file
260
lib/MSCHAPv2/include/MSCHAPv2.h
Normal file
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <WinStd/Crypt.h>
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// MSCHAPv2 Challenge
|
||||
///
|
||||
struct challenge_mschapv2;
|
||||
|
||||
///
|
||||
/// MSCHAPv2 Challenge Hash
|
||||
///
|
||||
struct challenge_hash;
|
||||
|
||||
///
|
||||
/// NT-Password Hash
|
||||
///
|
||||
struct nt_password_hash;
|
||||
|
||||
///
|
||||
/// NT-Response
|
||||
///
|
||||
struct nt_response;
|
||||
|
||||
///
|
||||
/// Authenticator Response
|
||||
///
|
||||
struct authenticator_response;
|
||||
|
||||
///
|
||||
/// Creates DES encryption key with given plaintext key
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] key The key (without parity bits)
|
||||
/// \param[in] size Size of \p key (maximum 7B)
|
||||
///
|
||||
winstd::crypt_key create_des_key(_In_ HCRYPTPROV cp, _In_count_(size) const unsigned char *key, _In_ size_t size);
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../EAPBase/include/EAP.h"
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
|
||||
struct __declspec(novtable) challenge_mschapv2 : public sanitizing_blob_xf<16>
|
||||
{
|
||||
///
|
||||
/// Generates random challenge
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
///
|
||||
void randomize(_In_ HCRYPTPROV cp);
|
||||
};
|
||||
|
||||
|
||||
struct __declspec(novtable) challenge_hash : public sanitizing_blob_xf<8>
|
||||
{
|
||||
///
|
||||
/// Constructor
|
||||
///
|
||||
challenge_hash();
|
||||
|
||||
///
|
||||
/// Constructs a challenge hash
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 8.2. ChallengeHash())](https://tools.ietf.org/html/rfc2759#section-8.2)
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] challenge_server Authenticator challenge
|
||||
/// \param[in] challenge_client Peer challenge
|
||||
/// \param[in] username Username
|
||||
///
|
||||
challenge_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username);
|
||||
|
||||
///
|
||||
/// Copies a challenge hash
|
||||
///
|
||||
/// \param[in] other Challenge hash to copy from
|
||||
///
|
||||
challenge_hash(_In_ const sanitizing_blob_f<8> &other);
|
||||
|
||||
#ifdef _DEBUG
|
||||
///
|
||||
/// Moves the challenge hash
|
||||
///
|
||||
/// \param[inout] other Challenge hash to move from
|
||||
///
|
||||
challenge_hash(_Inout_ sanitizing_blob_zf<8> &&other);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
struct __declspec(novtable) nt_password_hash : public sanitizing_blob_xf<16>
|
||||
{
|
||||
///
|
||||
/// Constructor
|
||||
///
|
||||
nt_password_hash();
|
||||
|
||||
///
|
||||
/// Constructs a NT-Password hash
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 8.3. NtPasswordHash())](https://tools.ietf.org/html/rfc2759#section-8.3)
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] password Password
|
||||
///
|
||||
nt_password_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_z_ const wchar_t *password);
|
||||
|
||||
///
|
||||
/// Constructs a hash of NT-Password hash
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 8.4. HashNtPasswordHash())](https://tools.ietf.org/html/rfc2759#section-8.4)
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] pwd_hash NT-Password hash
|
||||
///
|
||||
nt_password_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const nt_password_hash &pwd_hash);
|
||||
|
||||
///
|
||||
/// Copies a NT-Password hash
|
||||
///
|
||||
/// \param[in] other NT-Password to copy from
|
||||
///
|
||||
nt_password_hash(_In_ const sanitizing_blob_f<16> &other);
|
||||
|
||||
#ifdef _DEBUG
|
||||
///
|
||||
/// Moves the NT-Password hash
|
||||
///
|
||||
/// \param[inout] other NT-Password hash to move from
|
||||
///
|
||||
nt_password_hash(_Inout_ sanitizing_blob_zf<16> &&other);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
struct __declspec(novtable) nt_response : public sanitizing_blob_xf<24>
|
||||
{
|
||||
///
|
||||
/// Constructor
|
||||
///
|
||||
nt_response();
|
||||
|
||||
///
|
||||
/// Constructs a NT-Response
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 8.1. GenerateNTResponse())](https://tools.ietf.org/html/rfc2759#section-8.1)
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] challenge_server Authenticator challenge
|
||||
/// \param[in] challenge_client Peer challenge
|
||||
/// \param[in] username Username
|
||||
/// \param[in] password Password
|
||||
///
|
||||
nt_response(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username,
|
||||
_In_z_ const wchar_t *password);
|
||||
|
||||
///
|
||||
/// Copies a NT-Response
|
||||
///
|
||||
/// \param[in] other NT-Response to copy from
|
||||
///
|
||||
nt_response(_In_ const sanitizing_blob_f<24> &other);
|
||||
|
||||
#ifdef _DEBUG
|
||||
///
|
||||
/// Moves the NT-Response
|
||||
///
|
||||
/// \param[inout] other NT-Response to move from
|
||||
///
|
||||
nt_response(_Inout_ sanitizing_blob_zf<24> &&other);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
struct __declspec(novtable) authenticator_response : public sanitizing_blob_xf<20>
|
||||
{
|
||||
///
|
||||
/// Constructor
|
||||
///
|
||||
authenticator_response();
|
||||
|
||||
///
|
||||
/// Constructs an authenticator response
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 8.7. GenerateAuthenticatorResponse())](https://tools.ietf.org/html/rfc2759#section-8.7)
|
||||
///
|
||||
/// \param[in] cp Handle of the cryptographics provider
|
||||
/// \param[in] challenge_server Authenticator challenge
|
||||
/// \param[in] challenge_client Peer challenge
|
||||
/// \param[in] username Username
|
||||
/// \param[in] password Password
|
||||
/// \param[in] nt_resp NT-Response
|
||||
///
|
||||
authenticator_response(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username,
|
||||
_In_z_ const wchar_t *password,
|
||||
_In_ const nt_response &nt_resp);
|
||||
|
||||
///
|
||||
/// Copies an authenticator response
|
||||
///
|
||||
/// \param[in] other Authenticator response to copy from
|
||||
///
|
||||
authenticator_response(_In_ const sanitizing_blob_f<20> &other);
|
||||
|
||||
#ifdef _DEBUG
|
||||
///
|
||||
/// Moves the authenticator response
|
||||
///
|
||||
/// \param[inout] other Authenticator response to move from
|
||||
///
|
||||
authenticator_response(_Inout_ sanitizing_blob_zf<20> &&other);
|
||||
#endif
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
}
|
151
lib/MSCHAPv2/include/Method.h
Normal file
151
lib/MSCHAPv2/include/Method.h
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// MSCHAPv2 method
|
||||
///
|
||||
class method_mschapv2;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Config.h"
|
||||
#include "Credentials.h"
|
||||
#include "MSCHAPv2.h"
|
||||
|
||||
#include "../../EAPBase/include/Method.h"
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class method_mschapv2 : public method_noneap
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Method configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method_mschapv2(_In_ module &module, _In_ config_method_mschapv2 &cfg, _In_ credentials_mschapv2 &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
method_mschapv2(_Inout_ method_mschapv2 &&other);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
method_mschapv2& operator=(_Inout_ method_mschapv2 &&other);
|
||||
|
||||
/// \name Packet processing
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// 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)
|
||||
///
|
||||
virtual void begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_opt_ DWORD dwMaxSendPacketSize = MAXDWORD);
|
||||
|
||||
///
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
virtual void process_request_packet(
|
||||
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
|
||||
_In_ DWORD dwReceivedPacketSize,
|
||||
_Inout_ EapPeerMethodOutput *pEapOutput);
|
||||
|
||||
///
|
||||
/// Obtains the result of an authentication session from the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
|
||||
///
|
||||
virtual void get_result(
|
||||
_In_ EapPeerMethodResultReason reason,
|
||||
_Inout_ EapPeerMethodResult *ppResult);
|
||||
|
||||
/// @}
|
||||
|
||||
friend class method_ttls; // Setting of initial challenge derived from TLS PRF
|
||||
|
||||
protected:
|
||||
///
|
||||
/// Processes AVPs in a Diameter packet
|
||||
///
|
||||
/// \param[in] pck Packet data
|
||||
/// \param[in] size_pck \p pck size in bytes
|
||||
///
|
||||
void process_packet(_In_bytecount_(size_pck) const void *pck, _In_ size_t size_pck);
|
||||
|
||||
///
|
||||
/// Processes MS-CHAP2-Success AVP
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 5. Success Packet)](https://tools.ietf.org/html/rfc2759#section-5)
|
||||
///
|
||||
/// \param[in] pck Packet data
|
||||
/// \param[in] size_pck \p pck size in bytes
|
||||
///
|
||||
void process_success(_In_ int argc, _In_count_(argc) const wchar_t *argv[]);
|
||||
|
||||
///
|
||||
/// Processes MS-CHAP-Error AVP
|
||||
///
|
||||
/// \sa [Microsoft PPP CHAP Extensions, Version 2 (Chapter 6. Failure Packet)](https://tools.ietf.org/html/rfc2759#section-6)
|
||||
///
|
||||
/// \param[in] pck Packet data
|
||||
/// \param[in] size_pck \p pck size in bytes
|
||||
///
|
||||
void process_error(_In_ int argc, _In_count_(argc) const wchar_t *argv[]);
|
||||
|
||||
protected:
|
||||
credentials_mschapv2 &m_cred; ///< EAP-TLS user credentials
|
||||
winstd::crypt_prov m_cp; ///< Cryptography provider for general services
|
||||
|
||||
challenge_mschapv2 m_challenge_server; ///< MSCHAP server challenge
|
||||
challenge_mschapv2 m_challenge_client; ///< MSCHAP client challenge
|
||||
unsigned char m_ident; ///< Ident
|
||||
nt_response m_nt_resp; ///< NT-Response
|
||||
bool m_success; ///< Did we receive MS-CHAP2-Success?
|
||||
|
||||
enum {
|
||||
phase_unknown = -1, ///< Unknown phase
|
||||
phase_init = 0, ///< Send client challenge
|
||||
phase_challenge_server, ///< Verify server challenge
|
||||
phase_finished, ///< Connection shut down
|
||||
} m_phase, m_phase_prev; ///< What phase is our communication at?
|
||||
};
|
||||
}
|
88
lib/MSCHAPv2/src/Config.cpp
Normal file
88
lib/MSCHAPv2/src/Config.cpp
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::config_method_mschapv2
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::config_method_mschapv2::config_method_mschapv2(_In_ module &mod) : config_method_with_cred(mod)
|
||||
{
|
||||
m_preshared.reset(new credentials_mschapv2(mod));
|
||||
}
|
||||
|
||||
|
||||
eap::config_method_mschapv2::config_method_mschapv2(_In_ const config_method_mschapv2 &other) :
|
||||
config_method_with_cred(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_method_mschapv2::config_method_mschapv2(_Inout_ config_method_mschapv2 &&other) :
|
||||
config_method_with_cred(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_method_mschapv2& eap::config_method_mschapv2::operator=(_In_ const config_method_mschapv2 &other)
|
||||
{
|
||||
if (this != &other)
|
||||
(config_method_with_cred&)*this = other;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::config_method_mschapv2& eap::config_method_mschapv2::operator=(_Inout_ config_method_mschapv2 &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
(config_method_with_cred&&)*this = std::move(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::config_method_mschapv2::clone() const
|
||||
{
|
||||
return new config_method_mschapv2(*this);
|
||||
}
|
||||
|
||||
|
||||
eap_type_t eap::config_method_mschapv2::get_method_id() const
|
||||
{
|
||||
return eap_type_legacy_mschapv2;
|
||||
}
|
||||
|
||||
|
||||
const wchar_t* eap::config_method_mschapv2::get_method_str() const
|
||||
{
|
||||
return L"MSCHAPv2";
|
||||
}
|
||||
|
||||
|
||||
eap::credentials* eap::config_method_mschapv2::make_credentials() const
|
||||
{
|
||||
return new credentials_mschapv2(m_module);
|
||||
}
|
112
lib/MSCHAPv2/src/Credentials.cpp
Normal file
112
lib/MSCHAPv2/src/Credentials.cpp
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::credentials_mschapv2
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_In_ module &mod) : credentials_pass(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_In_ const credentials_mschapv2 &other) :
|
||||
credentials_pass(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_Inout_ credentials_mschapv2 &&other) :
|
||||
credentials_pass(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2& eap::credentials_mschapv2::operator=(_In_ const credentials_mschapv2 &other)
|
||||
{
|
||||
if (this != &other)
|
||||
(credentials_pass&)*this = other;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2& eap::credentials_mschapv2::operator=(_Inout_ credentials_mschapv2 &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
(credentials_pass&&)*this = std::move(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::credentials_mschapv2::clone() const
|
||||
{
|
||||
return new credentials_mschapv2(*this);
|
||||
}
|
||||
|
||||
|
||||
LPCTSTR eap::credentials_mschapv2::target_suffix() const
|
||||
{
|
||||
return _T("MSCHAPv2");
|
||||
}
|
||||
|
||||
|
||||
eap::credentials::source_t eap::credentials_mschapv2::combine(
|
||||
_In_ const credentials *cred_cached,
|
||||
_In_ const config_method_with_cred &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName)
|
||||
{
|
||||
if (cred_cached) {
|
||||
// Using EAP service cached credentials.
|
||||
*this = *(credentials_mschapv2*)cred_cached;
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED1, event_data((unsigned int)eap_type_legacy_mschapv2), event_data(credentials_mschapv2::get_name()), event_data::blank);
|
||||
return source_cache;
|
||||
}
|
||||
|
||||
if (cfg.m_use_preshared) {
|
||||
// Using preshared credentials.
|
||||
*this = *(credentials_mschapv2*)cfg.m_preshared.get();
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_PRESHARED1, event_data((unsigned int)eap_type_legacy_mschapv2), event_data(credentials_mschapv2::get_name()), event_data::blank);
|
||||
return source_preshared;
|
||||
}
|
||||
|
||||
if (pszTargetName) {
|
||||
try {
|
||||
credentials_mschapv2 cred_loaded(m_module);
|
||||
cred_loaded.retrieve(pszTargetName);
|
||||
|
||||
// Using stored credentials.
|
||||
*this = std::move(cred_loaded);
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED1, event_data((unsigned int)eap_type_legacy_mschapv2), event_data(credentials_mschapv2::get_name()), event_data::blank);
|
||||
return source_storage;
|
||||
} catch (...) {
|
||||
// Not actually an error.
|
||||
}
|
||||
}
|
||||
|
||||
return source_unknown;
|
||||
}
|
336
lib/MSCHAPv2/src/MSCHAPv2.cpp
Normal file
336
lib/MSCHAPv2/src/MSCHAPv2.cpp
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::create_des_key
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
crypt_key eap::create_des_key(_In_ HCRYPTPROV cp, _In_count_(size) const unsigned char *key, _In_ size_t size)
|
||||
{
|
||||
// Prepare exported key BLOB.
|
||||
struct key_blob_prefix {
|
||||
PUBLICKEYSTRUC header;
|
||||
DWORD size;
|
||||
} static const s_prefix = {
|
||||
{
|
||||
PLAINTEXTKEYBLOB,
|
||||
CUR_BLOB_VERSION,
|
||||
0,
|
||||
CALG_DES,
|
||||
},
|
||||
8,
|
||||
};
|
||||
sanitizing_blob key_blob;
|
||||
key_blob.reserve(sizeof(key_blob_prefix) + 8);
|
||||
key_blob.assign((const unsigned char*)&s_prefix, (const unsigned char*)(&s_prefix + 1));
|
||||
|
||||
// Inject parity bits.
|
||||
unsigned char out = 0, parity = 1;
|
||||
size_t i = 0, j = 7, bits = std::min<size_t>(size * 8, 56);
|
||||
for (; i < bits; i++) {
|
||||
unsigned char bit = (key[i/8] & (1 << (7 - i%8))) ? 1 : 0;
|
||||
parity ^= bit;
|
||||
out |= bit << j;
|
||||
if (--j == 0) {
|
||||
out |= parity;
|
||||
key_blob.push_back(out);
|
||||
out = 0; parity = 1; j = 7;
|
||||
}
|
||||
}
|
||||
for (; i < 56; i++) {
|
||||
if (--j == 0) {
|
||||
out |= parity;
|
||||
key_blob.push_back(out);
|
||||
out = 0; parity = 1; j = 7;
|
||||
}
|
||||
}
|
||||
|
||||
// Import key.
|
||||
crypt_key k;
|
||||
if (!k.import(cp, key_blob.data(), (DWORD)key_blob.size(), NULL, 0))
|
||||
throw winstd::win_runtime_error(__FUNCTION__ " Error importing key 1/3.");
|
||||
return k;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::challenge_mschapv2
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void eap::challenge_mschapv2::randomize(_In_ HCRYPTPROV cp)
|
||||
{
|
||||
if (!CryptGenRandom(cp, sizeof(data), data))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating randomness.");
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::challenge_hash
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::challenge_hash::challenge_hash()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::challenge_hash::challenge_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username)
|
||||
{
|
||||
const char *domain = strchr(username, '@');
|
||||
size_t len_username = domain ? domain - username : strlen(username);
|
||||
|
||||
crypt_hash hash;
|
||||
if (!hash.create(cp, CALG_SHA))
|
||||
throw win_runtime_error(__FUNCTION__ " Creating SHA hash failed.");
|
||||
if (!CryptHashData(hash, (const BYTE*)&challenge_client, (DWORD)sizeof(challenge_client), 0) ||
|
||||
!CryptHashData(hash, (const BYTE*)&challenge_server, (DWORD)sizeof(challenge_server), 0) ||
|
||||
!CryptHashData(hash, (const BYTE*)username , (DWORD)len_username , 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
unsigned char hash_val[20];
|
||||
DWORD size_hash_val = sizeof(hash_val);
|
||||
if (!CryptGetHashParam(hash, HP_HASHVAL, hash_val, &size_hash_val, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
memcpy(data, hash_val, sizeof(data));
|
||||
SecureZeroMemory(hash_val, size_hash_val);
|
||||
}
|
||||
|
||||
|
||||
eap::challenge_hash::challenge_hash(_In_ const sanitizing_blob_f<8> &other) :
|
||||
sanitizing_blob_xf<8>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
eap::challenge_hash::challenge_hash(_Inout_ sanitizing_blob_zf<8> &&other) :
|
||||
sanitizing_blob_xf<8>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::nt_password_hash
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::nt_password_hash::nt_password_hash()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::nt_password_hash::nt_password_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_z_ const wchar_t *password)
|
||||
{
|
||||
crypt_hash hash;
|
||||
if (!hash.create(cp, CALG_MD4))
|
||||
throw win_runtime_error(__FUNCTION__ " Creating MD4 hash failed.");
|
||||
if (!CryptHashData(hash, (const BYTE*)password, (DWORD)(wcslen(password) * sizeof(wchar_t)), 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
DWORD size_data = sizeof(data);
|
||||
if (!CryptGetHashParam(hash, HP_HASHVAL, data, &size_data, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
}
|
||||
|
||||
|
||||
eap::nt_password_hash::nt_password_hash(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const nt_password_hash &pwd_hash)
|
||||
{
|
||||
crypt_hash hash;
|
||||
if (!hash.create(cp, CALG_MD4))
|
||||
throw win_runtime_error(__FUNCTION__ " Creating MD4 hash failed.");
|
||||
if (!CryptHashData(hash, (const BYTE*)&pwd_hash, (DWORD)sizeof(pwd_hash), 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
DWORD size_data = sizeof(data);
|
||||
if (!CryptGetHashParam(hash, HP_HASHVAL, data, &size_data, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
}
|
||||
|
||||
|
||||
eap::nt_password_hash::nt_password_hash(_In_ const sanitizing_blob_f<16> &other) :
|
||||
sanitizing_blob_xf<16>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
eap::nt_password_hash::nt_password_hash(_Inout_ sanitizing_blob_zf<16> &&other) :
|
||||
sanitizing_blob_xf<16>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::nt_response
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::nt_response::nt_response()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::nt_response::nt_response(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username,
|
||||
_In_z_ const wchar_t *password)
|
||||
{
|
||||
challenge_hash challenge(cp, challenge_server, challenge_client, username);
|
||||
nt_password_hash hash_pwd(cp, password);
|
||||
|
||||
// Prepare exported key BLOB.
|
||||
crypt_key key;
|
||||
DWORD size_data_enc;
|
||||
static const DWORD mode_ecb = CRYPT_MODE_ECB;
|
||||
|
||||
// DesEncrypt(Challenge, 1st 7-octets of ZPasswordHash, giving 1st 8-octets of Response)
|
||||
key = create_des_key(cp, (const unsigned char*)&hash_pwd, 7);
|
||||
if (!CryptSetKeyParam(key, KP_MODE, (const BYTE*)&mode_ecb, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error setting ECB mode.");
|
||||
memcpy(data, &challenge, 8);
|
||||
size_data_enc = 8;
|
||||
if (!CryptEncrypt(key, NULL, FALSE, 0, data, &size_data_enc, 8))
|
||||
throw win_runtime_error(__FUNCTION__ " Error encrypting message 1/3.");
|
||||
|
||||
// DesEncrypt(Challenge, 2nd 7-octets of ZPasswordHash, giving 2nd 8-octets of Response)
|
||||
key = create_des_key(cp, (const unsigned char*)&hash_pwd + 7, 7);
|
||||
if (!CryptSetKeyParam(key, KP_MODE, (const BYTE*)&mode_ecb, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error setting ECB mode.");
|
||||
memcpy(data + 8, &challenge, 8);
|
||||
size_data_enc = 8;
|
||||
if (!CryptEncrypt(key, NULL, FALSE, 0, data + 8, &size_data_enc, 8))
|
||||
throw win_runtime_error(__FUNCTION__ " Error encrypting message 2/3.");
|
||||
|
||||
// DesEncrypt(Challenge, 2nd 7-octets of ZPasswordHash, giving 2nd 8-octets of Response)
|
||||
key = create_des_key(cp, (const unsigned char*)&hash_pwd + 14, 2);
|
||||
if (!CryptSetKeyParam(key, KP_MODE, (const BYTE*)&mode_ecb, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error setting ECB mode.");
|
||||
memcpy(data + 16, &challenge, 8);
|
||||
size_data_enc = 8;
|
||||
if (!CryptEncrypt(key, NULL, FALSE, 0, data + 16, &size_data_enc, 8))
|
||||
throw win_runtime_error(__FUNCTION__ " Error encrypting message 3/3.");
|
||||
}
|
||||
|
||||
|
||||
eap::nt_response::nt_response(_In_ const sanitizing_blob_f<24> &other) :
|
||||
sanitizing_blob_xf<24>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
eap::nt_response::nt_response(_Inout_ sanitizing_blob_zf<24> &&other) :
|
||||
sanitizing_blob_xf<24>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::authenticator_response
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::authenticator_response::authenticator_response()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::authenticator_response::authenticator_response(
|
||||
_In_ HCRYPTPROV cp,
|
||||
_In_ const challenge_mschapv2 &challenge_server,
|
||||
_In_ const challenge_mschapv2 &challenge_client,
|
||||
_In_z_ const char *username,
|
||||
_In_z_ const wchar_t *password,
|
||||
_In_ const nt_response &nt_resp)
|
||||
{
|
||||
static const unsigned char s_magic1[39] = {
|
||||
0x4d, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6c, 0x69, 0x65,
|
||||
0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
|
||||
0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74
|
||||
};
|
||||
nt_password_hash hash_hash_pwd(cp, nt_password_hash(cp, password));
|
||||
|
||||
crypt_hash hash;
|
||||
if (!hash.create(cp, CALG_SHA))
|
||||
throw win_runtime_error(__FUNCTION__ " Creating SHA hash failed.");
|
||||
if (!CryptHashData(hash, (const BYTE*)&hash_hash_pwd, (DWORD)sizeof(hash_hash_pwd), 0) ||
|
||||
!CryptHashData(hash, (const BYTE*)&nt_resp , (DWORD)sizeof(nt_resp ), 0) ||
|
||||
!CryptHashData(hash, s_magic1 , (DWORD)sizeof(s_magic1 ), 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
unsigned char hash_val[20];
|
||||
DWORD size_hash_val = sizeof(hash_val);
|
||||
if (!CryptGetHashParam(hash, HP_HASHVAL, hash_val, &size_hash_val, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
|
||||
static const unsigned char s_magic2[41] = {
|
||||
0x50, 0x61, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b,
|
||||
0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x20, 0x6d, 0x6f,
|
||||
0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x6f, 0x6e,
|
||||
0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e
|
||||
};
|
||||
challenge_hash challenge(cp, challenge_server, challenge_client, username);
|
||||
|
||||
if (!hash.create(cp, CALG_SHA))
|
||||
throw win_runtime_error(__FUNCTION__ " Creating SHA hash failed.");
|
||||
if (!CryptHashData(hash, hash_val , size_hash_val , 0) ||
|
||||
!CryptHashData(hash, (const BYTE*)&challenge, (DWORD)sizeof(challenge), 0) ||
|
||||
!CryptHashData(hash, s_magic2 , (DWORD)sizeof(s_magic2 ), 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
size_hash_val = sizeof(data);
|
||||
if (!CryptGetHashParam(hash, HP_HASHVAL, data, &size_hash_val, 0))
|
||||
throw win_runtime_error(__FUNCTION__ " Error hashing data.");
|
||||
}
|
||||
|
||||
|
||||
eap::authenticator_response::authenticator_response(_In_ const sanitizing_blob_f<20> &other) :
|
||||
sanitizing_blob_xf<20>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
eap::authenticator_response::authenticator_response(_Inout_ sanitizing_blob_zf<20> &&other) :
|
||||
sanitizing_blob_xf<20>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
279
lib/MSCHAPv2/src/Method.cpp
Normal file
279
lib/MSCHAPv2/src/Method.cpp
Normal file
@@ -0,0 +1,279 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::method_mschapv2
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method_mschapv2::method_mschapv2(_In_ module &module, _In_ config_method_mschapv2 &cfg, _In_ credentials_mschapv2 &cred) :
|
||||
m_cred(cred),
|
||||
m_ident(0),
|
||||
m_success(false),
|
||||
m_phase(phase_unknown),
|
||||
m_phase_prev(phase_unknown),
|
||||
method_noneap(module, cfg, cred)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_mschapv2::method_mschapv2(_Inout_ method_mschapv2 &&other) :
|
||||
m_cred ( other.m_cred ),
|
||||
m_cp (std::move(other.m_cp )),
|
||||
m_challenge_server(std::move(other.m_challenge_server)),
|
||||
m_challenge_client(std::move(other.m_challenge_client)),
|
||||
m_ident (std::move(other.m_ident )),
|
||||
m_nt_resp (std::move(other.m_nt_resp )),
|
||||
m_success (std::move(other.m_success )),
|
||||
m_phase (std::move(other.m_phase )),
|
||||
m_phase_prev (std::move(other.m_phase_prev )),
|
||||
method_noneap (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_mschapv2& eap::method_mschapv2::operator=(_Inout_ method_mschapv2 &&other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move method with same credentials only!
|
||||
(method_noneap&)*this = std::move(other );
|
||||
m_cp = std::move(other.m_cp );
|
||||
m_challenge_server = std::move(other.m_challenge_server);
|
||||
m_challenge_client = std::move(other.m_challenge_client);
|
||||
m_ident = std::move(other.m_ident );
|
||||
m_nt_resp = std::move(other.m_nt_resp );
|
||||
m_success = std::move(other.m_success );
|
||||
m_phase = std::move(other.m_phase );
|
||||
m_phase_prev = std::move(other.m_phase_prev );
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_opt_ DWORD dwMaxSendPacketSize)
|
||||
{
|
||||
method_noneap::begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
|
||||
|
||||
// Create cryptographics provider for support needs (client challenge ...).
|
||||
if (!m_cp.create(NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT))
|
||||
throw win_runtime_error(__FUNCTION__ " Error creating cryptographics provider.");
|
||||
|
||||
m_module.log_event(&EAPMETHOD_METHOD_HANDSHAKE_START2, event_data((unsigned int)eap_type_legacy_mschapv2), event_data::blank);
|
||||
m_phase = phase_init;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::process_request_packet(
|
||||
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
|
||||
_In_ DWORD dwReceivedPacketSize,
|
||||
_Inout_ EapPeerMethodOutput *pEapOutput)
|
||||
{
|
||||
assert(pReceivedPacket || dwReceivedPacketSize == 0);
|
||||
assert(pEapOutput);
|
||||
|
||||
m_module.log_event(&EAPMETHOD_PACKET_RECV, event_data((unsigned int)eap_type_legacy_mschapv2), event_data((unsigned int)dwReceivedPacketSize), event_data::blank);
|
||||
|
||||
process_packet(pReceivedPacket, dwReceivedPacketSize);
|
||||
|
||||
m_phase_prev = m_phase;
|
||||
switch (m_phase) {
|
||||
case phase_init: {
|
||||
// Convert username to UTF-8.
|
||||
sanitizing_string identity_utf8;
|
||||
WideCharToMultiByte(CP_UTF8, 0, m_cred.m_identity.c_str(), (int)m_cred.m_identity.length(), identity_utf8, NULL, NULL);
|
||||
|
||||
// Calculate Peer-Challenge and Response
|
||||
m_challenge_client.randomize(m_cp);
|
||||
m_nt_resp = nt_response(m_cp, m_challenge_server, m_challenge_client, identity_utf8.c_str(), m_cred.m_password.c_str());
|
||||
|
||||
// Prepare MS-CHAP2-Response
|
||||
sanitizing_blob response;
|
||||
response.reserve(
|
||||
1 + // Ident
|
||||
1 + // Flags
|
||||
sizeof(challenge_mschapv2) + // Peer-Challenge
|
||||
8 + // Reserved
|
||||
sizeof(nt_response)); // Response
|
||||
response.push_back(m_ident);
|
||||
response.push_back(0); // Flags
|
||||
response.insert(response.end(), (unsigned char*)&m_challenge_client, (unsigned char*)(&m_challenge_client + 1)); // Peer-Challenge
|
||||
response.insert(response.end(), 8, 0); // Reserved
|
||||
response.insert(response.end(), (unsigned char*)&m_nt_resp, (unsigned char*)(&m_nt_resp + 1)); // NT-Response
|
||||
|
||||
// Diameter AVP (User-Name=1, MS-CHAP-Challenge=11/311, MS-CHAP2-Response=25/311)
|
||||
append_avp( 1, diameter_avp_flag_mandatory, identity_utf8.data(), (unsigned int )identity_utf8.size() );
|
||||
append_avp(11, 311, diameter_avp_flag_mandatory, (unsigned char*)&m_challenge_server , (unsigned char)sizeof(m_challenge_server));
|
||||
append_avp(25, 311, diameter_avp_flag_mandatory, response.data() , (unsigned char)response.size() );
|
||||
|
||||
m_phase = phase_challenge_server;
|
||||
break;
|
||||
}
|
||||
|
||||
case phase_challenge_server: {
|
||||
// We do not need to do anything.
|
||||
break;
|
||||
}
|
||||
|
||||
case phase_finished:
|
||||
break;
|
||||
}
|
||||
|
||||
pEapOutput->fAllowNotifications = TRUE;
|
||||
pEapOutput->action = EapPeerMethodResponseActionSend;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::get_result(
|
||||
_In_ EapPeerMethodResultReason reason,
|
||||
_Inout_ EapPeerMethodResult *ppResult)
|
||||
{
|
||||
assert(ppResult);
|
||||
|
||||
switch (reason) {
|
||||
case EapPeerMethodResultSuccess: {
|
||||
m_module.log_event(&EAPMETHOD_METHOD_SUCCESS, event_data((unsigned int)eap_type_legacy_mschapv2), event_data::blank);
|
||||
m_cfg.m_auth_failed = false;
|
||||
|
||||
ppResult->fIsSuccess = TRUE;
|
||||
ppResult->dwFailureReasonCode = ERROR_SUCCESS;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case EapPeerMethodResultFailure:
|
||||
m_module.log_event(
|
||||
m_phase_prev < phase_finished ? &EAPMETHOD_METHOD_FAILURE_INIT : &EAPMETHOD_METHOD_FAILURE,
|
||||
event_data((unsigned int)eap_type_legacy_mschapv2), event_data::blank);
|
||||
|
||||
// Mark credentials as failed, so GUI can re-prompt user.
|
||||
// But be careful: do so only after credentials were actually tried.
|
||||
m_cfg.m_auth_failed = m_phase_prev < phase_finished && m_phase >= phase_finished;
|
||||
|
||||
// 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;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Not supported.");
|
||||
}
|
||||
|
||||
// Always ask EAP host to save the connection data.
|
||||
ppResult->fSaveConnectionData = TRUE;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::process_packet(_In_bytecount_(size_pck) const void *_pck, _In_ size_t size_pck)
|
||||
{
|
||||
sanitizing_blob data;
|
||||
wstring msg_w;
|
||||
|
||||
for (const unsigned char *pck = (const unsigned char*)_pck, *pck_end = pck + size_pck; pck < pck_end; ) {
|
||||
if (pck + sizeof(diameter_avp_header) > pck_end)
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Incomplete message header.");
|
||||
const diameter_avp_header *hdr = (const diameter_avp_header*)pck;
|
||||
unsigned int code = ntohl(*(unsigned int*)hdr->code);
|
||||
unsigned int vendor;
|
||||
const unsigned char *msg;
|
||||
if (hdr->flags & diameter_avp_flag_vendor) {
|
||||
if (pck + sizeof(diameter_avp_header_ven) > pck_end)
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Incomplete message header.");
|
||||
const diameter_avp_header_ven *hdr_ven = (const diameter_avp_header_ven*)pck;
|
||||
vendor = ntohl(*(unsigned int*)hdr_ven->vendor);
|
||||
msg = (const unsigned char*)(hdr_ven + 1);
|
||||
} else {
|
||||
vendor = 0;
|
||||
msg = (const unsigned char*)(hdr + 1);
|
||||
}
|
||||
const unsigned char *msg_end = pck + ntohs(*(unsigned short*)hdr->length);
|
||||
if (msg_end > pck_end)
|
||||
throw win_runtime_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, __FUNCTION__ " Incomplete message data.");
|
||||
|
||||
if (code == 26 && vendor == 311) {
|
||||
// MS-CHAP2-Success
|
||||
MultiByteToWideChar(CP_UTF8, 0, (const char*)msg, (int)(msg_end - msg), msg_w);
|
||||
int argc;
|
||||
unique_ptr<LPWSTR[], LocalFree_delete<LPWSTR[]> > argv(CommandLineToArgvW(msg_w.c_str(), &argc));
|
||||
if (!argv) argc = 0;
|
||||
process_success(argc, (const wchar_t**)argv.get());
|
||||
} else if (code == 2 && vendor == 311) {
|
||||
// MS-CHAP2-Error
|
||||
MultiByteToWideChar(CP_UTF8, 0, (const char*)msg, (int)(msg_end - msg), msg_w);
|
||||
int argc;
|
||||
unique_ptr<LPWSTR[], LocalFree_delete<LPWSTR[]> > argv(CommandLineToArgvW(msg_w.c_str(), &argc));
|
||||
if (!argv) argc = 0;
|
||||
process_error(argc, (const wchar_t**)argv.get());
|
||||
} else if (hdr->flags & diameter_avp_flag_mandatory)
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, string_printf(__FUNCTION__ " Server sent mandatory Diameter AVP we do not support (code: %u, vendor: %u).", code, vendor).c_str());
|
||||
|
||||
pck = msg_end;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::process_success(_In_ int argc, _In_count_(argc) const wchar_t *argv[])
|
||||
{
|
||||
m_success = false;
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if ((argv[i][0] == L'S' || argv[i][0] == L's') && argv[i][1] == L'=') {
|
||||
// "S="
|
||||
hex_dec dec;
|
||||
sanitizing_blob resp;
|
||||
bool is_last;
|
||||
dec.decode(resp, is_last, argv[i] + 2, (size_t)-1);
|
||||
|
||||
// Calculate expected authenticator response.
|
||||
sanitizing_string identity_utf8;
|
||||
WideCharToMultiByte(CP_UTF8, 0, m_cred.m_identity.c_str(), (int)m_cred.m_identity.length(), identity_utf8, NULL, NULL);
|
||||
authenticator_response resp_exp(m_cp, m_challenge_server, m_challenge_client, identity_utf8.c_str(), m_cred.m_password.c_str(), m_nt_resp);
|
||||
|
||||
// Compare against provided authemticator response.
|
||||
if (resp.size() != sizeof(resp_exp) || memcpy(resp.data(), &resp_exp, sizeof(resp_exp)) != 0)
|
||||
throw invalid_argument(__FUNCTION__ " MS-CHAP2-Success authentication response string failed.");
|
||||
|
||||
m_success = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_success)
|
||||
throw invalid_argument(__FUNCTION__ " MS-CHAP2-Success authentication response string not found.");
|
||||
|
||||
//m_module.log_event(&EAPMETHOD_TLS_ALERT, event_data((unsigned int)eap_type_tls), event_data((unsigned char)msg[0]), event_data((unsigned char)msg[1]), event_data::blank);
|
||||
}
|
||||
|
||||
|
||||
void eap::method_mschapv2::process_error(_In_ int argc, _In_count_(argc) const wchar_t *argv[])
|
||||
{
|
||||
UNREFERENCED_PARAMETER(argc);
|
||||
UNREFERENCED_PARAMETER(argv);
|
||||
}
|
60
lib/MSCHAPv2/src/PAP.cpp
Normal file
60
lib/MSCHAPv2/src/PAP.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::credentials_mschapv2
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_In_ module &mod) : credentials_pass(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_In_ const credentials_mschapv2 &other) :
|
||||
credentials_pass(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2::credentials_mschapv2(_Inout_ credentials_mschapv2 &&other) :
|
||||
credentials_pass(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2& eap::credentials_mschapv2::operator=(_In_ const credentials_mschapv2 &other)
|
||||
{
|
||||
if (this != &other)
|
||||
(credentials_pass&)*this = other;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_mschapv2& eap::credentials_mschapv2::operator=(_Inout_ credentials_mschapv2 &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
(credentials_pass&&)*this = std::move(other);
|
||||
|
||||
return *this;
|
||||
}
|
21
lib/MSCHAPv2/src/StdAfx.cpp
Normal file
21
lib/MSCHAPv2/src/StdAfx.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
31
lib/MSCHAPv2/src/StdAfx.h
Normal file
31
lib/MSCHAPv2/src/StdAfx.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../include/Config.h"
|
||||
#include "../include/Credentials.h"
|
||||
#include "../include/Method.h"
|
||||
#include "../include/MSCHAPv2.h"
|
||||
|
||||
#include <WinStd/Hex.h>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <EapHostError.h> // include after Windows.h
|
2
lib/MSCHAPv2_UI/build/.gitignore
vendored
Normal file
2
lib/MSCHAPv2_UI/build/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/temp
|
||||
/*.user
|
12
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.props
Normal file
12
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.props
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\..\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
102
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.vcxproj
Normal file
102
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.vcxproj
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7AF5B922-7C17-428A-97E0-09E3B41A684D}</ProjectGuid>
|
||||
<RootNamespace>MSCHAPv2_UI</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\Win32.props" />
|
||||
<Import Project="..\..\..\include\Debug.props" />
|
||||
<Import Project="MSCHAPv2_UI.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\x64.props" />
|
||||
<Import Project="..\..\..\include\Debug.props" />
|
||||
<Import Project="MSCHAPv2_UI.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\Win32.props" />
|
||||
<Import Project="..\..\..\include\Release.props" />
|
||||
<Import Project="MSCHAPv2_UI.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\include\x64.props" />
|
||||
<Import Project="..\..\..\include\Release.props" />
|
||||
<Import Project="MSCHAPv2_UI.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\MSCHAPv2_UI.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\MSCHAPv2_UI.cpp" />
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Events\build\Events.vcxproj">
|
||||
<Project>{d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
33
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.vcxproj.filters
Normal file
33
lib/MSCHAPv2_UI/build/MSCHAPv2_UI.vcxproj.filters
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\MSCHAPv2_UI.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\MSCHAPv2_UI.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
68
lib/MSCHAPv2_UI/include/MSCHAPv2_UI.h
Normal file
68
lib/MSCHAPv2_UI/include/MSCHAPv2_UI.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../EAPBase_UI/include/EAP_UI.h"
|
||||
#include "../../MSCHAPv2/include/Config.h"
|
||||
#include "../../MSCHAPv2/include/Credentials.h"
|
||||
|
||||
///
|
||||
/// MSCHAPv2 credential configuration panel
|
||||
///
|
||||
typedef wxEAPCredentialsConfigPanel<eap::credentials_mschapv2, wxPasswordCredentialsPanel<eap::credentials_mschapv2, wxEAPCredentialsPassPanelBase> > wxMSCHAPv2CredentialsConfigPanel;
|
||||
|
||||
///
|
||||
/// MSCHAPv2 configuration panel
|
||||
///
|
||||
class wxMSCHAPv2ConfigPanel;
|
||||
|
||||
///
|
||||
/// MSCHAPv2 credential entry panel
|
||||
///
|
||||
typedef wxPasswordCredentialsPanel<eap::credentials_mschapv2, wxEAPCredentialsPassPanelBase> wxMSCHAPv2CredentialsPanel;
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/panel.h>
|
||||
#include <wx/stattext.h>
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
class wxMSCHAPv2ConfigPanel : public wxPanel
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a configuration panel
|
||||
///
|
||||
wxMSCHAPv2ConfigPanel(const eap::config_provider &prov, eap::config_method_mschapv2 &cfg, wxWindow* parent);
|
||||
|
||||
///
|
||||
/// Destructs the configuration panel
|
||||
///
|
||||
virtual ~wxMSCHAPv2ConfigPanel();
|
||||
|
||||
protected:
|
||||
/// \cond internal
|
||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
||||
/// \endcond
|
||||
|
||||
protected:
|
||||
wxMSCHAPv2CredentialsConfigPanel *m_credentials; ///< Credentials configuration panel
|
||||
};
|
56
lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp
Normal file
56
lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// wxMSCHAPv2ConfigPanel
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxMSCHAPv2ConfigPanel::wxMSCHAPv2ConfigPanel(const eap::config_provider &prov, eap::config_method_mschapv2 &cfg, wxWindow* parent) : wxPanel(parent)
|
||||
{
|
||||
wxBoxSizer* sb_content;
|
||||
sb_content = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_credentials = new wxMSCHAPv2CredentialsConfigPanel(prov, cfg, this);
|
||||
sb_content->Add(m_credentials, 0, wxEXPAND, 5);
|
||||
|
||||
this->SetSizer(sb_content);
|
||||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxMSCHAPv2ConfigPanel::OnInitDialog));
|
||||
}
|
||||
|
||||
|
||||
wxMSCHAPv2ConfigPanel::~wxMSCHAPv2ConfigPanel()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxMSCHAPv2ConfigPanel::OnInitDialog));
|
||||
}
|
||||
|
||||
|
||||
void wxMSCHAPv2ConfigPanel::OnInitDialog(wxInitDialogEvent& event)
|
||||
{
|
||||
// Forward the event to child panels.
|
||||
if (m_credentials)
|
||||
m_credentials->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
21
lib/MSCHAPv2_UI/src/StdAfx.cpp
Normal file
21
lib/MSCHAPv2_UI/src/StdAfx.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
25
lib/MSCHAPv2_UI/src/StdAfx.h
Normal file
25
lib/MSCHAPv2_UI/src/StdAfx.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 GÉANT
|
||||
|
||||
This file is part of GÉANTLink.
|
||||
|
||||
GÉANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GÉANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS // Prevent warnings from wxWidgets headers
|
||||
|
||||
#include "../include/MSCHAPv2_UI.h"
|
@@ -81,11 +81,13 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\Config.h" />
|
||||
<ClInclude Include="..\include\Credentials.h" />
|
||||
<ClInclude Include="..\include\Method.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\Config.cpp" />
|
||||
<ClCompile Include="..\src\Credentials.cpp" />
|
||||
<ClCompile Include="..\src\Method.cpp" />
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
|
@@ -20,6 +20,9 @@
|
||||
<ClInclude Include="..\include\Credentials.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\Method.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
@@ -31,5 +34,8 @@
|
||||
<ClCompile Include="..\src\Credentials.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\Method.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -95,5 +95,15 @@ namespace eap
|
||||
/// \returns `eap::type_pap`
|
||||
///
|
||||
virtual winstd::eap_type_t get_method_id() const;
|
||||
|
||||
///
|
||||
/// Returns a string \c L"PAP"
|
||||
///
|
||||
virtual const wchar_t* get_method_str() const;
|
||||
|
||||
///
|
||||
/// Creates a blank set of credentials suitable for this method
|
||||
///
|
||||
virtual credentials* make_credentials() const;
|
||||
};
|
||||
}
|
||||
|
@@ -105,17 +105,18 @@ namespace eap
|
||||
/// 2. Pre-configured credentials
|
||||
/// 3. Stored credentials
|
||||
///
|
||||
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL)
|
||||
/// \param[in] cfg Method configuration
|
||||
/// \param[in] cred_cached Cached credentials (optional, can be \c NULL, must be credentials_pap* type)
|
||||
/// \param[in] cfg Method configuration (must be config_method_pap type)
|
||||
/// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL)
|
||||
///
|
||||
/// \returns
|
||||
/// - \c true if credentials were set;
|
||||
/// - \c false otherwise
|
||||
/// - \c source_cache Credentials were obtained from EapHost cache
|
||||
/// - \c source_preshared Credentials were set by method configuration
|
||||
/// - \c source_storage Credentials were loaded from Windows Credential Manager
|
||||
///
|
||||
source_t combine(
|
||||
_In_ const credentials_pap *cred_cached,
|
||||
_In_ const config_method_pap &cfg,
|
||||
virtual source_t combine(
|
||||
_In_ const credentials *cred_cached,
|
||||
_In_ const config_method_with_cred &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName);
|
||||
};
|
||||
}
|
||||
|
112
lib/PAP/include/Method.h
Normal file
112
lib/PAP/include/Method.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// PAP method
|
||||
///
|
||||
class method_pap;
|
||||
}
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Config.h"
|
||||
#include "Credentials.h"
|
||||
|
||||
#include "../../EAPBase/include/Method.h"
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class method_pap : public method_noneap
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs an EAP method
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Method configuration
|
||||
/// \param[in] cred User credentials
|
||||
///
|
||||
method_pap(_In_ module &module, _In_ config_method_pap &cfg, _In_ credentials_pap &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
method_pap(_Inout_ method_pap &&other);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
method_pap& operator=(_Inout_ method_pap &&other);
|
||||
|
||||
/// \name Packet processing
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// 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)
|
||||
///
|
||||
virtual void begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_opt_ DWORD dwMaxSendPacketSize = MAXDWORD);
|
||||
|
||||
///
|
||||
/// Processes a packet received by EapHost from a supplicant.
|
||||
///
|
||||
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
||||
///
|
||||
virtual void process_request_packet(
|
||||
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
|
||||
_In_ DWORD dwReceivedPacketSize,
|
||||
_Inout_ EapPeerMethodOutput *pEapOutput);
|
||||
|
||||
///
|
||||
/// Obtains the result of an authentication session from the EAP method.
|
||||
///
|
||||
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
|
||||
///
|
||||
virtual void get_result(
|
||||
_In_ EapPeerMethodResultReason reason,
|
||||
_Inout_ EapPeerMethodResult *ppResult);
|
||||
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
credentials_pap &m_cred; ///< EAP-TLS user credentials
|
||||
|
||||
enum {
|
||||
phase_unknown = -1, ///< Unknown phase
|
||||
phase_init = 0, ///< Handshake initialize
|
||||
phase_finished, ///< Connection shut down
|
||||
} m_phase, m_phase_prev; ///< What phase is our communication at?
|
||||
};
|
||||
}
|
@@ -72,5 +72,17 @@ eap::config* eap::config_method_pap::clone() const
|
||||
|
||||
eap_type_t eap::config_method_pap::get_method_id() const
|
||||
{
|
||||
return eap_type_pap;
|
||||
return eap_type_legacy_pap;
|
||||
}
|
||||
|
||||
|
||||
const wchar_t* eap::config_method_pap::get_method_str() const
|
||||
{
|
||||
return L"PAP";
|
||||
}
|
||||
|
||||
|
||||
eap::credentials* eap::config_method_pap::make_credentials() const
|
||||
{
|
||||
return new credentials_pap(m_module);
|
||||
}
|
||||
|
@@ -76,21 +76,21 @@ LPCTSTR eap::credentials_pap::target_suffix() const
|
||||
|
||||
|
||||
eap::credentials::source_t eap::credentials_pap::combine(
|
||||
_In_ const credentials_pap *cred_cached,
|
||||
_In_ const config_method_pap &cfg,
|
||||
_In_ const credentials *cred_cached,
|
||||
_In_ const config_method_with_cred &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName)
|
||||
{
|
||||
if (cred_cached) {
|
||||
// Using EAP service cached credentials.
|
||||
*this = *cred_cached;
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED1, event_data((unsigned int)eap_type_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
*this = *(credentials_pap*)cred_cached;
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED1, event_data((unsigned int)eap_type_legacy_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
return source_cache;
|
||||
}
|
||||
|
||||
if (cfg.m_use_preshared) {
|
||||
// Using preshared credentials.
|
||||
*this = *(credentials_pap*)cfg.m_preshared.get();
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_PRESHARED1, event_data((unsigned int)eap_type_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_PRESHARED1, event_data((unsigned int)eap_type_legacy_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
return source_preshared;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ eap::credentials::source_t eap::credentials_pap::combine(
|
||||
|
||||
// Using stored credentials.
|
||||
*this = std::move(cred_loaded);
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED1, event_data((unsigned int)eap_type_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED1, event_data((unsigned int)eap_type_legacy_pap), event_data(credentials_pap::get_name()), event_data::blank);
|
||||
return source_storage;
|
||||
} catch (...) {
|
||||
// Not actually an error.
|
||||
|
155
lib/PAP/src/Method.cpp
Normal file
155
lib/PAP/src/Method.cpp
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::method_pap
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::method_pap::method_pap(_In_ module &module, _In_ config_method_pap &cfg, _In_ credentials_pap &cred) :
|
||||
m_cred(cred),
|
||||
m_phase(phase_unknown),
|
||||
m_phase_prev(phase_unknown),
|
||||
method_noneap(module, cfg, cred)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_pap::method_pap(_Inout_ method_pap &&other) :
|
||||
m_cred ( other.m_cred ),
|
||||
m_phase (std::move(other.m_phase )),
|
||||
m_phase_prev (std::move(other.m_phase_prev)),
|
||||
method_noneap(std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_pap& eap::method_pap::operator=(_Inout_ method_pap &&other)
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move method with same credentials only!
|
||||
(method_noneap&)*this = std::move(other );
|
||||
m_phase = std::move(other.m_phase );
|
||||
m_phase_prev = std::move(other.m_phase_prev);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_pap::begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
_In_ HANDLE hTokenImpersonateUser,
|
||||
_In_opt_ DWORD dwMaxSendPacketSize)
|
||||
{
|
||||
method_noneap::begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize);
|
||||
|
||||
m_module.log_event(&EAPMETHOD_METHOD_HANDSHAKE_START2, event_data((unsigned int)eap_type_legacy_pap), event_data::blank);
|
||||
m_phase = phase_init;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_pap::process_request_packet(
|
||||
_In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket,
|
||||
_In_ DWORD dwReceivedPacketSize,
|
||||
_Inout_ EapPeerMethodOutput *pEapOutput)
|
||||
{
|
||||
assert(pReceivedPacket || dwReceivedPacketSize == 0);
|
||||
assert(pEapOutput);
|
||||
|
||||
m_module.log_event(&EAPMETHOD_PACKET_RECV, event_data((unsigned int)eap_type_legacy_pap), event_data((unsigned int)dwReceivedPacketSize), event_data::blank);
|
||||
|
||||
m_phase_prev = m_phase;
|
||||
switch (m_phase) {
|
||||
case phase_init: {
|
||||
// Convert username and password to UTF-8.
|
||||
sanitizing_string identity_utf8, password_utf8;
|
||||
WideCharToMultiByte(CP_UTF8, 0, m_cred.m_identity.c_str(), (int)m_cred.m_identity.length(), identity_utf8, NULL, NULL);
|
||||
WideCharToMultiByte(CP_UTF8, 0, m_cred.m_password.c_str(), (int)m_cred.m_password.length(), password_utf8, NULL, NULL);
|
||||
|
||||
// PAP passwords must be padded to 16B boundary according to RFC 5281. Will not add random extra padding here, as length obfuscation should be done by outer transport layers.
|
||||
size_t padding_password_ex = (16 - password_utf8.length()) % 16;
|
||||
password_utf8.append(padding_password_ex, 0);
|
||||
|
||||
m_packet_res.clear();
|
||||
|
||||
// Diameter AVP (User-Name=1, User-Password=2)
|
||||
append_avp(1, diameter_avp_flag_mandatory, identity_utf8.data(), (unsigned int)identity_utf8.size());
|
||||
append_avp(2, diameter_avp_flag_mandatory, password_utf8.data(), (unsigned int)password_utf8.size());
|
||||
|
||||
m_phase = phase_finished;
|
||||
break;
|
||||
}
|
||||
|
||||
case phase_finished:
|
||||
break;
|
||||
}
|
||||
|
||||
pEapOutput->fAllowNotifications = TRUE;
|
||||
pEapOutput->action = EapPeerMethodResponseActionSend;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_pap::get_result(
|
||||
_In_ EapPeerMethodResultReason reason,
|
||||
_Inout_ EapPeerMethodResult *ppResult)
|
||||
{
|
||||
assert(ppResult);
|
||||
|
||||
switch (reason) {
|
||||
case EapPeerMethodResultSuccess: {
|
||||
m_module.log_event(&EAPMETHOD_METHOD_SUCCESS, event_data((unsigned int)eap_type_legacy_pap), event_data::blank);
|
||||
m_cfg.m_auth_failed = false;
|
||||
|
||||
ppResult->fIsSuccess = TRUE;
|
||||
ppResult->dwFailureReasonCode = ERROR_SUCCESS;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case EapPeerMethodResultFailure:
|
||||
m_module.log_event(
|
||||
m_phase_prev < phase_finished ? &EAPMETHOD_METHOD_FAILURE_INIT : &EAPMETHOD_METHOD_FAILURE,
|
||||
event_data((unsigned int)eap_type_legacy_pap), event_data::blank);
|
||||
|
||||
// Mark credentials as failed, so GUI can re-prompt user.
|
||||
// But be careful: do so only after credentials were actually tried.
|
||||
m_cfg.m_auth_failed = m_phase_prev < phase_finished && m_phase >= phase_finished;
|
||||
|
||||
// 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;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw win_runtime_error(ERROR_NOT_SUPPORTED, __FUNCTION__ " Not supported.");
|
||||
}
|
||||
|
||||
// Always ask EAP host to save the connection data.
|
||||
ppResult->fSaveConnectionData = TRUE;
|
||||
}
|
@@ -22,3 +22,7 @@
|
||||
|
||||
#include "../include/Config.h"
|
||||
#include "../include/Credentials.h"
|
||||
#include "../include/Method.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <EapHostError.h> // include after Windows.h
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
///
|
||||
/// Constructs a configuration panel
|
||||
///
|
||||
wxPAPConfigPanel(const eap::config_provider &prov, eap::config_method_pap &cfg, LPCTSTR pszCredTarget, wxWindow* parent);
|
||||
wxPAPConfigPanel(const eap::config_provider &prov, eap::config_method_pap &cfg, wxWindow* parent);
|
||||
|
||||
///
|
||||
/// Destructs the configuration panel
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user