diff --git a/EAPMethods/locale/EAPMethods.pot b/EAPMethods/locale/EAPMethods.pot index 9aaa02d..8006466 100644 --- a/EAPMethods/locale/EAPMethods.pot +++ b/EAPMethods/locale/EAPMethods.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: EAPMethods\n" -"POT-Creation-Date: 2016-09-28 13:27+0200\n" +"POT-Creation-Date: 2016-09-29 14:07+0200\n" "PO-Revision-Date: 2016-06-02 12:27+0200\n" "Last-Translator: Simon Rozman \n" "Language-Team: Amebis, d. o. o., Kamnik \n" @@ -14,11 +14,12 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: _\n" "X-Poedit-SearchPath-0: lib/EAPBase_UI\n" -"X-Poedit-SearchPath-1: lib/MSCHAPv2_UI\n" -"X-Poedit-SearchPath-2: lib/PAP_UI\n" -"X-Poedit-SearchPath-3: lib/TLS_UI\n" -"X-Poedit-SearchPath-4: lib/TTLS_UI\n" -"X-Poedit-SearchPath-5: EAPMethods\n" +"X-Poedit-SearchPath-1: lib/EAPMsg_UI\n" +"X-Poedit-SearchPath-2: lib/MSCHAPv2_UI\n" +"X-Poedit-SearchPath-3: lib/PAP_UI\n" +"X-Poedit-SearchPath-4: lib/TLS_UI\n" +"X-Poedit-SearchPath-5: lib/TTLS_UI\n" +"X-Poedit-SearchPath-6: EAPMethods\n" #: lib/EAPBase_UI/res/wxEAP_UI.cpp:37 msgid "+" @@ -271,6 +272,18 @@ msgstr "" msgid "Please, make sure your credentials are correct, or try again later." msgstr "" +#: lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp:17 +msgid "Inner EAP Method" +msgstr "" + +#: lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp:28 +msgid "Select and configure inner EAP method" +msgstr "" + +#: lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp:40 +msgid "&Settings" +msgstr "" + #: lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp:33 msgid "MSCHAPv2 User ID and Password" msgstr "" diff --git a/VS10Solution.sln b/VS10Solution.sln index 8feb628..608ebe6 100644 --- a/VS10Solution.sln +++ b/VS10Solution.sln @@ -51,6 +51,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2", "lib\MSCHAPv2\bu EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSCHAPv2_UI", "lib\MSCHAPv2_UI\build\MSCHAPv2_UI.vcxproj", "{7AF5B922-7C17-428A-97E0-09E3B41A684D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPMsg", "lib\EAPMsg\build\EAPMsg.vcxproj", "{B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EAPMsg_UI", "lib\EAPMsg_UI\build\EAPMsg_UI.vcxproj", "{13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -211,6 +215,22 @@ Global {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 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|Win32.ActiveCfg = Debug|Win32 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|Win32.Build.0 = Debug|Win32 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x64.ActiveCfg = Debug|x64 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Debug|x64.Build.0 = Debug|x64 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|Win32.ActiveCfg = Release|Win32 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|Win32.Build.0 = Release|Win32 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x64.ActiveCfg = Release|x64 + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754}.Release|x64.Build.0 = Release|x64 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|Win32.ActiveCfg = Debug|Win32 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|Win32.Build.0 = Debug|Win32 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x64.ActiveCfg = Debug|x64 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Debug|x64.Build.0 = Debug|x64 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|Win32.ActiveCfg = Release|Win32 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|Win32.Build.0 = Release|Win32 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x64.ActiveCfg = Release|x64 + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -231,6 +251,8 @@ Global {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} + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393} + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583} = {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} diff --git a/lib/EAPMsg/build/.gitignore b/lib/EAPMsg/build/.gitignore new file mode 100644 index 0000000..9c8716a --- /dev/null +++ b/lib/EAPMsg/build/.gitignore @@ -0,0 +1,2 @@ +/temp +/*.user diff --git a/lib/EAPMsg/build/EAPMsg.props b/lib/EAPMsg/build/EAPMsg.props new file mode 100644 index 0000000..4997b71 --- /dev/null +++ b/lib/EAPMsg/build/EAPMsg.props @@ -0,0 +1,12 @@ + + + + + + + + ..\..\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\..\WinStd\include;%(AdditionalIncludeDirectories) + + + + \ No newline at end of file diff --git a/lib/EAPMsg/build/EAPMsg.vcxproj b/lib/EAPMsg/build/EAPMsg.vcxproj new file mode 100644 index 0000000..2efa6ab --- /dev/null +++ b/lib/EAPMsg/build/EAPMsg.vcxproj @@ -0,0 +1,106 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B385EC2B-C3F4-48BB-9BAC-8B996DE7F754} + EAPMsg + + + + StaticLibrary + true + Unicode + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + {d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b} + + + + + + \ No newline at end of file diff --git a/lib/EAPMsg/build/EAPMsg.vcxproj.filters b/lib/EAPMsg/build/EAPMsg.vcxproj.filters new file mode 100644 index 0000000..b22d1f8 --- /dev/null +++ b/lib/EAPMsg/build/EAPMsg.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/lib/EAPMsg/include/Config.h b/lib/EAPMsg/include/Config.h new file mode 100644 index 0000000..de7499b --- /dev/null +++ b/lib/EAPMsg/include/Config.h @@ -0,0 +1,105 @@ +/* + 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 . +*/ + +#include + +namespace eap +{ + /// + /// EAPMsg configuration + /// + class config_method_eapmsg; +} + +#pragma once + +#include "../../EAPBase/include/Config.h" + +#include +#include +#include + + +namespace eap +{ + class config_method_eapmsg : public config_method + { + public: + /// + /// Constructs configuration + /// + /// \param[in] mod EAP module to use for global services + /// \param[in] level Config level (0=outer, 1=inner, 2=inner-inner...) + /// + config_method_eapmsg(_In_ module &mod, _In_ unsigned int level); + + /// + /// Copies configuration + /// + /// \param[in] other Configuration to copy from + /// + config_method_eapmsg(_In_ const config_method_eapmsg &other); + + /// + /// Moves configuration + /// + /// \param[in] other Configuration to move from + /// + config_method_eapmsg(_Inout_ config_method_eapmsg &&other); + + /// + /// Copies configuration + /// + /// \param[in] other Configuration to copy from + /// + /// \returns Reference to this object + /// + config_method_eapmsg& operator=(_In_ const config_method_eapmsg &other); + + /// + /// Moves configuration + /// + /// \param[in] other Configuration to move from + /// + /// \returns Reference to this object + /// + config_method_eapmsg& operator=(_Inout_ config_method_eapmsg &&other); + + /// + /// Clones configuration + /// + /// \returns Pointer to cloned configuration + /// + virtual config* clone() const; + + /// + /// Returns EAP method type of this configuration + /// + virtual winstd::eap_type_t get_method_id() const; + + /// + /// Returns EAP method type as a string + /// + virtual const wchar_t* get_method_str() const; + + public: + EAP_METHOD_TYPE m_type; + }; +} diff --git a/lib/EAPMsg/include/Credentials.h b/lib/EAPMsg/include/Credentials.h new file mode 100644 index 0000000..d3f8162 --- /dev/null +++ b/lib/EAPMsg/include/Credentials.h @@ -0,0 +1,214 @@ +/* + 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 . +*/ + +#include + +namespace eap +{ + /// + /// EAPMsg credentials + /// + class credentials_eapmsg; +} + +#pragma once + +#include "Config.h" + +#include "../../EAPBase/include/Credentials.h" + +#include + +#include +#include + + +namespace eap +{ + class credentials_eapmsg : public credentials + { + public: + /// + /// Constructs credentials + /// + /// \param[in] mod EAP module to use for global services + /// + credentials_eapmsg(_In_ module &mod); + + /// + /// Copies credentials + /// + /// \param[in] other Credentials to copy from + /// + credentials_eapmsg(_In_ const credentials_eapmsg &other); + + /// + /// Moves credentials + /// + /// \param[in] other Credentials to move from + /// + credentials_eapmsg(_Inout_ credentials_eapmsg &&other); + + /// + /// Copies credentials + /// + /// \param[in] other Credentials to copy from + /// + /// \returns Reference to this object + /// + credentials_eapmsg& operator=(_In_ const credentials_eapmsg &other); + + /// + /// Moves credentials + /// + /// \param[in] other Credentials to move from + /// + /// \returns Reference to this object + /// + credentials_eapmsg& operator=(_Inout_ credentials_eapmsg &&other); + + /// + /// Clones credentials + /// + /// \returns Pointer to cloned credentials + /// + virtual config* clone() const; + + /// + /// Resets credentials + /// + virtual void clear(); + + /// + /// Test credentials if blank + /// + /// \returns + /// - \c true if blank + /// - \c false otherwise + /// + virtual bool empty() const; + + /// \name XML credentials management + /// @{ + + /// + /// Save to XML document + /// + /// \param[in] pDoc XML document + /// \param[in] pConfigRoot Suggested root element for saving + /// + virtual void save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const; + + /// + /// Load from XML document + /// + /// \param[in] pConfigRoot Root element for loading + /// + virtual void load(_In_ IXMLDOMNode *pConfigRoot); + + /// @} + + /// \name BLOB management + /// @{ + + /// + /// Packs a configuration + /// + /// \param[inout] cursor Memory cursor + /// + virtual void operator<<(_Inout_ cursor_out &cursor) const; + + /// + /// Returns packed size of a configuration + /// + /// \returns Size of data when packed (in bytes) + /// + virtual size_t get_pk_size() const; + + /// + /// Unpacks a configuration + /// + /// \param[inout] cursor Memory cursor + /// + virtual void operator>>(_Inout_ cursor_in &cursor); + + /// @} + + /// \name Storage + /// @{ + + /// + /// Save credentials to Windows Credential Manager + /// + /// \param[in] pszTargetName The name in Windows Credential Manager to store credentials as + /// \param[in] level Credential level (0=outer, 1=inner, 2=inner-inner...) + /// + virtual void store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const; + + /// + /// Retrieve credentials from Windows Credential Manager + /// + /// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from + /// \param[in] level Credential level (0=outer, 1=inner, 2=inner-inner...) + /// + virtual void retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level); + + /// + /// Return target suffix for Windows Credential Manager credential name + /// + virtual LPCTSTR target_suffix() const; + + /// @} + + /// + /// Returns credential identity. + /// + virtual std::wstring get_identity() 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_eapmsg* type) + /// \param[in] cfg Method configuration (unused, as must be as config_method_eapmsg is not derived from config_method_with_cred) + /// \param[in] pszTargetName The name in Windows Credential Manager to retrieve credentials from (optional, can be \c NULL) + /// + /// \returns + /// - \c source_cache Credentials were obtained from EapHost cache + /// - \c source_config Credentials were set by method configuration + /// - \c source_storage Credentials were loaded from Windows Credential Manager + /// + virtual source_t combine( + _In_ const credentials *cred_cached, + _In_ const config_method_with_cred &cfg, + _In_opt_z_ LPCTSTR pszTargetName); + + public: + sanitizing_blob m_cred; ///< Client credentials + + private: + /// \cond internal + static const unsigned char s_entropy[1024]; + /// \endcond + }; +} diff --git a/lib/EAPMsg/include/Method.h b/lib/EAPMsg/include/Method.h new file mode 100644 index 0000000..9a3c9ee --- /dev/null +++ b/lib/EAPMsg/include/Method.h @@ -0,0 +1,105 @@ +/* + 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 . +*/ + +namespace eap +{ + /// + /// EAPMsg method + /// + class method_eapmsg; +} + + +#pragma once + +#include "Config.h" +#include "Credentials.h" + +#include "../../EAPBase/include/Method.h" + + +namespace eap +{ + class method_eapmsg : public method_noneap + { + WINSTD_NONCOPYABLE(method_eapmsg) + + 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_eapmsg(_In_ module &module, _In_ config_method_eapmsg &cfg, _In_ credentials_eapmsg &cred); + + /// + /// Moves an EAP method + /// + /// \param[in] other EAP method to move from + /// + method_eapmsg(_Inout_ method_eapmsg &&other); + + /// + /// Moves an EAP method + /// + /// \param[in] other EAP method to move from + /// + /// \returns Reference to this object + /// + method_eapmsg& operator=(_Inout_ method_eapmsg &&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); + + /// @} + + protected: + credentials_eapmsg &m_cred; ///< Method user credentials + + enum { + phase_unknown = -1, ///< Unknown phase + phase_init = 0, ///< Handshake initialize + phase_finished, ///< Connection shut down + } m_phase; ///< What phase is our communication at? + }; +} diff --git a/lib/EAPMsg/src/Config.cpp b/lib/EAPMsg/src/Config.cpp new file mode 100644 index 0000000..d6bff22 --- /dev/null +++ b/lib/EAPMsg/src/Config.cpp @@ -0,0 +1,89 @@ +/* + 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 . +*/ + +#include "StdAfx.h" + +using namespace std; +using namespace winstd; + + +////////////////////////////////////////////////////////////////////// +// eap::config_method_eapmsg +////////////////////////////////////////////////////////////////////// + +eap::config_method_eapmsg::config_method_eapmsg(_In_ module &mod, _In_ unsigned int level) : config_method(mod, level) +{ + memset(&m_type, 0, sizeof(EAP_METHOD_TYPE)); +} + + +eap::config_method_eapmsg::config_method_eapmsg(_In_ const config_method_eapmsg &other) : + m_type(other.m_type), + config_method(other) +{ +} + + +eap::config_method_eapmsg::config_method_eapmsg(_Inout_ config_method_eapmsg &&other) : + m_type(std::move(other.m_type)), + config_method(std::move(other)) +{ +} + + +eap::config_method_eapmsg& eap::config_method_eapmsg::operator=(_In_ const config_method_eapmsg &other) +{ + if (this != &other) { + (config_method&)*this = other; + m_type = other.m_type; + } + + return *this; +} + + +eap::config_method_eapmsg& eap::config_method_eapmsg::operator=(_Inout_ config_method_eapmsg &&other) +{ + if (this != &other) { + (config_method&&)*this = std::move(other); + m_type = std::move(other.m_type); + } + + return *this; +} + + +eap::config* eap::config_method_eapmsg::clone() const +{ + return new config_method_eapmsg(*this); +} + + +eap_type_t eap::config_method_eapmsg::get_method_id() const +{ + return (eap_type_t)m_type.eapType.type; +} + + +const wchar_t* eap::config_method_eapmsg::get_method_str() const +{ + // TODO: Query registry for EAP method name (PeerFriendlyName). + return L"EAPMsg"; +} diff --git a/lib/EAPMsg/src/Credentials.cpp b/lib/EAPMsg/src/Credentials.cpp new file mode 100644 index 0000000..7cadd10 --- /dev/null +++ b/lib/EAPMsg/src/Credentials.cpp @@ -0,0 +1,341 @@ +/* + 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 . +*/ + +#include "StdAfx.h" + +using namespace std; +using namespace winstd; + + +////////////////////////////////////////////////////////////////////// +// eap::credentials_eapmsg +////////////////////////////////////////////////////////////////////// + +eap::credentials_eapmsg::credentials_eapmsg(_In_ module &mod) : credentials(mod) +{ +} + + +eap::credentials_eapmsg::credentials_eapmsg(_In_ const credentials_eapmsg &other) : + m_cred(other.m_cred), + credentials(other) +{ +} + + +eap::credentials_eapmsg::credentials_eapmsg(_Inout_ credentials_eapmsg &&other) : + m_cred(std::move(other.m_cred)), + credentials(std::move(other)) +{ +} + + +eap::credentials_eapmsg& eap::credentials_eapmsg::operator=(_In_ const credentials_eapmsg &other) +{ + if (this != &other) { + (credentials&)*this = other; + m_cred = other.m_cred; + } + + return *this; +} + + +eap::credentials_eapmsg& eap::credentials_eapmsg::operator=(_Inout_ credentials_eapmsg &&other) +{ + if (this != &other) { + (credentials&)*this = std::move(other); + m_cred = std::move(other.m_cred); + } + + return *this; +} + + +eap::config* eap::credentials_eapmsg::clone() const +{ + return new credentials_eapmsg(*this); +} + + +void eap::credentials_eapmsg::clear() +{ + credentials::clear(); + m_cred.clear(); +} + + +bool eap::credentials_eapmsg::empty() const +{ + return m_cred.empty(); +} + + +void eap::credentials_eapmsg::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot) const +{ + assert(pDoc); + assert(pConfigRoot); + + credentials::save(pDoc, pConfigRoot); + + HRESULT hr; + + // + if (FAILED(hr = eapxml::put_element_base64(pDoc, pConfigRoot, bstr(L"Credentials"), namespace_eapmetadata, m_cred.data(), m_cred.size()))) + throw com_runtime_error(hr, __FUNCTION__ " Error creating element."); +} + + +void eap::credentials_eapmsg::load(_In_ IXMLDOMNode *pConfigRoot) +{ + assert(pConfigRoot); + HRESULT hr; + + credentials::load(pConfigRoot); + + std::wstring xpath(eapxml::get_xpath(pConfigRoot)); + + m_cred.clear(); + if (FAILED(hr = eapxml::get_element_base64(pConfigRoot, bstr(L"eap-metadata:Credentials"), m_cred))) + throw com_runtime_error(hr, __FUNCTION__ " Error reading element."); + + // TODO: Finish log output! + //m_module.log_config((xpath + L"/Credentials").c_str(), get_name().c_str()); +} + + +void eap::credentials_eapmsg::operator<<(_Inout_ cursor_out &cursor) const +{ + credentials::operator<<(cursor); + cursor << m_cred; +} + + +size_t eap::credentials_eapmsg::get_pk_size() const +{ + return + credentials::get_pk_size() + + pksizeof(m_cred); +} + + +void eap::credentials_eapmsg::operator>>(_Inout_ cursor_in &cursor) +{ + credentials::operator>>(cursor); + cursor >> m_cred; +} + + +void eap::credentials_eapmsg::store(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) const +{ + // TODO: Finish! + UNREFERENCED_PARAMETER(pszTargetName); + UNREFERENCED_PARAMETER(level); + + //assert(pszTargetName); + + //data_blob cred_enc; + //if (m_cred) { + // // Encrypt the certificate using user's key. + // DATA_BLOB cred_blob = { m_cred->cbCertEncoded, m_cred->pbCertEncoded }; + // DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy }; + // if (!CryptProtectData(&cred_blob, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &cred_enc)) + // throw win_runtime_error(__FUNCTION__ " CryptProtectData failed."); + //} + + //tstring target(target_name(pszTargetName, level)); + + //// Write credentials. + //assert(cred_enc.cbData < CRED_MAX_CREDENTIAL_BLOB_SIZE); + //assert(m_identity.length() < CRED_MAX_USERNAME_LENGTH ); + //CREDENTIAL cred = { + // 0, // Flags + // CRED_TYPE_GENERIC, // Type + // (LPTSTR)target.c_str(), // TargetName + // _T(""), // Comment + // { 0, 0 }, // LastWritten + // cred_enc.cbData, // CredentialBlobSize + // cred_enc.pbData, // CredentialBlob + // CRED_PERSIST_ENTERPRISE, // Persist + // 0, // AttributeCount + // NULL, // Attributes + // NULL, // TargetAlias + // (LPTSTR)m_identity.c_str() // UserName + //}; + //if (!CredWrite(&cred, 0)) + // throw win_runtime_error(__FUNCTION__ " CredWrite failed."); +} + + +void eap::credentials_eapmsg::retrieve(_In_z_ LPCTSTR pszTargetName, _In_ unsigned int level) +{ + // TODO: Finish! + UNREFERENCED_PARAMETER(pszTargetName); + UNREFERENCED_PARAMETER(level); + + //assert(pszTargetName); + + //// Read credentials. + //unique_ptr > cred; + //if (!CredRead(target_name(pszTargetName, level).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) + // throw win_runtime_error(__FUNCTION__ " CredRead failed."); + + //if (cred->CredentialBlobSize) { + // // Decrypt the certificate using user's key. + // DATA_BLOB cred_enc = { cred->CredentialBlobSize, cred->CredentialBlob }; + // DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy }; + // data_blob cred_int; + // if (!CryptUnprotectData(&cred_enc, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN | CRYPTPROTECT_VERIFY_PROTECTION, &cred_int)) + // throw win_runtime_error(__FUNCTION__ " CryptUnprotectData failed."); + + // bool bResult = m_cred.create(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cred_int.pbData, cred_int.cbData); + // SecureZeroMemory(cred_int.pbData, cred_int.cbData); + // if (!bResult) + // throw win_runtime_error(__FUNCTION__ " Error loading certificate."); + //} else + // m_cred.free(); + + //if (cred->UserName) + // m_identity = cred->UserName; + //else + // m_identity.clear(); + + //wstring xpath(pszTargetName); + //m_module.log_config((xpath + L"/Identity").c_str(), m_identity.c_str()); + //m_module.log_config((xpath + L"/Certificate").c_str(), get_name().c_str()); +} + + +LPCTSTR eap::credentials_eapmsg::target_suffix() const +{ + return _T("BLOB"); +} + + +std::wstring eap::credentials_eapmsg::get_identity() const +{ + if (!m_identity.empty()) { + return m_identity; + } else if (!m_cred.empty()) { + // TODO: Use EapHostPeerGetIdentity() to obtain user identity. + } + + return L""; +} + + +eap::credentials::source_t eap::credentials_eapmsg::combine( + _In_ const credentials *cred_cached, + _In_ const config_method_with_cred &cfg, + _In_opt_z_ LPCTSTR pszTargetName) +{ + UNREFERENCED_PARAMETER(cfg); + + if (cred_cached) { + // Using EAP service cached credentials. + *this = *(credentials_eapmsg*)cred_cached; + m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_CACHED2, event_data((unsigned int)eap_type_tls), event_data(credentials_eapmsg::get_name()), event_data(pszTargetName), event_data::blank); + return source_cache; + } + + if (pszTargetName) { + try { + credentials_eapmsg cred_loaded(m_module); + cred_loaded.retrieve(pszTargetName, cfg.m_level); + + // Using stored credentials. + *this = std::move(cred_loaded); + m_module.log_event(&EAPMETHOD_TRACE_EVT_CRED_STORED2, event_data((unsigned int)eap_type_tls), event_data(credentials_eapmsg::get_name()), event_data(pszTargetName), event_data::blank); + return source_storage; + } catch (...) { + // Not actually an error. + } + } + + return source_unknown; +} + + +const unsigned char eap::credentials_eapmsg::s_entropy[1024] = { + 0xe6, 0x01, 0x7b, 0x5f, 0xe5, 0x32, 0xee, 0x8c, 0x57, 0x41, 0x52, 0x95, 0xab, 0xe5, 0x65, 0xdd, + 0xb3, 0x12, 0x7c, 0xcb, 0xdb, 0x37, 0x03, 0x76, 0xfc, 0x53, 0x4a, 0xf9, 0x3f, 0xf1, 0xd8, 0x7e, + 0x60, 0x9a, 0x49, 0x93, 0xeb, 0x2e, 0x18, 0xd0, 0xfb, 0x40, 0xa9, 0x95, 0x66, 0x8a, 0xdd, 0x99, + 0x51, 0x1c, 0xfb, 0x73, 0xa9, 0x7c, 0x31, 0x2b, 0xe6, 0x54, 0x61, 0x64, 0x25, 0x86, 0x36, 0xd4, + 0xde, 0xc8, 0x6d, 0x3e, 0x6f, 0x47, 0x40, 0x6f, 0xd6, 0x5b, 0xe2, 0x0c, 0x92, 0x16, 0xe2, 0xdc, + 0x45, 0x2f, 0x44, 0xf4, 0x87, 0x64, 0x6d, 0x4e, 0x5c, 0x24, 0x8a, 0x10, 0xb1, 0x2f, 0xa7, 0xe3, + 0x7d, 0x60, 0x98, 0x1c, 0xd4, 0x8d, 0xbb, 0x27, 0xb9, 0x02, 0xb1, 0x4a, 0x49, 0xd9, 0x80, 0xe1, + 0x7d, 0x20, 0xac, 0xba, 0x12, 0x23, 0x67, 0x28, 0x9e, 0xe8, 0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x99, 0x39, 0x85, 0x87, 0xd9, 0x1c, 0x5d, 0xea, 0xa2, 0x6f, 0x5b, 0x81, 0x1a, 0x73, + 0x08, 0xf8, 0xf3, 0x07, 0xcb, 0x9c, 0x32, 0x3a, 0x2c, 0x8b, 0x44, 0xe6, 0x48, 0x1e, 0x66, 0x1b, + 0x5e, 0xe3, 0x54, 0xef, 0x68, 0xf7, 0x28, 0xf8, 0xd6, 0x16, 0xe5, 0xde, 0xb0, 0xbc, 0x2d, 0x15, + 0xa0, 0x9f, 0xa6, 0x91, 0x4c, 0x1c, 0x91, 0xc9, 0xf2, 0x63, 0x32, 0xf2, 0xfb, 0xd9, 0x5e, 0x53, + 0xd6, 0x72, 0x8c, 0x1b, 0xe5, 0xf1, 0x80, 0xcc, 0x21, 0xa9, 0x87, 0xaf, 0x64, 0x8d, 0x0f, 0xae, + 0xe9, 0x0c, 0x31, 0x26, 0xa4, 0x72, 0x30, 0x8d, 0x0c, 0xfe, 0x5a, 0x25, 0x2d, 0x18, 0xe5, 0x39, + 0xcc, 0x04, 0x56, 0xa3, 0x65, 0x84, 0x95, 0x43, 0x40, 0x94, 0x6d, 0x16, 0x15, 0x79, 0x35, 0xa1, + 0x7f, 0x4b, 0x3e, 0x08, 0xf1, 0x53, 0xf2, 0xc6, 0x31, 0x7e, 0xb8, 0x29, 0x9b, 0xa4, 0xe9, 0x9d, + 0x6b, 0x95, 0xae, 0x37, 0xdf, 0x1d, 0x8c, 0xea, 0xc2, 0x50, 0x14, 0x48, 0x05, 0xd0, 0xcd, 0xd1, + 0x25, 0x25, 0x10, 0xa2, 0x85, 0x6f, 0x88, 0xe1, 0x22, 0x9d, 0xd2, 0xbe, 0x59, 0x88, 0x86, 0x20, + 0x93, 0x6a, 0x44, 0xed, 0xc8, 0xee, 0x73, 0xe7, 0x1a, 0xc3, 0x16, 0x23, 0xff, 0x69, 0x8c, 0xd0, +}; diff --git a/lib/EAPMsg/src/EAPMsg.cpp b/lib/EAPMsg/src/EAPMsg.cpp new file mode 100644 index 0000000..f74e5fa --- /dev/null +++ b/lib/EAPMsg/src/EAPMsg.cpp @@ -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 . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// eap::credentials_eapmsg +////////////////////////////////////////////////////////////////////// + +eap::credentials_eapmsg::credentials_eapmsg(_In_ module &mod) : credentials_pass(mod) +{ +} + + +eap::credentials_eapmsg::credentials_eapmsg(_In_ const credentials_eapmsg &other) : + credentials_pass(other) +{ +} + + +eap::credentials_eapmsg::credentials_eapmsg(_Inout_ credentials_eapmsg &&other) : + credentials_pass(std::move(other)) +{ +} + + +eap::credentials_eapmsg& eap::credentials_eapmsg::operator=(_In_ const credentials_eapmsg &other) +{ + if (this != &other) + (credentials_pass&)*this = other; + + return *this; +} + + +eap::credentials_eapmsg& eap::credentials_eapmsg::operator=(_Inout_ credentials_eapmsg &&other) +{ + if (this != &other) + (credentials_pass&&)*this = std::move(other); + + return *this; +} diff --git a/lib/EAPMsg/src/Method.cpp b/lib/EAPMsg/src/Method.cpp new file mode 100644 index 0000000..72c8b3b --- /dev/null +++ b/lib/EAPMsg/src/Method.cpp @@ -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 . +*/ + +#include "StdAfx.h" + +using namespace std; +using namespace winstd; + + +////////////////////////////////////////////////////////////////////// +// eap::method_eapmsg +////////////////////////////////////////////////////////////////////// + +eap::method_eapmsg::method_eapmsg(_In_ module &module, _In_ config_method_eapmsg &cfg, _In_ credentials_eapmsg &cred) : + m_cred(cred), + m_phase(phase_unknown), + method_noneap(module, cfg, cred) +{ +} + + +eap::method_eapmsg::method_eapmsg(_Inout_ method_eapmsg &&other) : + m_cred ( other.m_cred ), + m_phase (std::move(other.m_phase )), + method_noneap(std::move(other )) +{ +} + + +eap::method_eapmsg& eap::method_eapmsg::operator=(_Inout_ method_eapmsg &&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 ); + } + + return *this; +} + + +void eap::method_eapmsg::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)m_cfg.get_method_id()), event_data::blank); + m_phase = phase_init; +} + + +void eap::method_eapmsg::process_request_packet( + _In_bytecount_(dwReceivedPacketSize) const void *pReceivedPacket, + _In_ DWORD dwReceivedPacketSize, + _Inout_ EapPeerMethodOutput *pEapOutput) +{ + UNREFERENCED_PARAMETER(pReceivedPacket); + assert(pReceivedPacket || dwReceivedPacketSize == 0); + assert(pEapOutput); + + m_module.log_event(&EAPMETHOD_PACKET_RECV, event_data((unsigned int)m_cfg.get_method_id()), event_data((unsigned int)dwReceivedPacketSize), event_data::blank); + + // TODO: Finish! + //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); + + // // EAPMsg 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; + // m_cfg.m_last_status = config_method::status_cred_invalid; // Blame credentials if we fail beyond this point. + // break; + //} + + //case phase_finished: + // break; + //} + + pEapOutput->fAllowNotifications = TRUE; + pEapOutput->action = EapPeerMethodResponseActionSend; +} diff --git a/lib/EAPMsg/src/StdAfx.cpp b/lib/EAPMsg/src/StdAfx.cpp new file mode 100644 index 0000000..4af5ec1 --- /dev/null +++ b/lib/EAPMsg/src/StdAfx.cpp @@ -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 . +*/ + +#include "StdAfx.h" diff --git a/lib/EAPMsg/src/StdAfx.h b/lib/EAPMsg/src/StdAfx.h new file mode 100644 index 0000000..cc1d372 --- /dev/null +++ b/lib/EAPMsg/src/StdAfx.h @@ -0,0 +1,28 @@ +/* + 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 . +*/ + +#pragma once + +#include "../include/Config.h" +#include "../include/Credentials.h" +#include "../include/Method.h" + +#include +#include // include after Windows.h diff --git a/lib/EAPMsg_UI/build/.gitignore b/lib/EAPMsg_UI/build/.gitignore new file mode 100644 index 0000000..9c8716a --- /dev/null +++ b/lib/EAPMsg_UI/build/.gitignore @@ -0,0 +1,2 @@ +/temp +/*.user diff --git a/lib/EAPMsg_UI/build/EAPMsg_UI.props b/lib/EAPMsg_UI/build/EAPMsg_UI.props new file mode 100644 index 0000000..4997b71 --- /dev/null +++ b/lib/EAPMsg_UI/build/EAPMsg_UI.props @@ -0,0 +1,12 @@ + + + + + + + + ..\..\Events\build\temp\Events.$(Platform).$(Configuration).$(PlatformToolset);..\..\WinStd\include;%(AdditionalIncludeDirectories) + + + + \ No newline at end of file diff --git a/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj b/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj new file mode 100644 index 0000000..bd2bcbd --- /dev/null +++ b/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {13D2D8B5-F6AA-459D-B5F7-29B95DD9D583} + EAPMsg_UI + + + + StaticLibrary + true + Unicode + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + {d63f24bd-92a0-4d6b-8b69-ed947e4d2b1b} + + + + + + + + + \ No newline at end of file diff --git a/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj.filters b/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj.filters new file mode 100644 index 0000000..4b7b8cd --- /dev/null +++ b/lib/EAPMsg_UI/build/EAPMsg_UI.vcxproj.filters @@ -0,0 +1,44 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/lib/EAPMsg_UI/include/EAPMsg_UI.h b/lib/EAPMsg_UI/include/EAPMsg_UI.h new file mode 100644 index 0000000..d00b623 --- /dev/null +++ b/lib/EAPMsg_UI/include/EAPMsg_UI.h @@ -0,0 +1,87 @@ +/* + 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 . +*/ + +#include "../../EAPBase_UI/include/EAP_UI.h" +#include "../../EAPMsg/include/Config.h" + +/// +/// Inner EAP method config panel +/// +class wxEAPMsgMethodConfigPanel; + +/// +/// EAPMsg credential configuration panel +/// +typedef wxEAPCredentialsConfigPanel > wxEAPMsgCredentialsConfigPanel; + +/// +/// EAPMsg configuration panel +/// +class wxEAPMsgConfigPanel; + +#pragma once + +#include "../res/wxEAPMsg_UI.h" + +#include +#include + +#include + + +class wxEAPMsgMethodConfigPanel : public wxEAPMsgMethodConfigPanelBase +{ +public: + /// + /// Constructs an inner EAP method config panel + /// + /// \param[in ] prov Provider configuration data + /// \param[inout] cfg Configuration data + /// \param[in ] parent Parent window + /// + wxEAPMsgMethodConfigPanel(const eap::config_provider &prov, eap::config_method_eapmsg &cfg, wxWindow *parent); +}; + + +class wxEAPMsgConfigPanel : public wxPanel +{ +public: + /// + /// Constructs a configuration panel + /// + /// \param[in ] prov Provider configuration data + /// \param[inout] cfg Configuration data + /// \param[in ] parent Parent window + /// + wxEAPMsgConfigPanel(const eap::config_provider &prov, eap::config_method_eapmsg &cfg, wxWindow* parent); + + /// + /// Destructs the configuration panel + /// + virtual ~wxEAPMsgConfigPanel(); + +protected: + /// \cond internal + virtual void OnInitDialog(wxInitDialogEvent& event); + /// \endcond + +protected: + wxEAPMsgMethodConfigPanel *m_method; ///< Method configuration panel +}; diff --git a/lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp b/lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp new file mode 100644 index 0000000..8c7f80e --- /dev/null +++ b/lib/EAPMsg_UI/res/wxEAPMsg_UI.cpp @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 17 2015) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include + +#include "wxEAPMsg_UI.h" + +/////////////////////////////////////////////////////////////////////////// + +wxEAPMsgMethodConfigPanelBase::wxEAPMsgMethodConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxStaticBoxSizer* sb_method; + sb_method = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Inner EAP Method") ), wxVERTICAL ); + + wxBoxSizer* sb_method_horiz; + sb_method_horiz = new wxBoxSizer( wxHORIZONTAL ); + + m_method_icon = new wxStaticBitmap( sb_method->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + sb_method_horiz->Add( m_method_icon, 0, wxALL, 5 ); + + wxBoxSizer* sb_method_vert; + sb_method_vert = new wxBoxSizer( wxVERTICAL ); + + m_method_label = new wxStaticText( sb_method->GetStaticBox(), wxID_ANY, _("Select and configure inner EAP method"), wxDefaultPosition, wxDefaultSize, 0 ); + m_method_label->Wrap( 440 ); + sb_method_vert->Add( m_method_label, 0, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* sb_method_inner; + sb_method_inner = new wxBoxSizer( wxHORIZONTAL ); + + wxArrayString m_methodChoices; + m_method = new wxChoice( sb_method->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_methodChoices, 0 ); + m_method->SetSelection( 0 ); + sb_method_inner->Add( m_method, 1, wxRIGHT|wxEXPAND, 5 ); + + m_settings = new wxButton( sb_method->GetStaticBox(), wxID_ANY, _("&Settings"), wxDefaultPosition, wxDefaultSize, 0 ); + sb_method_inner->Add( m_settings, 0, 0, 5 ); + + + sb_method_vert->Add( sb_method_inner, 0, wxEXPAND|wxALL, 5 ); + + + sb_method_horiz->Add( sb_method_vert, 1, wxEXPAND, 5 ); + + + sb_method->Add( sb_method_horiz, 1, wxEXPAND, 5 ); + + + this->SetSizer( sb_method ); + this->Layout(); + + // Connect Events + m_settings->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPMsgMethodConfigPanelBase::OnSettings ), NULL, this ); +} + +wxEAPMsgMethodConfigPanelBase::~wxEAPMsgMethodConfigPanelBase() +{ + // Disconnect Events + m_settings->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxEAPMsgMethodConfigPanelBase::OnSettings ), NULL, this ); + +} diff --git a/lib/EAPMsg_UI/res/wxEAPMsg_UI.fbp b/lib/EAPMsg_UI/res/wxEAPMsg_UI.fbp new file mode 100644 index 0000000..59a682a --- /dev/null +++ b/lib/EAPMsg_UI/res/wxEAPMsg_UI.fbp @@ -0,0 +1,465 @@ + + + + + ; + C++ + 1 + source_name + 0 + 0 + . + UTF-8 + connect + wxEAPMsg_UI + 1000 + none + 1 + wxEAPMsg_UI + + . + #include <StdAfx.h> + 1 + 1 + 1 + 1 + UI + 1 + 1 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + wxEAPMsgMethodConfigPanelBase + + 500,-1 + + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wxID_ANY + Inner EAP Method + + sb_method + wxVERTICAL + none + + + 5 + wxEXPAND + 1 + + + sb_method_horiz + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Icon Resource; ; [32; 32] + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_method_icon + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + sb_method_vert + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Select and configure inner EAP method + + 0 + + + 0 + + 1 + m_method_label + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + 440 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + + sb_method_inner + wxHORIZONTAL + none + + 5 + wxRIGHT|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_method + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Settings + + 0 + + + 0 + + 1 + m_settings + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnSettings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/EAPMsg_UI/res/wxEAPMsg_UI.h b/lib/EAPMsg_UI/res/wxEAPMsg_UI.h new file mode 100644 index 0000000..1b4a911 --- /dev/null +++ b/lib/EAPMsg_UI/res/wxEAPMsg_UI.h @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 17 2015) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __WXEAPMSG_UI_H__ +#define __WXEAPMSG_UI_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class wxEAPMsgMethodConfigPanelBase +/////////////////////////////////////////////////////////////////////////////// +class wxEAPMsgMethodConfigPanelBase : public wxPanel +{ + private: + + protected: + wxStaticBitmap* m_method_icon; + wxStaticText* m_method_label; + wxChoice* m_method; + wxButton* m_settings; + + // Virtual event handlers, overide them in your derived class + virtual void OnSettings( wxCommandEvent& event ) { event.Skip(); } + + + public: + + wxEAPMsgMethodConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + ~wxEAPMsgMethodConfigPanelBase(); + +}; + +#endif //__WXEAPMSG_UI_H__ diff --git a/lib/EAPMsg_UI/src/EAPMsg_UI.cpp b/lib/EAPMsg_UI/src/EAPMsg_UI.cpp new file mode 100644 index 0000000..ec0bfb5 --- /dev/null +++ b/lib/EAPMsg_UI/src/EAPMsg_UI.cpp @@ -0,0 +1,72 @@ +/* + 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 . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// wxEAPMsgMethodConfigPanel +////////////////////////////////////////////////////////////////////// + +wxEAPMsgMethodConfigPanel::wxEAPMsgMethodConfigPanel(const eap::config_provider &prov, eap::config_method_eapmsg &cfg, wxWindow *parent) : wxEAPMsgMethodConfigPanelBase(parent) +{ + UNREFERENCED_PARAMETER(prov); + UNREFERENCED_PARAMETER(cfg); + + // 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_method_icon->SetIcon(wxLoadIconFromResource(lib_shell32, MAKEINTRESOURCE(175))); +} + + +////////////////////////////////////////////////////////////////////// +// wxEAPMsgConfigPanel +////////////////////////////////////////////////////////////////////// + +wxEAPMsgConfigPanel::wxEAPMsgConfigPanel(const eap::config_provider &prov, eap::config_method_eapmsg &cfg, wxWindow* parent) : wxPanel(parent) +{ + wxBoxSizer* sb_content; + sb_content = new wxBoxSizer( wxVERTICAL ); + + m_method = new wxEAPMsgMethodConfigPanel(prov, cfg, this); + sb_content->Add(m_method, 0, wxEXPAND, 5); + + this->SetSizer(sb_content); + this->Layout(); + + // Connect Events + this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPMsgConfigPanel::OnInitDialog)); +} + + +wxEAPMsgConfigPanel::~wxEAPMsgConfigPanel() +{ + // Disconnect Events + this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPMsgConfigPanel::OnInitDialog)); +} + + +void wxEAPMsgConfigPanel::OnInitDialog(wxInitDialogEvent& event) +{ + // Forward the event to child panels. + if (m_method) + m_method->GetEventHandler()->ProcessEvent(event); +} diff --git a/lib/EAPMsg_UI/src/StdAfx.cpp b/lib/EAPMsg_UI/src/StdAfx.cpp new file mode 100644 index 0000000..4af5ec1 --- /dev/null +++ b/lib/EAPMsg_UI/src/StdAfx.cpp @@ -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 . +*/ + +#include "StdAfx.h" diff --git a/lib/EAPMsg_UI/src/StdAfx.h b/lib/EAPMsg_UI/src/StdAfx.h new file mode 100644 index 0000000..db2a2a7 --- /dev/null +++ b/lib/EAPMsg_UI/src/StdAfx.h @@ -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 . +*/ + +#pragma once + +#define _CRT_SECURE_NO_WARNINGS // Prevent warnings from wxWidgets headers + +#include "../include/EAPMsg_UI.h"