diff --git a/lib/EAPBase/include/Config.h b/lib/EAPBase/include/Config.h index a993614..be992d4 100644 --- a/lib/EAPBase/include/Config.h +++ b/lib/EAPBase/include/Config.h @@ -28,9 +28,9 @@ namespace eap class config; /// - /// Base template for method configuration storage + /// Base class for method configuration storage /// - template class config_method; + class config_method; /// /// Single provider configuration @@ -201,57 +201,34 @@ namespace eap module &m_module; ///< Reference of the EAP module }; + + // Forward declaration, otherwise we would have to merge Credentials.h here. class credentials; - template + class config_method : public config { - public: - /// - /// Configuration credentials type - /// - typedef _Tcred credentials_type; - public: /// /// Constructs configuration /// /// \param[in] mod Reference of the EAP module to use for global services /// - config_method(_In_ module &mod) : - m_allow_save(true), - config(mod) - { - } - + config_method(_In_ module &mod); /// /// Copies configuration /// /// \param[in] other Configuration to copy from /// - config_method(_In_ const config_method<_Tcred> &other) : - m_allow_save(other.m_allow_save), - m_anonymous_identity(other.m_anonymous_identity), - m_preshared(other.m_preshared ? (credentials*)other.m_preshared->clone() : nullptr), - config(other) - { - } - + config_method(_In_ const config_method &other); /// /// Moves configuration /// /// \param[in] other Configuration to move from /// - config_method(_Inout_ config_method<_Tcred> &&other) : - m_allow_save(std::move(other.m_allow_save)), - m_anonymous_identity(std::move(other.m_anonymous_identity)), - m_preshared(std::move(other.m_preshared)), - config(std::move(other)) - { - } - + config_method(_Inout_ config_method &&other); /// /// Copies configuration @@ -260,18 +237,7 @@ namespace eap /// /// \returns Reference to this object /// - config_method& operator=(_In_ const config_method<_Tcred> &other) - { - if (this != &other) { - (config&)*this = other; - m_allow_save = other.m_allow_save; - m_anonymous_identity = other.m_anonymous_identity; - m_preshared.reset(other.m_preshared ? (credentials*)other.m_preshared->clone() : nullptr); - } - - return *this; - } - + config_method& operator=(_In_ const config_method &other); /// /// Moves configuration @@ -280,18 +246,7 @@ namespace eap /// /// \returns Reference to this object /// - config_method& operator=(_Inout_ config_method<_Tcred> &&other) - { - if (this != &other) { - (config&&)*this = std::move(other); - m_allow_save = std::move(other.m_allow_save); - m_anonymous_identity = std::move(other.m_anonymous_identity); - m_preshared = std::move(other.m_preshared); - } - - return *this; - } - + config_method& operator=(_Inout_ config_method &&other); /// \name XML configuration management /// @{ @@ -307,45 +262,7 @@ namespace eap /// - \c true if succeeded /// - \c false otherwise. See \p ppEapError for details. /// - virtual bool save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const - { - assert(pDoc); - assert(pConfigRoot); - assert(ppEapError); - - if (!config::save(pDoc, pConfigRoot, ppEapError)) - return false; - - const winstd::bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata"); - DWORD dwResult; - - // - winstd::com_obj pXmlElClientSideCredential; - if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), winstd::bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) { - *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); - return false; - } - - // / - if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"allow-save"), bstrNamespace, m_allow_save)) != ERROR_SUCCESS) { - *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); - return false; - } - - // / - if (!m_anonymous_identity.empty()) - if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"AnonymousIdentity"), bstrNamespace, winstd::bstr(m_anonymous_identity))) != ERROR_SUCCESS) { - *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); - return false; - } - - if (m_preshared) - if (!m_preshared->save(pDoc, pXmlElClientSideCredential, ppEapError)) - return false; - - return true; - } - + virtual bool save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const; /// /// Load configuration from XML document @@ -357,46 +274,7 @@ namespace eap /// - \c true if succeeded /// - \c false otherwise. See \p ppEapError for details. /// - virtual bool load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) - { - assert(pConfigRoot); - assert(ppEapError); - - if (!config::load(pConfigRoot, ppEapError)) - return false; - - m_allow_save = true; - m_preshared.reset(nullptr); - m_anonymous_identity.clear(); - - // - winstd::com_obj pXmlElClientSideCredential; - if (eapxml::select_element(pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), &pXmlElClientSideCredential) == ERROR_SUCCESS) { - std::wstring xpath(eapxml::get_xpath(pXmlElClientSideCredential)); - - // - eapxml::get_element_value(pXmlElClientSideCredential, winstd::bstr(L"eap-metadata:allow-save"), &m_allow_save); - m_module.log_config((xpath + L"/allow-save").c_str(), m_allow_save); - - // - eapxml::get_element_value(pXmlElClientSideCredential, winstd::bstr(L"eap-metadata:AnonymousIdentity"), m_anonymous_identity); - m_module.log_config((xpath + L"/AnonymousIdentity").c_str(), m_anonymous_identity.c_str()); - - std::unique_ptr preshared(make_credentials()); - assert(preshared); - if (preshared->load(pXmlElClientSideCredential, ppEapError)) { - m_preshared = std::move(preshared); - } else { - // This is not really an error - merely an indication pre-shared credentials are unavailable. - if (*ppEapError) { - m_module.free_error_memory(*ppEapError); - *ppEapError = NULL; - } - } - } - - return true; - } + virtual bool load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError); /// @} @@ -408,57 +286,21 @@ namespace eap /// /// \param[inout] cursor Memory cursor /// - virtual void pack(_Inout_ unsigned char *&cursor) const - { - eap::config::pack(cursor); - eapserial::pack(cursor, m_allow_save ); - eapserial::pack(cursor, m_anonymous_identity); - if (m_preshared) { - eapserial::pack(cursor, true); - m_preshared->pack(cursor); - } else - eapserial::pack(cursor, false); - } - + virtual void pack(_Inout_ unsigned char *&cursor) const; /// /// Returns packed size of a configuration /// /// \returns Size of data when packed (in bytes) /// - virtual size_t get_pk_size() const - { - return - eap::config::get_pk_size() + - eapserial::get_pk_size(m_allow_save ) + - eapserial::get_pk_size(m_anonymous_identity) + - (m_preshared ? - eapserial::get_pk_size(true) + - m_preshared->get_pk_size() : - eapserial::get_pk_size(false)); - } - + virtual size_t get_pk_size() const; /// /// Unpacks a configuration /// /// \param[inout] cursor Memory cursor /// - virtual void unpack(_Inout_ const unsigned char *&cursor) - { - eap::config::unpack(cursor); - eapserial::unpack(cursor, m_allow_save ); - eapserial::unpack(cursor, m_anonymous_identity); - - bool use_preshared; - eapserial::unpack(cursor, use_preshared); - if (use_preshared) { - m_preshared.reset(make_credentials()); - assert(m_preshared); - m_preshared->unpack(cursor); - } else - m_preshared.reset(nullptr); - } + virtual void unpack(_Inout_ const unsigned char *&cursor); /// @} diff --git a/lib/EAPBase/src/Config.cpp b/lib/EAPBase/src/Config.cpp index bc01642..e1cfbe0 100644 --- a/lib/EAPBase/src/Config.cpp +++ b/lib/EAPBase/src/Config.cpp @@ -97,3 +97,183 @@ void eap::config::unpack(_Inout_ const unsigned char *&cursor) { UNREFERENCED_PARAMETER(cursor); } + + +////////////////////////////////////////////////////////////////////// +// eap::config_method +////////////////////////////////////////////////////////////////////// + +eap::config_method::config_method(_In_ module &mod) : + m_allow_save(true), + config(mod) +{ +} + + +eap::config_method::config_method(_In_ const config_method &other) : + m_allow_save(other.m_allow_save), + m_anonymous_identity(other.m_anonymous_identity), + m_preshared(other.m_preshared ? (credentials*)other.m_preshared->clone() : nullptr), + config(other) +{ +} + + +eap::config_method::config_method(_Inout_ config_method &&other) : + m_allow_save(std::move(other.m_allow_save)), + m_anonymous_identity(std::move(other.m_anonymous_identity)), + m_preshared(std::move(other.m_preshared)), + config(std::move(other)) +{ +} + + +eap::config_method& eap::config_method::operator=(_In_ const config_method &other) +{ + if (this != &other) { + (config&)*this = other; + m_allow_save = other.m_allow_save; + m_anonymous_identity = other.m_anonymous_identity; + m_preshared.reset(other.m_preshared ? (credentials*)other.m_preshared->clone() : nullptr); + } + + return *this; +} + + +eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other) +{ + if (this != &other) { + (config&&)*this = std::move(other); + m_allow_save = std::move(other.m_allow_save); + m_anonymous_identity = std::move(other.m_anonymous_identity); + m_preshared = std::move(other.m_preshared); + } + + return *this; +} + + +bool eap::config_method::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const +{ + assert(pDoc); + assert(pConfigRoot); + assert(ppEapError); + + if (!config::save(pDoc, pConfigRoot, ppEapError)) + return false; + + const winstd::bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata"); + DWORD dwResult; + + // + winstd::com_obj pXmlElClientSideCredential; + if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), winstd::bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) { + *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); + return false; + } + + // / + if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"allow-save"), bstrNamespace, m_allow_save)) != ERROR_SUCCESS) { + *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); + return false; + } + + // / + if (!m_anonymous_identity.empty()) + if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"AnonymousIdentity"), bstrNamespace, winstd::bstr(m_anonymous_identity))) != ERROR_SUCCESS) { + *ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating element.")); + return false; + } + + if (m_preshared) + if (!m_preshared->save(pDoc, pXmlElClientSideCredential, ppEapError)) + return false; + + return true; +} + + +bool eap::config_method::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) +{ + assert(pConfigRoot); + assert(ppEapError); + + if (!config::load(pConfigRoot, ppEapError)) + return false; + + m_allow_save = true; + m_preshared.reset(nullptr); + m_anonymous_identity.clear(); + + // + winstd::com_obj pXmlElClientSideCredential; + if (eapxml::select_element(pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), &pXmlElClientSideCredential) == ERROR_SUCCESS) { + std::wstring xpath(eapxml::get_xpath(pXmlElClientSideCredential)); + + // + eapxml::get_element_value(pXmlElClientSideCredential, winstd::bstr(L"eap-metadata:allow-save"), &m_allow_save); + m_module.log_config((xpath + L"/allow-save").c_str(), m_allow_save); + + // + eapxml::get_element_value(pXmlElClientSideCredential, winstd::bstr(L"eap-metadata:AnonymousIdentity"), m_anonymous_identity); + m_module.log_config((xpath + L"/AnonymousIdentity").c_str(), m_anonymous_identity.c_str()); + + std::unique_ptr preshared(make_credentials()); + assert(preshared); + if (preshared->load(pXmlElClientSideCredential, ppEapError)) { + m_preshared = std::move(preshared); + } else { + // This is not really an error - merely an indication pre-shared credentials are unavailable. + if (*ppEapError) { + m_module.free_error_memory(*ppEapError); + *ppEapError = NULL; + } + } + } + + return true; +} + + +void eap::config_method::pack(_Inout_ unsigned char *&cursor) const +{ + eap::config::pack(cursor); + eapserial::pack(cursor, m_allow_save ); + eapserial::pack(cursor, m_anonymous_identity); + if (m_preshared) { + eapserial::pack(cursor, true); + m_preshared->pack(cursor); + } else + eapserial::pack(cursor, false); +} + + +size_t eap::config_method::get_pk_size() const +{ + return + eap::config::get_pk_size() + + eapserial::get_pk_size(m_allow_save ) + + eapserial::get_pk_size(m_anonymous_identity) + + (m_preshared ? + eapserial::get_pk_size(true) + + m_preshared->get_pk_size() : + eapserial::get_pk_size(false)); +} + + +void eap::config_method::unpack(_Inout_ const unsigned char *&cursor) +{ + eap::config::unpack(cursor); + eapserial::unpack(cursor, m_allow_save ); + eapserial::unpack(cursor, m_anonymous_identity); + + bool use_preshared; + eapserial::unpack(cursor, use_preshared); + if (use_preshared) { + m_preshared.reset(make_credentials()); + assert(m_preshared); + m_preshared->unpack(cursor); + } else + m_preshared.reset(nullptr); +} diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 71f3f34..6826aad 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -52,7 +52,7 @@ template class wxEAPCredentialsConfigPa /// /// Base template for all credential entry panels /// -template class wxEAPCredentialsPanelBase; +template class wxEAPCredentialsPanelBase; /// /// Generic password credential entry panel @@ -447,7 +447,7 @@ protected: wxEAPCredentialsDialog<_Tprov> dlg(m_prov, this); - _wxT *panel = new _wxT(m_prov, (typename _Tmeth::credentials_type&)*m_cred, m_target.c_str(), &dlg, true); + _wxT *panel = new _wxT(m_prov, *m_cred, m_target.c_str(), &dlg, true); dlg.AddContents((wxPanel**)&panel, 1); dlg.ShowModal(); @@ -469,7 +469,7 @@ protected: wxEAPCredentialsDialog<_Tprov> dlg(m_prov, this); - _wxT *panel = new _wxT(m_prov, (typename _Tmeth::credentials_type&)*m_cred, _T(""), &dlg, true); + _wxT *panel = new _wxT(m_prov, *m_cred, _T(""), &dlg, true); dlg.AddContents((wxPanel**)&panel, 1); dlg.ShowModal(); @@ -489,7 +489,7 @@ private: }; -template +template class wxEAPCredentialsPanelBase : public _Tbase { public: @@ -501,7 +501,7 @@ public: /// \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(_Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : + wxEAPCredentialsPanelBase(eap::credentials &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : m_cred(cred), m_target(pszCredTarget), _Tbase(parent) @@ -560,13 +560,13 @@ protected: /// \endcond protected: - _Tcred &m_cred; ///< Password credentials + eap::credentials &m_cred; ///< Generic credentials winstd::tstring m_target; ///< Credential Manager target }; template -class wxPasswordCredentialsPanel : public wxEAPCredentialsPanelBase +class wxPasswordCredentialsPanel : public wxEAPCredentialsPanelBase { public: /// @@ -578,8 +578,9 @@ public: /// \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(_Tprov &prov, eap::credentials_pass &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : - wxEAPCredentialsPanelBase(cred, pszCredTarget, parent, is_config) + wxPasswordCredentialsPanel(_Tprov &prov, eap::credentials &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : + m_cred((eap::credentials_pass&)cred), + wxEAPCredentialsPanelBase(cred, pszCredTarget, parent, is_config) { // Load and set icon. if (m_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE)) @@ -641,8 +642,9 @@ protected: /// \endcond protected: - winstd::library m_shell32; ///< shell32.dll resource library reference - wxIcon m_icon; ///< Panel icon + eap::credentials_pass &m_cred; ///< Password credentials + winstd::library m_shell32; ///< shell32.dll resource library reference + wxIcon m_icon; ///< Panel icon private: static const wxStringCharType *s_dummy_password; diff --git a/lib/PAP/include/Config.h b/lib/PAP/include/Config.h index 9c64f30..1672fb4 100644 --- a/lib/PAP/include/Config.h +++ b/lib/PAP/include/Config.h @@ -40,7 +40,7 @@ namespace eap namespace eap { - class config_method_pap : public config_method + class config_method_pap : public config_method { public: /// diff --git a/lib/PAP/src/Config.cpp b/lib/PAP/src/Config.cpp index 377280b..1faf345 100644 --- a/lib/PAP/src/Config.cpp +++ b/lib/PAP/src/Config.cpp @@ -25,19 +25,19 @@ // eap::config_method_pap ////////////////////////////////////////////////////////////////////// -eap::config_method_pap::config_method_pap(_In_ module &mod) : config_method(mod) +eap::config_method_pap::config_method_pap(_In_ module &mod) : config_method(mod) { } eap::config_method_pap::config_method_pap(_In_ const config_method_pap &other) : - config_method(other) + config_method(other) { } eap::config_method_pap::config_method_pap(_Inout_ config_method_pap &&other) : - config_method(std::move(other)) + config_method(std::move(other)) { } @@ -45,7 +45,7 @@ eap::config_method_pap::config_method_pap(_Inout_ config_method_pap &&other) : eap::config_method_pap& eap::config_method_pap::operator=(_In_ const config_method_pap &other) { if (this != &other) - (config_method&)*this = other; + (config_method&)*this = other; return *this; } @@ -54,7 +54,7 @@ eap::config_method_pap& eap::config_method_pap::operator=(_In_ const config_meth eap::config_method_pap& eap::config_method_pap::operator=(_Inout_ config_method_pap &&other) { if (this != &other) - (config_method&&)*this = std::move(other); + (config_method&&)*this = std::move(other); return *this; } diff --git a/lib/TLS/include/Config.h b/lib/TLS/include/Config.h index 39f26dc..1172a45 100644 --- a/lib/TLS/include/Config.h +++ b/lib/TLS/include/Config.h @@ -54,7 +54,7 @@ namespace eap namespace eap { - class config_method_tls : public config_method + class config_method_tls : public config_method { public: /// diff --git a/lib/TLS/src/Config.cpp b/lib/TLS/src/Config.cpp index 6c82fe6..c001d35 100644 --- a/lib/TLS/src/Config.cpp +++ b/lib/TLS/src/Config.cpp @@ -66,7 +66,7 @@ tstring eap::get_cert_title(PCCERT_CONTEXT cert) // eap::config_method_tls ////////////////////////////////////////////////////////////////////// -eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method(mod) +eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method(mod) { } @@ -74,7 +74,7 @@ eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method(other) + config_method(other) { } @@ -82,7 +82,7 @@ eap::config_method_tls::config_method_tls(_In_ const config_method_tls &other) : eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) : m_trusted_root_ca(std::move(other.m_trusted_root_ca)), m_server_names(std::move(other.m_server_names)), - config_method(std::move(other)) + config_method(std::move(other)) { } @@ -90,7 +90,7 @@ eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) : eap::config_method_tls& eap::config_method_tls::operator=(_In_ const eap::config_method_tls &other) { if (this != &other) { - (config_method&)*this = other; + (config_method&)*this = other; m_trusted_root_ca = other.m_trusted_root_ca; m_server_names = other.m_server_names; } @@ -102,7 +102,7 @@ eap::config_method_tls& eap::config_method_tls::operator=(_In_ const eap::config eap::config_method_tls& eap::config_method_tls::operator=(_Inout_ eap::config_method_tls &&other) { if (this != &other) { - (config_method&&)*this = std::move(other); + (config_method&&)*this = std::move(other); m_trusted_root_ca = std::move(other.m_trusted_root_ca); m_server_names = std::move(other.m_server_names); } @@ -123,7 +123,7 @@ bool eap::config_method_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode * assert(pConfigRoot); assert(ppEapError); - if (!config_method::save(pDoc, pConfigRoot, ppEapError)) + if (!config_method::save(pDoc, pConfigRoot, ppEapError)) return false; const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata"); @@ -182,7 +182,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR { assert(pConfigRoot); - if (!config_method::load(pConfigRoot, ppEapError)) + if (!config_method::load(pConfigRoot, ppEapError)) return false; std::wstring xpath(eapxml::get_xpath(pConfigRoot)); @@ -258,7 +258,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR void eap::config_method_tls::pack(_Inout_ unsigned char *&cursor) const { - eap::config_method::pack(cursor); + eap::config_method::pack(cursor); eapserial::pack(cursor, m_trusted_root_ca); eapserial::pack(cursor, m_server_names ); } @@ -267,7 +267,7 @@ void eap::config_method_tls::pack(_Inout_ unsigned char *&cursor) const size_t eap::config_method_tls::get_pk_size() const { return - eap::config_method::get_pk_size() + + eap::config_method::get_pk_size() + eapserial::get_pk_size(m_trusted_root_ca) + eapserial::get_pk_size(m_server_names ); } @@ -275,7 +275,7 @@ size_t eap::config_method_tls::get_pk_size() const void eap::config_method_tls::unpack(_Inout_ const unsigned char *&cursor) { - eap::config_method::unpack(cursor); + eap::config_method::unpack(cursor); eapserial::unpack(cursor, m_trusted_root_ca); eapserial::unpack(cursor, m_server_names ); } diff --git a/lib/TLS_UI/include/TLS_UI.h b/lib/TLS_UI/include/TLS_UI.h index 7abf95b..59aef37 100644 --- a/lib/TLS_UI/include/TLS_UI.h +++ b/lib/TLS_UI/include/TLS_UI.h @@ -249,14 +249,15 @@ protected: template -class wxTLSCredentialsPanel : public wxEAPCredentialsPanelBase +class wxTLSCredentialsPanel : public wxEAPCredentialsPanelBase { public: /// /// Constructs a configuration panel /// - wxTLSCredentialsPanel(_Tprov &prov, eap::credentials_tls &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : - wxEAPCredentialsPanelBase(cred, pszCredTarget, parent, is_config) + wxTLSCredentialsPanel(_Tprov &prov, eap::credentials &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) : + m_cred((eap::credentials_tls&)cred), + wxEAPCredentialsPanelBase(cred, pszCredTarget, parent, is_config) { UNREFERENCED_PARAMETER(prov); @@ -339,8 +340,9 @@ protected: /// \endcond protected: - winstd::library m_shell32; ///< shell32.dll resource library reference - wxIcon m_icon; ///< Panel icon + eap::credentials_tls &m_cred; ///< TLS credentials + winstd::library m_shell32; ///< shell32.dll resource library reference + wxIcon m_icon; ///< Panel icon }; diff --git a/lib/TTLS_UI/include/TTLS_UI.h b/lib/TTLS_UI/include/TTLS_UI.h index e5417e2..3e39b40 100644 --- a/lib/TTLS_UI/include/TTLS_UI.h +++ b/lib/TTLS_UI/include/TTLS_UI.h @@ -261,13 +261,13 @@ protected: /// \endcond protected: - _Tprov &m_prov; ///< EAP provider - eap::config_method_ttls &m_cfg; ///< TTLS configuration - wxStaticText *m_outer_title; ///< Outer authentication title + _Tprov &m_prov; ///< EAP provider + eap::config_method_ttls &m_cfg; ///< TTLS configuration + wxStaticText *m_outer_title; ///< Outer authentication title wxTTLSConfigPanel<_Tprov> *m_outer_identity; ///< Outer identity configuration panel wxTLSConfigPanel<_Tprov> *m_tls; ///< TLS configuration panel - wxStaticText *m_inner_title; ///< Inner authentication title - wxChoicebook *m_inner_type; ///< Inner authentication type + wxStaticText *m_inner_title; ///< Inner authentication title + wxChoicebook *m_inner_type; ///< Inner authentication type - eap::config_method_pap m_cfg_pap; ///< Temporary PAP configuration + eap::config_method_pap m_cfg_pap; ///< Temporary PAP configuration };