diff --git a/EAPMethods/src/Main.cpp b/EAPMethods/src/Main.cpp index 77ff83a..0d336ea 100644 --- a/EAPMethods/src/Main.cpp +++ b/EAPMethods/src/Main.cpp @@ -236,8 +236,8 @@ DWORD APIENTRY EapPeerGetIdentity( else if (!ppwszIdentity) g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL."))); else { - _EAPMETHOD_PEER::config_type cfg(g_peer); - _EAPMETHOD_PEER::identity_type usr(g_peer); + _EAPMETHOD_PEER::config_providers_type cfg(g_peer); + _EAPMETHOD_PEER::credentials_type usr(g_peer); if (!g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) || !g_peer.unpack(usr, pUserData, dwUserDataSize, ppEapError) || !g_peer.get_identity(dwFlags, cfg, usr, hTokenImpersonateUser, pfInvokeUI, ppwszIdentity, ppEapError) || @@ -302,7 +302,7 @@ DWORD APIENTRY EapPeerBeginSession( // Begin the session. if (!g_peer.unpack(session->m_cfg, pConnectionData, dwConnectionDataSize, ppEapError) || - !g_peer.unpack(session->m_id, pUserData, dwUserDataSize, ppEapError) || + !g_peer.unpack(session->m_cred, pUserData, dwUserDataSize, ppEapError) || !session->begin(dwFlags, pAttributeArray, hTokenImpersonateUser, dwMaxSendPacketSize, ppEapError)) { if (*ppEapError) { @@ -684,8 +684,8 @@ DWORD WINAPI EapPeerGetMethodProperties( else if (!pMethodPropertyArray) g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pMethodPropertyArray is NULL."))); else { - _EAPMETHOD_PEER::config_type cfg(g_peer); - _EAPMETHOD_PEER::identity_type usr(g_peer); + _EAPMETHOD_PEER::config_providers_type cfg(g_peer); + _EAPMETHOD_PEER::credentials_type usr(g_peer); if (!g_peer.unpack(cfg, pEapConnData, dwEapConnDataSize, ppEapError) || !g_peer.unpack(usr, pUserData, dwUserDataSize, ppEapError) || !g_peer.get_method_properties( @@ -762,7 +762,7 @@ DWORD WINAPI EapPeerCredentialsXml2Blob( // Load credentials. pCredentialsDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"")); - _EAPMETHOD_PEER::identity_type usr(g_peer); + _EAPMETHOD_PEER::credentials_type usr(g_peer); if (!usr.load(pXmlElCredentials, ppEapError) || !g_peer.pack(usr, ppCredentialsOut, pdwCredentialsOutSize, ppEapError)) { diff --git a/EAPMethods/src/Main_UI.cpp b/EAPMethods/src/Main_UI.cpp index 509d736..3f8d15f 100644 --- a/EAPMethods/src/Main_UI.cpp +++ b/EAPMethods/src/Main_UI.cpp @@ -142,7 +142,7 @@ DWORD WINAPI EapPeerConfigXml2Blob( // Load configuration. pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"")); - _EAPMETHOD_PEER_UI::config_type cfg(g_peer); + _EAPMETHOD_PEER_UI::config_providers_type cfg(g_peer); if (!cfg.load(pXmlElConfig, ppEapError) || !g_peer.pack(cfg, ppConfigOut, pdwConfigOutSize, ppEapError)) { @@ -198,7 +198,7 @@ DWORD WINAPI EapPeerConfigBlob2Xml( HRESULT hr; // Unpack configuration. - _EAPMETHOD_PEER_UI::config_type cfg(g_peer); + _EAPMETHOD_PEER_UI::config_providers_type cfg(g_peer); if (!g_peer.unpack(cfg, pConfigIn, dwConfigInSize, ppEapError)) { if (*ppEapError) { g_peer.log_error(*ppEapError); @@ -294,7 +294,7 @@ DWORD WINAPI EapPeerInvokeConfigUI( else if (!ppConnectionDataOut) g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL."))); else { - _EAPMETHOD_PEER_UI::config_type cfg(g_peer); + _EAPMETHOD_PEER_UI::config_providers_type cfg(g_peer); if (!g_peer.unpack(cfg, pConnectionDataIn, dwConnectionDataInSize, ppEapError) || !g_peer.invoke_config_ui(hwndParent, cfg, ppEapError) || !g_peer.pack(cfg, ppConnectionDataOut, pdwConnectionDataOutSize, ppEapError)) @@ -359,8 +359,8 @@ DWORD WINAPI EapPeerInvokeIdentityUI( else if (!ppwszIdentity) g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL."))); else { - _EAPMETHOD_PEER_UI::config_type cfg(g_peer); - _EAPMETHOD_PEER_UI::identity_type usr(g_peer); + _EAPMETHOD_PEER_UI::config_providers_type cfg(g_peer); + _EAPMETHOD_PEER_UI::credentials_type usr(g_peer); if (!g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) || !g_peer.unpack(usr, pUserData, dwUserDataSize, ppEapError) || !g_peer.invoke_identity_ui(hwndParent, dwFlags, cfg, usr, ppwszIdentity, ppEapError) || diff --git a/lib/EAPBase/include/Module.h b/lib/EAPBase/include/Module.h index 9d296ac..2e90958 100644 --- a/lib/EAPBase/include/Module.h +++ b/lib/EAPBase/include/Module.h @@ -32,14 +32,14 @@ namespace eap /// /// A group of methods all EAP peers must or should implement. /// - template class peer_base; + template class peer_base; /// /// EAP peer base class /// /// A group of methods all EAP peers must or should implement. /// - template class peer; + template class peer; } #pragma once @@ -654,24 +654,29 @@ namespace eap }; - template + template class peer_base : public module { public: + /// + /// Method configuration data type + /// + typedef _Tmeth config_method_type; + /// /// Provider configuration data type /// - typedef config_provider<_Tcfg> provider_config_type; + typedef config_provider config_provider_type; /// /// Configuration data type /// - typedef config_providers config_type; + typedef config_providers config_providers_type; /// - /// Identity data type + /// Credentials data type /// - typedef _Tid identity_type; + typedef _Tcred credentials_type; /// /// Interactive request data type @@ -691,14 +696,14 @@ namespace eap }; - template - class peer : public peer_base<_Tcfg, _Tid, _Tint, _Tintres> + template + class peer : public peer_base<_Tmeth, _Tcred, _Tint, _Tintres> { public: /// /// Constructs a EAP peer module for the given EAP type /// - peer(_In_ type_t eap_method) : peer_base<_Tcfg, _Tid, _Tint, _Tintres>(eap_method) {} + peer(_In_ type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {} /// /// Initializes an EAP peer method for EAPHost. @@ -732,13 +737,13 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool get_identity( - _In_ DWORD dwFlags, - _In_ const config_type &cfg, - _Inout_ identity_type &usr, - _In_ HANDLE hTokenImpersonateUser, - _Out_ BOOL *pfInvokeUI, - _Out_ WCHAR **ppwszIdentity, - _Out_ EAP_ERROR **ppEapError) = 0; + _In_ DWORD dwFlags, + _In_ const config_providers_type &cfg, + _Inout_ credentials_type &usr, + _In_ HANDLE hTokenImpersonateUser, + _Out_ BOOL *pfInvokeUI, + _Out_ WCHAR **ppwszIdentity, + _Out_ EAP_ERROR **ppEapError) = 0; /// /// Defines the implementation of an EAP method-specific function that retrieves the properties of an EAP method given the connection and user data. @@ -753,8 +758,8 @@ namespace eap _In_ DWORD dwVersion, _In_ DWORD dwFlags, _In_ HANDLE hUserImpersonationToken, - _In_ const config_type &cfg, - _In_ const identity_type &usr, + _In_ const config_providers_type &cfg, + _In_ const credentials_type &usr, _Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray, _Out_ EAP_ERROR **ppEapError) const = 0; diff --git a/lib/EAPBase/include/Session.h b/lib/EAPBase/include/Session.h index 85586b0..7ad1bdf 100644 --- a/lib/EAPBase/include/Session.h +++ b/lib/EAPBase/include/Session.h @@ -23,7 +23,7 @@ namespace eap /// /// EAP session /// - template class session; + template class session; } #pragma once @@ -40,24 +40,29 @@ extern "C" { namespace eap { - template + template class session { public: + /// + /// Method configuration data type + /// + typedef _Tmeth config_method_type; + /// /// Provider configuration data type /// - typedef config_provider<_Tcfg> provider_config_type; + typedef config_provider config_provider_type; /// /// Configuration data type /// - typedef config_providers config_type; + typedef config_providers config_providers_type; /// - /// Identity data type + /// Credentials data type /// - typedef _Tid identity_type; + typedef _Tcred credentials_type; /// /// Interactive request data type @@ -78,7 +83,7 @@ namespace eap session(_In_ module &mod) : m_module(mod), m_cfg(mod), - m_id(mod) + m_cred(mod) { } @@ -91,7 +96,7 @@ namespace eap session(_In_ const session &other) : m_module(other.m_module), m_cfg(other.m_cfg), - m_id(other.m_id) + m_cred(other.m_cred) { } @@ -104,7 +109,7 @@ namespace eap session(_Inout_ session &&other) : m_module(other.m_module), m_cfg(std::move(other.m_cfg)), - m_id(std::move(other.m_id)) + m_cred(std::move(other.m_cred)) { } @@ -120,8 +125,8 @@ namespace eap { if (this != std::addressof(other)) { assert(std::addressof(m_module) ==std::addressof(other.m_module)); // Copy session within same module only! - m_cfg = other.m_cfg; - m_id = other.m_id; + m_cfg = other.m_cfg; + m_cred = other.m_cred; } return *this; } @@ -138,8 +143,8 @@ namespace eap { if (this != std::addressof(other)) { assert(std::addressof(m_module) ==std::addressof(other.m_module)); // Move session within same module only! - m_cfg = std::move(other.m_cfg); - m_id = std::move(other.m_id); + m_cfg = std::move(other.m_cfg); + m_cred = std::move(other.m_cred); } return *this; } @@ -360,8 +365,8 @@ namespace eap /// @} public: - module &m_module; ///< Reference of the EAP module - config_type m_cfg; ///< Session configuration - identity_type m_id; ///< User identity + module &m_module; ///< Reference of the EAP module + config_providers_type m_cfg; ///< Session configuration + credentials_type m_cred; ///< User credentials }; } diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 1379115..642c260 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -96,7 +96,7 @@ public: /// /// Configuration data type /// - typedef eap::config_providers<_Tprov> config_type; + typedef eap::config_providers<_Tprov> config_providers_type; /// /// This data type @@ -107,7 +107,7 @@ public: /// /// Constructs a configuration dialog /// - wxEAPConfigDialog(config_type &cfg, wxWindow* parent) : + wxEAPConfigDialog(config_providers_type &cfg, wxWindow* parent) : m_cfg(cfg), wxEAPConfigDialogBase(parent) { @@ -150,7 +150,7 @@ protected: protected: - config_type &m_cfg; ///< EAP providers configuration + config_providers_type &m_cfg; ///< EAP providers configuration }; diff --git a/lib/EAPBase_UI/include/Module.h b/lib/EAPBase_UI/include/Module.h index 674f9a7..aaba459 100644 --- a/lib/EAPBase_UI/include/Module.h +++ b/lib/EAPBase_UI/include/Module.h @@ -25,7 +25,7 @@ namespace eap /// /// A group of methods all EAP UI peers must or should implement. /// - template class peer_ui; + template class peer_ui; } #pragma once @@ -35,14 +35,14 @@ namespace eap namespace eap { - template - class peer_ui : public peer_base<_Tcfg, _Tid, _Tint, _Tintres> + template + class peer_ui : public peer_base<_Tmeth, _Tcred, _Tint, _Tintres> { public: /// /// Constructs a EAP UI peer module for the given EAP type /// - peer_ui(_In_ type_t eap_method) : peer_base<_Tcfg, _Tid, _Tint, _Tintres>(eap_method) {} + peer_ui(_In_ type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {} /// /// Raises the EAP method's specific connection configuration user interface dialog on the client. @@ -58,9 +58,9 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool invoke_config_ui( - _In_ HWND hwndParent, - _Inout_ config_type &cfg, - _Out_ EAP_ERROR **ppEapError) = 0; + _In_ HWND hwndParent, + _Inout_ config_providers_type &cfg, + _Out_ EAP_ERROR **ppEapError) = 0; /// /// Raises a custom interactive user interface dialog to obtain user identity information for the EAP method on the client. @@ -79,12 +79,12 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool invoke_identity_ui( - _In_ HWND hwndParent, - _In_ DWORD dwFlags, - _Inout_ config_type &cfg, - _Inout_ identity_type &usr, - _Out_ LPWSTR *ppwszIdentity, - _Out_ EAP_ERROR **ppEapError) = 0; + _In_ HWND hwndParent, + _In_ DWORD dwFlags, + _Inout_ config_providers_type &cfg, + _Inout_ credentials_type &usr, + _Out_ LPWSTR *ppwszIdentity, + _Out_ EAP_ERROR **ppEapError) = 0; /// /// Raises a custom interactive user interface dialog for the EAP method on the client. diff --git a/lib/TTLS/include/Module.h b/lib/TTLS/include/Module.h index e3ee399..e3ded48 100644 --- a/lib/TTLS/include/Module.h +++ b/lib/TTLS/include/Module.h @@ -75,13 +75,13 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool get_identity( - _In_ DWORD dwFlags, - _In_ const config_type &cfg, - _Inout_ identity_type &usr, - _In_ HANDLE hTokenImpersonateUser, - _Out_ BOOL *pfInvokeUI, - _Out_ WCHAR **ppwszIdentity, - _Out_ EAP_ERROR **ppEapError); + _In_ DWORD dwFlags, + _In_ const config_providers_type &cfg, + _Inout_ credentials_type &usr, + _In_ HANDLE hTokenImpersonateUser, + _Out_ BOOL *pfInvokeUI, + _Out_ WCHAR **ppwszIdentity, + _Out_ EAP_ERROR **ppEapError); /// /// Defines the implementation of an EAP method-specific function that retrieves the properties of an EAP method given the connection and user data. @@ -96,8 +96,8 @@ namespace eap _In_ DWORD dwVersion, _In_ DWORD dwFlags, _In_ HANDLE hUserImpersonationToken, - _In_ const config_type &cfg, - _In_ const identity_type &usr, + _In_ const config_providers_type &cfg, + _In_ const credentials_type &usr, _Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray, _Out_ EAP_ERROR **ppEapError) const; }; diff --git a/lib/TTLS/src/Module.cpp b/lib/TTLS/src/Module.cpp index 5d00048..321d4c6 100644 --- a/lib/TTLS/src/Module.cpp +++ b/lib/TTLS/src/Module.cpp @@ -59,13 +59,13 @@ bool eap::peer_ttls::shutdown(_Out_ EAP_ERROR **ppEapError) bool eap::peer_ttls::get_identity( - _In_ DWORD dwFlags, - _In_ const config_type &cfg, - _Inout_ identity_type &usr, - _In_ HANDLE hTokenImpersonateUser, - _Out_ BOOL *pfInvokeUI, - _Out_ WCHAR **ppwszIdentity, - _Out_ EAP_ERROR **ppEapError) + _In_ DWORD dwFlags, + _In_ const config_providers_type &cfg, + _Inout_ credentials_type &usr, + _In_ HANDLE hTokenImpersonateUser, + _Out_ BOOL *pfInvokeUI, + _Out_ WCHAR **ppwszIdentity, + _Out_ EAP_ERROR **ppEapError) { UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(cfg); @@ -84,8 +84,8 @@ bool eap::peer_ttls::get_method_properties( _In_ DWORD dwVersion, _In_ DWORD dwFlags, _In_ HANDLE hUserImpersonationToken, - _In_ const config_type &cfg, - _In_ const identity_type &usr, + _In_ const config_providers_type &cfg, + _In_ const credentials_type &usr, _Out_ EAP_METHOD_PROPERTY_ARRAY *pMethodPropertyArray, _Out_ EAP_ERROR **ppEapError) const { diff --git a/lib/TTLS_UI/include/Module.h b/lib/TTLS_UI/include/Module.h index b35150b..f52c127 100644 --- a/lib/TTLS_UI/include/Module.h +++ b/lib/TTLS_UI/include/Module.h @@ -57,9 +57,9 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool invoke_config_ui( - _In_ HWND hwndParent, - _Inout_ config_type &cfg, - _Out_ EAP_ERROR **ppEapError); + _In_ HWND hwndParent, + _Inout_ config_providers_type &cfg, + _Out_ EAP_ERROR **ppEapError); /// /// Raises a custom interactive user interface dialog to obtain user identity information for the EAP method on the client. @@ -78,12 +78,12 @@ namespace eap /// - \c false otherwise. See \p ppEapError for details. /// virtual bool invoke_identity_ui( - _In_ HWND hwndParent, - _In_ DWORD dwFlags, - _Inout_ config_type &cfg, - _Inout_ identity_type &usr, - _Out_ LPWSTR *ppwszIdentity, - _Out_ EAP_ERROR **ppEapError); + _In_ HWND hwndParent, + _In_ DWORD dwFlags, + _Inout_ config_providers_type &cfg, + _Inout_ credentials_type &usr, + _Out_ LPWSTR *ppwszIdentity, + _Out_ EAP_ERROR **ppEapError); /// /// Raises a custom interactive user interface dialog for the EAP method on the client. diff --git a/lib/TTLS_UI/src/Module.cpp b/lib/TTLS_UI/src/Module.cpp index c544a67..69e6071 100644 --- a/lib/TTLS_UI/src/Module.cpp +++ b/lib/TTLS_UI/src/Module.cpp @@ -31,9 +31,9 @@ eap::peer_ttls_ui::peer_ttls_ui() : peer_ui > dlg(cfg, &parent); + wxEAPConfigDialog > dlg(cfg, &parent); result = dlg.ShowModal(); wxTopLevelWindows.DeleteObject(&parent); @@ -69,12 +69,12 @@ bool eap::peer_ttls_ui::invoke_config_ui( bool eap::peer_ttls_ui::invoke_identity_ui( - _In_ HWND hwndParent, - _In_ DWORD dwFlags, - _Inout_ config_type &cfg, - _Inout_ identity_type &usr, - _Out_ LPWSTR *ppwszIdentity, - _Out_ EAP_ERROR **ppEapError) + _In_ HWND hwndParent, + _In_ DWORD dwFlags, + _Inout_ config_providers_type &cfg, + _Inout_ credentials_type &usr, + _Out_ LPWSTR *ppwszIdentity, + _Out_ EAP_ERROR **ppEapError) { UNREFERENCED_PARAMETER(dwFlags); UNREFERENCED_PARAMETER(cfg);