EAP_INNER_EAPHOST is now 0/1 #defined

This commit is contained in:
2017-02-02 13:45:45 +01:00
parent 6f049d2692
commit 5b79f5d849
14 changed files with 58 additions and 16 deletions

View File

@@ -269,7 +269,7 @@ eap::config_method* eap::config_method_ttls::make_config_method(_In_ winstd::eap
case eap_type_legacy_mschapv2: return new config_method_mschapv2 (m_module, m_level + 1);
case eap_type_mschapv2 : return new config_method_eapmschapv2(m_module, m_level + 1);
case eap_type_gtc : return new config_method_eapgtc (m_module, m_level + 1);
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
default : return new config_method_eaphost (m_module, m_level + 1); // EapHost peer method handles all other method types
#else
default : throw invalid_argument(string_printf(__FUNCTION__ " Unsupported inner authentication method (%d).", eap_type));
@@ -284,7 +284,7 @@ eap::config_method* eap::config_method_ttls::make_config_method(_In_ const wchar
else if (_wcsicmp(eap_type, L"MSCHAPv2" ) == 0) return new config_method_mschapv2 (m_module, m_level + 1);
else if (_wcsicmp(eap_type, L"EAP-MSCHAPv2") == 0) return new config_method_eapmschapv2(m_module, m_level + 1);
else if (_wcsicmp(eap_type, L"EAP-GTC" ) == 0) return new config_method_eapgtc (m_module, m_level + 1);
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
else if (_wcsicmp(eap_type, L"EapHost" ) == 0) return new config_method_eaphost (m_module, m_level + 1);
#endif
else throw invalid_argument(string_printf(__FUNCTION__ " Unsupported inner authentication method (%ls).", eap_type));

View File

@@ -53,7 +53,7 @@ void eap::peer_ttls::initialize()
MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featEAPTTLS"));
#endif
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
// Initialize EapHost based inner authentication methods.
DWORD dwResult = EapHostPeerInitialize();
if (dwResult != ERROR_SUCCESS)
@@ -73,7 +73,7 @@ void eap::peer_ttls::shutdown()
}
WaitForMultipleObjects((DWORD)chks.size(), chks.data(), TRUE, 10000);
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
// Uninitialize EapHost. It was initialized for EapHost based inner authentication methods.
EapHostPeerUninitialize();
#endif
@@ -243,7 +243,7 @@ EAP_SESSION_HANDLE eap::peer_ttls::begin_session(
unique_ptr<method> meth_inner;
auto cfg_inner = cfg_method->m_inner.get();
auto cred_inner = dynamic_cast<credentials_ttls*>(s->m_cred.m_cred.get())->m_inner.get();
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
auto cfg_inner_eaphost = dynamic_cast<config_method_eaphost*>(cfg_inner);
if (!cfg_inner_eaphost)
#endif
@@ -263,7 +263,7 @@ EAP_SESSION_HANDLE eap::peer_ttls::begin_session(
default: throw invalid_argument(__FUNCTION__ " Unsupported inner authentication method.");
}
}
#ifdef EAP_INNER_EAPHOST
#if EAP_INNER_EAPHOST
else {
// EapHost inner method
meth_inner.reset(

View File

@@ -20,6 +20,8 @@
#pragma once
#include "../include/TTLS.h"
#include "../include/Config.h"
#include "../include/Credentials.h"
#include "../include/Method.h"