diff --git a/lib/TTLS/include/Config.h b/lib/TTLS/include/Config.h index 7bdb0ce..08220ff 100644 --- a/lib/TTLS/include/Config.h +++ b/lib/TTLS/include/Config.h @@ -157,14 +157,14 @@ namespace eap { /// /// \param[in] eap_type EAP type /// - config_method_with_cred* make_config_method(_In_ winstd::eap_type_t eap_type) const; + config_method* make_config_method(_In_ winstd::eap_type_t eap_type) const; /// /// Makes a new inner method config /// /// \param[in] eap_type EAP type /// - config_method_with_cred* make_config_method(_In_ const wchar_t *eap_type) const; + config_method* make_config_method(_In_ const wchar_t *eap_type) const; /// /// Generates public identity using current configuration and given credentials diff --git a/lib/TTLS/src/Config.cpp b/lib/TTLS/src/Config.cpp index cbe622f..ec8b97c 100644 --- a/lib/TTLS/src/Config.cpp +++ b/lib/TTLS/src/Config.cpp @@ -263,24 +263,21 @@ eap::credentials* eap::config_method_ttls::make_credentials() const } -eap::config_method_with_cred* eap::config_method_ttls::make_config_method(_In_ winstd::eap_type_t eap_type) const +eap::config_method* eap::config_method_ttls::make_config_method(_In_ winstd::eap_type_t eap_type) const { switch (eap_type) { - case eap_type_tls : return new config_method_tls (m_module, m_level + 1); - case eap_type_ttls : return new config_method_ttls (m_module, m_level + 1); case eap_type_legacy_pap : return new config_method_pap (m_module, m_level + 1); case eap_type_legacy_mschapv2: return new config_method_mschapv2(m_module, m_level + 1); - default : throw invalid_argument(__FUNCTION__ " Unsupported inner authentication method."); + default : return new config_method_eapmsg (m_module, m_level + 1); // EAPMsg handles all other method types } } -eap::config_method_with_cred* eap::config_method_ttls::make_config_method(_In_ const wchar_t *eap_type) const +eap::config_method* eap::config_method_ttls::make_config_method(_In_ const wchar_t *eap_type) const { - if (_wcsicmp(eap_type, L"EAP-TLS" ) == 0) return new config_method_tls (m_module, m_level + 1); - else if (_wcsicmp(eap_type, L"EAP-TTLS") == 0) return new config_method_ttls (m_module, m_level + 1); - else if (_wcsicmp(eap_type, L"PAP" ) == 0) return new config_method_pap (m_module, m_level + 1); + if (_wcsicmp(eap_type, L"PAP" ) == 0) return new config_method_pap (m_module, m_level + 1); else if (_wcsicmp(eap_type, L"MSCHAPv2") == 0) return new config_method_mschapv2(m_module, m_level + 1); + else if (_wcsicmp(eap_type, L"EAPMsg" ) == 0) return new config_method_eapmsg (m_module, m_level + 1); else throw invalid_argument(__FUNCTION__ " Unsupported inner authentication method."); }