m_module is now a pointer instead of reference
This commit is contained in:
parent
a9ecde86d9
commit
460adb9858
@ -40,7 +40,7 @@ static int CredWrite()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
eap::credentials_pap cred(g_module);
|
eap::credentials_pap cred(&g_module);
|
||||||
|
|
||||||
// Prepare identity (user name).
|
// Prepare identity (user name).
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ static int CredWrite()
|
|||||||
EAP_ERROR *pEapError = NULL;
|
EAP_ERROR *pEapError = NULL;
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
{
|
{
|
||||||
eap::credentials_pap cred_stored(g_module);
|
eap::credentials_pap cred_stored(&g_module);
|
||||||
if (!cred_stored.retrieve(target_name.c_str(), &pEapError)) {
|
if (!cred_stored.retrieve(target_name.c_str(), &pEapError)) {
|
||||||
if (pEapError) {
|
if (pEapError) {
|
||||||
OutputDebugStr(_T("%ls (error %u)\n"), pEapError->pRootCauseString, pEapError->dwWinError);
|
OutputDebugStr(_T("%ls (error %u)\n"), pEapError->pRootCauseString, pEapError->dwWinError);
|
||||||
|
@ -237,8 +237,8 @@ DWORD APIENTRY EapPeerGetIdentity(
|
|||||||
else if (!ppwszIdentity)
|
else if (!ppwszIdentity)
|
||||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
|
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
|
||||||
else {
|
else {
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
_EAPMETHOD_PEER::credentials_type cred_in(g_peer), cred_out(g_peer);
|
_EAPMETHOD_PEER::credentials_type cred_in(&g_peer), cred_out(&g_peer);
|
||||||
if ( !g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) ||
|
if ( !g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) ||
|
||||||
dwUserDataSize && !g_peer.unpack(cred_in, pUserData, dwUserDataSize, ppEapError) ||
|
dwUserDataSize && !g_peer.unpack(cred_in, pUserData, dwUserDataSize, ppEapError) ||
|
||||||
!g_peer.get_identity(dwFlags, cfg, dwUserDataSize ? &cred_in : NULL, cred_out, hTokenImpersonateUser, pfInvokeUI, ppwszIdentity, ppEapError) ||
|
!g_peer.get_identity(dwFlags, cfg, dwUserDataSize ? &cred_in : NULL, cred_out, hTokenImpersonateUser, pfInvokeUI, ppwszIdentity, ppEapError) ||
|
||||||
@ -295,7 +295,7 @@ DWORD APIENTRY EapPeerBeginSession(
|
|||||||
*phSession = NULL;
|
*phSession = NULL;
|
||||||
|
|
||||||
// Allocate new session.
|
// Allocate new session.
|
||||||
unique_ptr<_EAPMETHOD_SESSION> session(new _EAPMETHOD_SESSION(g_peer));
|
unique_ptr<_EAPMETHOD_SESSION> session(new _EAPMETHOD_SESSION(&g_peer));
|
||||||
if (!session) {
|
if (!session) {
|
||||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, _T(__FUNCTION__) _T(" Error allocating memory for EAP session.")));
|
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_OUTOFMEMORY, _T(__FUNCTION__) _T(" Error allocating memory for EAP session.")));
|
||||||
return dwResult;
|
return dwResult;
|
||||||
@ -686,8 +686,8 @@ DWORD WINAPI EapPeerGetMethodProperties(
|
|||||||
else if (!pMethodPropertyArray)
|
else if (!pMethodPropertyArray)
|
||||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pMethodPropertyArray is NULL.")));
|
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pMethodPropertyArray is NULL.")));
|
||||||
else {
|
else {
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
_EAPMETHOD_PEER::credentials_type cred(g_peer);
|
_EAPMETHOD_PEER::credentials_type cred(&g_peer);
|
||||||
if (!g_peer.unpack(cfg, pEapConnData, dwEapConnDataSize, ppEapError) ||
|
if (!g_peer.unpack(cfg, pEapConnData, dwEapConnDataSize, ppEapError) ||
|
||||||
!g_peer.unpack(cred, pUserData, dwUserDataSize, ppEapError) ||
|
!g_peer.unpack(cred, pUserData, dwUserDataSize, ppEapError) ||
|
||||||
!g_peer.get_method_properties(
|
!g_peer.get_method_properties(
|
||||||
@ -764,7 +764,7 @@ DWORD WINAPI EapPeerCredentialsXml2Blob(
|
|||||||
|
|
||||||
// Load credentials.
|
// Load credentials.
|
||||||
pCredentialsDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
pCredentialsDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
||||||
_EAPMETHOD_PEER::credentials_type cred(g_peer);
|
_EAPMETHOD_PEER::credentials_type cred(&g_peer);
|
||||||
if (!cred.load(pXmlElCredentials, ppEapError) ||
|
if (!cred.load(pXmlElCredentials, ppEapError) ||
|
||||||
!g_peer.pack(cred, ppCredentialsOut, pdwCredentialsOutSize, ppEapError))
|
!g_peer.pack(cred, ppCredentialsOut, pdwCredentialsOutSize, ppEapError))
|
||||||
{
|
{
|
||||||
|
@ -142,7 +142,7 @@ DWORD WINAPI EapPeerConfigXml2Blob(
|
|||||||
|
|
||||||
// Load configuration.
|
// Load configuration.
|
||||||
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\""));
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
if (!cfg.load(pXmlElConfig, ppEapError) ||
|
if (!cfg.load(pXmlElConfig, ppEapError) ||
|
||||||
!g_peer.pack(cfg, ppConfigOut, pdwConfigOutSize, ppEapError))
|
!g_peer.pack(cfg, ppConfigOut, pdwConfigOutSize, ppEapError))
|
||||||
{
|
{
|
||||||
@ -198,7 +198,7 @@ DWORD WINAPI EapPeerConfigBlob2Xml(
|
|||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
// Unpack configuration.
|
// Unpack configuration.
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
if (!g_peer.unpack(cfg, pConfigIn, dwConfigInSize, ppEapError)) {
|
if (!g_peer.unpack(cfg, pConfigIn, dwConfigInSize, ppEapError)) {
|
||||||
if (*ppEapError) {
|
if (*ppEapError) {
|
||||||
g_peer.log_error(*ppEapError);
|
g_peer.log_error(*ppEapError);
|
||||||
@ -294,7 +294,7 @@ DWORD WINAPI EapPeerInvokeConfigUI(
|
|||||||
else if (!ppConnectionDataOut)
|
else if (!ppConnectionDataOut)
|
||||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL.")));
|
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppConnectionDataOut is NULL.")));
|
||||||
else {
|
else {
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
if (dwConnectionDataInSize && !g_peer.unpack(cfg, pConnectionDataIn, dwConnectionDataInSize, ppEapError) ||
|
if (dwConnectionDataInSize && !g_peer.unpack(cfg, pConnectionDataIn, dwConnectionDataInSize, ppEapError) ||
|
||||||
!g_peer.invoke_config_ui(hwndParent, cfg, ppEapError) ||
|
!g_peer.invoke_config_ui(hwndParent, cfg, ppEapError) ||
|
||||||
!g_peer.pack(cfg, ppConnectionDataOut, pdwConnectionDataOutSize, ppEapError))
|
!g_peer.pack(cfg, ppConnectionDataOut, pdwConnectionDataOutSize, ppEapError))
|
||||||
@ -359,8 +359,8 @@ DWORD WINAPI EapPeerInvokeIdentityUI(
|
|||||||
else if (!ppwszIdentity)
|
else if (!ppwszIdentity)
|
||||||
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
|
g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" ppwszIdentity is NULL.")));
|
||||||
else {
|
else {
|
||||||
eap::config_providers cfg(g_peer);
|
eap::config_providers cfg(&g_peer);
|
||||||
_EAPMETHOD_PEER_UI::credentials_type cred(g_peer);
|
_EAPMETHOD_PEER_UI::credentials_type cred(&g_peer);
|
||||||
if ( !g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) ||
|
if ( !g_peer.unpack(cfg, pConnectionData, dwConnectionDataSize, ppEapError) ||
|
||||||
dwUserDataSize && !g_peer.unpack(cred, pUserData, dwUserDataSize, ppEapError) ||
|
dwUserDataSize && !g_peer.unpack(cred, pUserData, dwUserDataSize, ppEapError) ||
|
||||||
!g_peer.invoke_identity_ui(hwndParent, dwFlags, cfg, cred, ppwszIdentity, ppEapError) ||
|
!g_peer.invoke_identity_ui(hwndParent, dwFlags, cfg, cred, ppwszIdentity, ppEapError) ||
|
||||||
|
@ -102,9 +102,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config(_In_ module &mod);
|
config(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
@ -202,7 +202,7 @@ namespace eap
|
|||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
module &m_module; ///< Reference of the EAP module
|
module *m_module; ///< EAP module
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -212,9 +212,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_method(_In_ module &mod);
|
config_method(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
@ -264,9 +264,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_method_with_cred(_In_ module &mod) :
|
config_method_with_cred(_In_ module *mod) :
|
||||||
m_allow_save(true),
|
m_allow_save(true),
|
||||||
m_use_preshared(false),
|
m_use_preshared(false),
|
||||||
m_preshared(mod),
|
m_preshared(mod),
|
||||||
@ -369,13 +369,13 @@ namespace eap
|
|||||||
// <ClientSideCredential>
|
// <ClientSideCredential>
|
||||||
winstd::com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
winstd::com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, winstd::bstr(L"eap-metadata:ClientSideCredential"), winstd::bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) {
|
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 <ClientSideCredential> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ClientSideCredential> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ClientSideCredential>/<allow-save>
|
// <ClientSideCredential>/<allow-save>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, winstd::bstr(L"allow-save"), bstrNamespace, m_allow_save)) != ERROR_SUCCESS) {
|
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 <allow-save> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <allow-save> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ namespace eap
|
|||||||
|
|
||||||
// <allow-save>
|
// <allow-save>
|
||||||
eapxml::get_element_value(pXmlElClientSideCredential, winstd::bstr(L"eap-metadata:allow-save"), &m_allow_save);
|
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);
|
m_module->log_config((xpath + L"/allow-save").c_str(), m_allow_save);
|
||||||
|
|
||||||
_Tcred preshared(m_module);
|
_Tcred preshared(m_module);
|
||||||
if (preshared.load(pXmlElClientSideCredential, ppEapError)) {
|
if (preshared.load(pXmlElClientSideCredential, ppEapError)) {
|
||||||
@ -420,7 +420,7 @@ namespace eap
|
|||||||
} else {
|
} else {
|
||||||
// This is not really an error - merely an indication pre-shared credentials are unavailable.
|
// This is not really an error - merely an indication pre-shared credentials are unavailable.
|
||||||
if (*ppEapError) {
|
if (*ppEapError) {
|
||||||
m_module.free_error_memory(*ppEapError);
|
m_module->free_error_memory(*ppEapError);
|
||||||
*ppEapError = NULL;
|
*ppEapError = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,9 +491,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_provider(_In_ module &mod);
|
config_provider(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
@ -610,9 +610,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_providers(_In_ module &mod);
|
config_providers(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
|
@ -58,9 +58,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs credentials
|
/// Constructs credentials
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
credentials(_In_ module &mod);
|
credentials(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies credentials
|
/// Copies credentials
|
||||||
@ -203,9 +203,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs credentials
|
/// Constructs credentials
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
credentials_pass(_In_ module &mod);
|
credentials_pass(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies credentials
|
/// Copies credentials
|
||||||
|
@ -692,7 +692,7 @@ namespace eap
|
|||||||
///
|
///
|
||||||
virtual config_method* make_config_method()
|
virtual config_method* make_config_method()
|
||||||
{
|
{
|
||||||
return new config_method_type(*this);
|
return new config_method_type(this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs a session
|
/// Constructs a session
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
session(_In_ module &mod) :
|
session(_In_ module *mod) :
|
||||||
m_module(mod),
|
m_module(mod),
|
||||||
m_cfg(mod),
|
m_cfg(mod),
|
||||||
m_cred(mod),
|
m_cred(mod),
|
||||||
@ -299,7 +299,7 @@ namespace eap
|
|||||||
UNREFERENCED_PARAMETER(pEapOutput);
|
UNREFERENCED_PARAMETER(pEapOutput);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ namespace eap
|
|||||||
UNREFERENCED_PARAMETER(pAttribs);
|
UNREFERENCED_PARAMETER(pAttribs);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,14 +342,14 @@ namespace eap
|
|||||||
UNREFERENCED_PARAMETER(pEapOutput);
|
UNREFERENCED_PARAMETER(pEapOutput);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
module &m_module; ///< Reference of the EAP module
|
module *m_module; ///< EAP module
|
||||||
config_providers m_cfg; ///< Providers configuration
|
config_providers m_cfg; ///< Providers configuration
|
||||||
credentials_type m_cred; ///< User credentials
|
credentials_type m_cred; ///< User credentials
|
||||||
interactive_request_type m_intreq; ///< Interactive UI request data
|
interactive_request_type m_intreq; ///< Interactive UI request data
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::config
|
// eap::config
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config::config(_In_ module &mod) :
|
eap::config::config(_In_ module *mod) :
|
||||||
m_module(mod)
|
m_module(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -41,23 +41,25 @@ eap::config::config(_In_ const config &other) :
|
|||||||
|
|
||||||
|
|
||||||
eap::config::config(_Inout_ config &&other) :
|
eap::config::config(_Inout_ config &&other) :
|
||||||
m_module(other.m_module)
|
m_module(std::move(other.m_module))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eap::config& eap::config::operator=(_In_ const config &other)
|
eap::config& eap::config::operator=(_In_ const config &other)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(other);
|
if (this != &other)
|
||||||
assert(&m_module == &other.m_module); // Copy configuration within same module only!
|
m_module = other.m_module;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eap::config& eap::config::operator=(_Inout_ config &&other)
|
eap::config& eap::config::operator=(_Inout_ config &&other)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(other);
|
if (this != &other)
|
||||||
assert(&m_module == &other.m_module); // Move configuration within same module only!
|
m_module = std::move(other.m_module);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +105,7 @@ void eap::config::operator>>(_Inout_ cursor_in &cursor)
|
|||||||
// eap::config_method
|
// eap::config_method
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_method::config_method(_In_ module &mod) : config(mod)
|
eap::config_method::config_method(_In_ module *mod) : config(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +142,7 @@ eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other)
|
|||||||
// eap::config_provider
|
// eap::config_provider
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_provider::config_provider(_In_ module &mod) :
|
eap::config_provider::config_provider(_In_ module *mod) :
|
||||||
m_read_only(false),
|
m_read_only(false),
|
||||||
config(mod)
|
config(mod)
|
||||||
{
|
{
|
||||||
@ -240,84 +242,84 @@ bool eap::config_provider::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC
|
|||||||
|
|
||||||
// <read-only>
|
// <read-only>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"read-only"), bstrNamespace, m_read_only)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"read-only"), bstrNamespace, m_read_only)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <read-only> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <read-only> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ID>
|
// <ID>
|
||||||
if (!m_id.empty())
|
if (!m_id.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"ID"), bstrNamespace, bstr(m_id))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"ID"), bstrNamespace, bstr(m_id))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ID> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ID> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>
|
// <ProviderInfo>
|
||||||
com_obj<IXMLDOMElement> pXmlElProviderInfo;
|
com_obj<IXMLDOMElement> pXmlElProviderInfo;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), bstr(L"ProviderInfo"), bstrNamespace, &pXmlElProviderInfo)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), bstr(L"ProviderInfo"), bstrNamespace, &pXmlElProviderInfo)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ProviderInfo> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ProviderInfo> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<DisplayName>
|
// <ProviderInfo>/<DisplayName>
|
||||||
if (!m_name.empty())
|
if (!m_name.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"DisplayName"), bstrNamespace, bstr(m_name))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"DisplayName"), bstrNamespace, bstr(m_name))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <DisplayName> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <DisplayName> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<Helpdesk>
|
// <ProviderInfo>/<Helpdesk>
|
||||||
com_obj<IXMLDOMElement> pXmlElHelpdesk;
|
com_obj<IXMLDOMElement> pXmlElHelpdesk;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), bstr(L"Helpdesk"), bstrNamespace, &pXmlElHelpdesk)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), bstr(L"Helpdesk"), bstrNamespace, &pXmlElHelpdesk)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Helpdesk> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Helpdesk> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<Helpdesk>/<EmailAddress>
|
// <ProviderInfo>/<Helpdesk>/<EmailAddress>
|
||||||
if (!m_help_email.empty())
|
if (!m_help_email.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"EmailAddress"), bstrNamespace, bstr(m_help_email))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"EmailAddress"), bstrNamespace, bstr(m_help_email))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <EmailAddress> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <EmailAddress> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<Helpdesk>/<WebAddress>
|
// <ProviderInfo>/<Helpdesk>/<WebAddress>
|
||||||
if (!m_help_web.empty())
|
if (!m_help_web.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"WebAddress"), bstrNamespace, bstr(m_help_web))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"WebAddress"), bstrNamespace, bstr(m_help_web))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <WebAddress> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <WebAddress> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<Helpdesk>/<Phone>
|
// <ProviderInfo>/<Helpdesk>/<Phone>
|
||||||
if (!m_help_phone.empty())
|
if (!m_help_phone.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"Phone"), bstrNamespace, bstr(m_help_phone))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElHelpdesk, bstr(L"Phone"), bstrNamespace, bstr(m_help_phone))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Phone> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Phone> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<CredentialPrompt>
|
// <ProviderInfo>/<CredentialPrompt>
|
||||||
if (!m_lbl_alt_credential.empty())
|
if (!m_lbl_alt_credential.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"CredentialPrompt"), bstrNamespace, bstr(m_lbl_alt_credential))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"CredentialPrompt"), bstrNamespace, bstr(m_lbl_alt_credential))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <CredentialPrompt> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <CredentialPrompt> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<UserNameLabel>
|
// <ProviderInfo>/<UserNameLabel>
|
||||||
if (!m_lbl_alt_identity.empty())
|
if (!m_lbl_alt_identity.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"UserNameLabel"), bstrNamespace, bstr(m_lbl_alt_identity))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"UserNameLabel"), bstrNamespace, bstr(m_lbl_alt_identity))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <UserNameLabel> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <UserNameLabel> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ProviderInfo>/<PasswordLabel>
|
// <ProviderInfo>/<PasswordLabel>
|
||||||
if (!m_lbl_alt_password.empty())
|
if (!m_lbl_alt_password.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"PasswordLabel"), bstrNamespace, bstr(m_lbl_alt_password))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElProviderInfo, bstr(L"PasswordLabel"), bstrNamespace, bstr(m_lbl_alt_password))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <PasswordLabel> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <PasswordLabel> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <AuthenticationMethods>
|
// <AuthenticationMethods>
|
||||||
com_obj<IXMLDOMElement> pXmlElAuthenticationMethods;
|
com_obj<IXMLDOMElement> pXmlElAuthenticationMethods;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods"), bstr(L"AuthenticationMethods"), bstrNamespace, &pXmlElAuthenticationMethods)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods"), bstr(L"AuthenticationMethods"), bstrNamespace, &pXmlElAuthenticationMethods)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AuthenticationMethods> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AuthenticationMethods> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +327,7 @@ bool eap::config_provider::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC
|
|||||||
// <AuthenticationMethod>
|
// <AuthenticationMethod>
|
||||||
com_obj<IXMLDOMElement> pXmlElAuthenticationMethod;
|
com_obj<IXMLDOMElement> pXmlElAuthenticationMethod;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, bstr(L"AuthenticationMethod"), bstrNamespace, &pXmlElAuthenticationMethod))) {
|
if ((dwResult = eapxml::create_element(pDoc, bstr(L"AuthenticationMethod"), bstrNamespace, &pXmlElAuthenticationMethod))) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AuthenticationMethod> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AuthenticationMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +336,7 @@ bool eap::config_provider::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (FAILED(hr = pXmlElAuthenticationMethods->appendChild(pXmlElAuthenticationMethod, NULL))) {
|
if (FAILED(hr = pXmlElAuthenticationMethods->appendChild(pXmlElAuthenticationMethod, NULL))) {
|
||||||
*ppEapError = m_module.make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <AuthenticationMethod> element."));
|
*ppEapError = m_module->make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <AuthenticationMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -356,12 +358,12 @@ bool eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
// <read-only>
|
// <read-only>
|
||||||
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:read-only"), &m_read_only)) != ERROR_SUCCESS)
|
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:read-only"), &m_read_only)) != ERROR_SUCCESS)
|
||||||
m_read_only = true;
|
m_read_only = true;
|
||||||
m_module.log_config((xpath + L"/read-only").c_str(), m_read_only);
|
m_module->log_config((xpath + L"/read-only").c_str(), m_read_only);
|
||||||
|
|
||||||
// <ID>
|
// <ID>
|
||||||
m_id.clear();
|
m_id.clear();
|
||||||
eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:ID"), m_id);
|
eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:ID"), m_id);
|
||||||
m_module.log_config((xpath + L"/ID").c_str(), m_id.c_str());
|
m_module->log_config((xpath + L"/ID").c_str(), m_id.c_str());
|
||||||
|
|
||||||
// <ProviderInfo>
|
// <ProviderInfo>
|
||||||
m_name.clear();
|
m_name.clear();
|
||||||
@ -374,12 +376,12 @@ bool eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
com_obj<IXMLDOMElement> pXmlElProviderInfo;
|
com_obj<IXMLDOMElement> pXmlElProviderInfo;
|
||||||
if (eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), &pXmlElProviderInfo) == ERROR_SUCCESS) {
|
if (eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ProviderInfo"), &pXmlElProviderInfo) == ERROR_SUCCESS) {
|
||||||
wstring lang;
|
wstring lang;
|
||||||
LoadString(m_module.m_instance, 2, lang);
|
LoadString(m_module->m_instance, 2, lang);
|
||||||
wstring xpathProviderInfo(xpath + L"/ProviderInfo");
|
wstring xpathProviderInfo(xpath + L"/ProviderInfo");
|
||||||
|
|
||||||
// <DisplayName>
|
// <DisplayName>
|
||||||
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:DisplayName"), lang.c_str(), m_name);
|
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:DisplayName"), lang.c_str(), m_name);
|
||||||
m_module.log_config((xpathProviderInfo + L"/DisplayName").c_str(), m_name.c_str());
|
m_module->log_config((xpathProviderInfo + L"/DisplayName").c_str(), m_name.c_str());
|
||||||
|
|
||||||
com_obj<IXMLDOMElement> pXmlElHelpdesk;
|
com_obj<IXMLDOMElement> pXmlElHelpdesk;
|
||||||
if (eapxml::select_element(pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), &pXmlElHelpdesk) == ERROR_SUCCESS) {
|
if (eapxml::select_element(pXmlElProviderInfo, bstr(L"eap-metadata:Helpdesk"), &pXmlElHelpdesk) == ERROR_SUCCESS) {
|
||||||
@ -387,35 +389,35 @@ bool eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
|
|
||||||
// <Helpdesk>/<EmailAddress>
|
// <Helpdesk>/<EmailAddress>
|
||||||
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:EmailAddress"), lang.c_str(), m_help_email);
|
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:EmailAddress"), lang.c_str(), m_help_email);
|
||||||
m_module.log_config((xpathHelpdesk + L"/EmailAddress").c_str(), m_help_email.c_str());
|
m_module->log_config((xpathHelpdesk + L"/EmailAddress").c_str(), m_help_email.c_str());
|
||||||
|
|
||||||
// <Helpdesk>/<WebAddress>
|
// <Helpdesk>/<WebAddress>
|
||||||
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:WebAddress"), lang.c_str(), m_help_web);
|
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:WebAddress"), lang.c_str(), m_help_web);
|
||||||
m_module.log_config((xpathHelpdesk + L"/WebAddress").c_str(), m_help_web.c_str());
|
m_module->log_config((xpathHelpdesk + L"/WebAddress").c_str(), m_help_web.c_str());
|
||||||
|
|
||||||
// <Helpdesk>/<Phone>
|
// <Helpdesk>/<Phone>
|
||||||
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:Phone"), lang.c_str(), m_help_phone);
|
eapxml::get_element_localized(pXmlElHelpdesk, bstr(L"eap-metadata:Phone"), lang.c_str(), m_help_phone);
|
||||||
m_module.log_config((xpathHelpdesk + L"/Phone").c_str(), m_help_phone.c_str());
|
m_module->log_config((xpathHelpdesk + L"/Phone").c_str(), m_help_phone.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// <CredentialPrompt>
|
// <CredentialPrompt>
|
||||||
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:CredentialPrompt"), lang.c_str(), m_lbl_alt_credential);
|
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:CredentialPrompt"), lang.c_str(), m_lbl_alt_credential);
|
||||||
m_module.log_config((xpathProviderInfo + L"/CredentialPrompt").c_str(), m_lbl_alt_credential.c_str());
|
m_module->log_config((xpathProviderInfo + L"/CredentialPrompt").c_str(), m_lbl_alt_credential.c_str());
|
||||||
|
|
||||||
// <UserNameLabel>
|
// <UserNameLabel>
|
||||||
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:UserNameLabel"), lang.c_str(), m_lbl_alt_identity);
|
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:UserNameLabel"), lang.c_str(), m_lbl_alt_identity);
|
||||||
m_module.log_config((xpathProviderInfo + L"/UserNameLabel").c_str(), m_lbl_alt_identity.c_str());
|
m_module->log_config((xpathProviderInfo + L"/UserNameLabel").c_str(), m_lbl_alt_identity.c_str());
|
||||||
|
|
||||||
// <PasswordLabel>
|
// <PasswordLabel>
|
||||||
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:PasswordLabel"), lang.c_str(), m_lbl_alt_password);
|
eapxml::get_element_localized(pXmlElProviderInfo, bstr(L"eap-metadata:PasswordLabel"), lang.c_str(), m_lbl_alt_password);
|
||||||
m_module.log_config((xpathProviderInfo + L"/PasswordLabel").c_str(), m_lbl_alt_password.c_str());
|
m_module->log_config((xpathProviderInfo + L"/PasswordLabel").c_str(), m_lbl_alt_password.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate authentication methods (<AuthenticationMethods>).
|
// Iterate authentication methods (<AuthenticationMethods>).
|
||||||
m_methods.clear();
|
m_methods.clear();
|
||||||
com_obj<IXMLDOMNodeList> pXmlListMethods;
|
com_obj<IXMLDOMNodeList> pXmlListMethods;
|
||||||
if ((dwResult = eapxml::select_nodes(pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods/eap-metadata:AuthenticationMethod"), &pXmlListMethods)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_nodes(pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods/eap-metadata:AuthenticationMethod"), &pXmlListMethods)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <AuthenticationMethods>/<AuthenticationMethod> elements."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <AuthenticationMethods>/<AuthenticationMethod> elements."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
long lCount = 0;
|
long lCount = 0;
|
||||||
@ -424,7 +426,7 @@ bool eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
com_obj<IXMLDOMNode> pXmlElMethod;
|
com_obj<IXMLDOMNode> pXmlElMethod;
|
||||||
pXmlListMethods->get_item(i, &pXmlElMethod);
|
pXmlListMethods->get_item(i, &pXmlElMethod);
|
||||||
|
|
||||||
unique_ptr<config_method> cfg(m_module.make_config_method());
|
unique_ptr<config_method> cfg(m_module->make_config_method());
|
||||||
|
|
||||||
// Check EAP method type (<EAPMethod>).
|
// Check EAP method type (<EAPMethod>).
|
||||||
DWORD dwMethodID;
|
DWORD dwMethodID;
|
||||||
@ -500,7 +502,7 @@ void eap::config_provider::operator>>(_Inout_ cursor_in &cursor)
|
|||||||
for (list<config_method>::size_type i = 0; i < count; i++) {
|
for (list<config_method>::size_type i = 0; i < count; i++) {
|
||||||
cursor >> is_nonnull;
|
cursor >> is_nonnull;
|
||||||
if (is_nonnull) {
|
if (is_nonnull) {
|
||||||
unique_ptr<config_method> el(m_module.make_config_method());
|
unique_ptr<config_method> el(m_module->make_config_method());
|
||||||
cursor >> *el;
|
cursor >> *el;
|
||||||
m_methods.push_back(std::move(el));
|
m_methods.push_back(std::move(el));
|
||||||
} else
|
} else
|
||||||
@ -513,7 +515,7 @@ void eap::config_provider::operator>>(_Inout_ cursor_in &cursor)
|
|||||||
// eap::config_providers
|
// eap::config_providers
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_providers::config_providers(_In_ module &mod) : config(mod)
|
eap::config_providers::config_providers(_In_ module *mod) : config(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +574,7 @@ bool eap::config_providers::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
// Select <EAPIdentityProviderList> node.
|
// Select <EAPIdentityProviderList> node.
|
||||||
com_obj<IXMLDOMNode> pXmlElIdentityProviderList;
|
com_obj<IXMLDOMNode> pXmlElIdentityProviderList;
|
||||||
if ((dwResult = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList"), &pXmlElIdentityProviderList)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList"), &pXmlElIdentityProviderList)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <EAPIdentityProviderList> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <EAPIdentityProviderList> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +582,7 @@ bool eap::config_providers::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
// <EAPIdentityProvider>
|
// <EAPIdentityProvider>
|
||||||
com_obj<IXMLDOMElement> pXmlElIdentityProvider;
|
com_obj<IXMLDOMElement> pXmlElIdentityProvider;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, bstr(L"EAPIdentityProvider"), bstrNamespace, &pXmlElIdentityProvider))) {
|
if ((dwResult = eapxml::create_element(pDoc, bstr(L"EAPIdentityProvider"), bstrNamespace, &pXmlElIdentityProvider))) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <EAPIdentityProvider> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <EAPIdentityProvider> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,7 +591,7 @@ bool eap::config_providers::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (FAILED(hr = pXmlElIdentityProviderList->appendChild(pXmlElIdentityProvider, NULL))) {
|
if (FAILED(hr = pXmlElIdentityProviderList->appendChild(pXmlElIdentityProvider, NULL))) {
|
||||||
*ppEapError = m_module.make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <EAPIdentityProvider> element."));
|
*ppEapError = m_module->make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <EAPIdentityProvider> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -610,7 +612,7 @@ bool eap::config_providers::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
|
|||||||
// Iterate authentication providers (<EAPIdentityProvider>).
|
// Iterate authentication providers (<EAPIdentityProvider>).
|
||||||
com_obj<IXMLDOMNodeList> pXmlListProviders;
|
com_obj<IXMLDOMNodeList> pXmlListProviders;
|
||||||
if ((dwResult = eapxml::select_nodes(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList/eap-metadata:EAPIdentityProvider"), &pXmlListProviders)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_nodes(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList/eap-metadata:EAPIdentityProvider"), &pXmlListProviders)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <EAPIdentityProviderList><EAPIdentityProvider> elements."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <EAPIdentityProviderList><EAPIdentityProvider> elements."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
long lCount = 0;
|
long lCount = 0;
|
||||||
|
@ -30,7 +30,7 @@ using namespace winstd;
|
|||||||
// eap::credentials
|
// eap::credentials
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::credentials::credentials(_In_ module &mod) : config(mod)
|
eap::credentials::credentials(_In_ module *mod) : config(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ tstring eap::credentials::get_name() const
|
|||||||
// eap::credentials_pass
|
// eap::credentials_pass
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::credentials_pass::credentials_pass(_In_ module &mod) : credentials(mod)
|
eap::credentials_pass::credentials_pass(_In_ module *mod) : credentials(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ bool eap::credentials_pass::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
|
|
||||||
// <UserName>
|
// <UserName>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), bstrNamespace, bstr(m_identity))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"UserName"), bstrNamespace, bstr(m_identity))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <UserName> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <UserName> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ bool eap::credentials_pass::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"Password"), bstrNamespace, pass);
|
dwResult = eapxml::put_element_value(pDoc, pConfigRoot, bstr(L"Password"), bstrNamespace, pass);
|
||||||
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
|
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
|
||||||
if (dwResult != ERROR_SUCCESS) {
|
if (dwResult != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Password> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <Password> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,21 +207,21 @@ bool eap::credentials_pass::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
|
|||||||
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
|
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
|
||||||
|
|
||||||
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:UserName"), m_identity)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <UserName> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <UserName> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_module.log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
|
m_module->log_config((xpath + L"/UserName").c_str(), m_identity.c_str());
|
||||||
|
|
||||||
bstr pass;
|
bstr pass;
|
||||||
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:Password"), &pass)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::get_element_value(pConfigRoot, bstr(L"eap-metadata:Password"), &pass)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <Password> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <Password> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_password = pass;
|
m_password = pass;
|
||||||
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
|
SecureZeroMemory((BSTR)pass, sizeof(OLECHAR)*pass.length());
|
||||||
|
|
||||||
m_module.log_config((xpath + L"/Password").c_str(),
|
m_module->log_config((xpath + L"/Password").c_str(),
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
m_password.c_str()
|
m_password.c_str()
|
||||||
#else
|
#else
|
||||||
@ -272,7 +272,7 @@ bool eap::credentials_pass::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **
|
|||||||
DATA_BLOB entropy_blob = { sizeof(s_entropy), (LPBYTE)s_entropy };
|
DATA_BLOB entropy_blob = { sizeof(s_entropy), (LPBYTE)s_entropy };
|
||||||
data_blob cred_enc;
|
data_blob cred_enc;
|
||||||
if (!CryptProtectData(&cred_blob, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &cred_enc)) {
|
if (!CryptProtectData(&cred_blob, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &cred_enc)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptProtectData failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptProtectData failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ bool eap::credentials_pass::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **
|
|||||||
(LPTSTR)m_identity.c_str() // UserName
|
(LPTSTR)m_identity.c_str() // UserName
|
||||||
};
|
};
|
||||||
if (!CredWrite(&cred, 0)) {
|
if (!CredWrite(&cred, 0)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CredWrite failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CredWrite failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ bool eap::credentials_pass::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
|
|||||||
// Read credentials.
|
// Read credentials.
|
||||||
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
|
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
|
||||||
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
|
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CredRead failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CredRead failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ bool eap::credentials_pass::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
|
|||||||
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
||||||
data_blob cred_int;
|
data_blob cred_int;
|
||||||
if (!CryptUnprotectData(&cred_enc, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN | CRYPTPROTECT_VERIFY_PROTECTION, &cred_int)) {
|
if (!CryptUnprotectData(&cred_enc, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN | CRYPTPROTECT_VERIFY_PROTECTION, &cred_int)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptUnprotectData failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptUnprotectData failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,8 +334,8 @@ bool eap::credentials_pass::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
|
|||||||
m_identity.clear();
|
m_identity.clear();
|
||||||
|
|
||||||
wstring xpath(pszTargetName);
|
wstring xpath(pszTargetName);
|
||||||
m_module.log_config((xpath + L"/Username").c_str(), m_identity.c_str());
|
m_module->log_config((xpath + L"/Username").c_str(), m_identity.c_str());
|
||||||
m_module.log_config((xpath + L"/Password").c_str(),
|
m_module->log_config((xpath + L"/Password").c_str(),
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
m_password.c_str()
|
m_password.c_str()
|
||||||
#else
|
#else
|
||||||
|
@ -434,7 +434,7 @@ protected:
|
|||||||
if (pEapError) {
|
if (pEapError) {
|
||||||
if (pEapError->dwWinError != ERROR_NOT_FOUND)
|
if (pEapError->dwWinError != ERROR_NOT_FOUND)
|
||||||
wxLogError(winstd::tstring_printf(_("Error reading credentials from Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
|
wxLogError(winstd::tstring_printf(_("Error reading credentials from Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
|
||||||
m_cred.m_module.free_error_memory(pEapError);
|
m_cred.m_module->free_error_memory(pEapError);
|
||||||
} else
|
} else
|
||||||
wxLogError(_("Reading credentials failed."));
|
wxLogError(_("Reading credentials failed."));
|
||||||
}
|
}
|
||||||
@ -455,7 +455,7 @@ protected:
|
|||||||
if (!m_cred.store(m_target.c_str(), &pEapError)) {
|
if (!m_cred.store(m_target.c_str(), &pEapError)) {
|
||||||
if (pEapError) {
|
if (pEapError) {
|
||||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
|
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %ls (error %u)"), pEapError->pRootCauseString, pEapError->dwWinError).c_str());
|
||||||
m_cred.m_module.free_error_memory(pEapError);
|
m_cred.m_module->free_error_memory(pEapError);
|
||||||
} else
|
} else
|
||||||
wxLogError(_("Writing credentials failed."));
|
wxLogError(_("Writing credentials failed."));
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_method_pap(_In_ module &mod);
|
config_method_pap(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
|
@ -43,9 +43,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs credentials
|
/// Constructs credentials
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
credentials_pap(_In_ module &mod);
|
credentials_pap(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies credentials
|
/// Copies credentials
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::config_method_pap
|
// eap::config_method_pap
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_method_pap::config_method_pap(_In_ module &mod) : config_method_with_cred<credentials_pap>(mod)
|
eap::config_method_pap::config_method_pap(_In_ module *mod) : config_method_with_cred<credentials_pap>(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
// eap::credentials_pap
|
// eap::credentials_pap
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::credentials_pap::credentials_pap(_In_ module &mod) : credentials_pass(mod)
|
eap::credentials_pap::credentials_pap(_In_ module *mod) : credentials_pass(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_method_tls(_In_ module &mod);
|
config_method_tls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
|
@ -46,9 +46,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs credentials
|
/// Constructs credentials
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
credentials_tls(_In_ module &mod);
|
credentials_tls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies credentials
|
/// Copies credentials
|
||||||
|
@ -66,9 +66,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
session_tls(_In_ module &mod);
|
session_tls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies TLS session
|
/// Copies TLS session
|
||||||
|
@ -66,7 +66,7 @@ tstring eap::get_cert_title(PCCERT_CONTEXT cert)
|
|||||||
// eap::config_method_tls
|
// eap::config_method_tls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method_with_cred<credentials_tls>(mod)
|
eap::config_method_tls::config_method_tls(_In_ module *mod) : config_method_with_cred<credentials_tls>(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ bool eap::config_method_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *
|
|||||||
// <ServerSideCredential>
|
// <ServerSideCredential>
|
||||||
com_obj<IXMLDOMElement> pXmlElServerSideCredential;
|
com_obj<IXMLDOMElement> pXmlElServerSideCredential;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ServerSideCredential"), bstr(L"ServerSideCredential"), bstrNamespace, &pXmlElServerSideCredential)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ServerSideCredential"), bstr(L"ServerSideCredential"), bstrNamespace, &pXmlElServerSideCredential)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ServerSideCredential> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ServerSideCredential> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,25 +141,25 @@ bool eap::config_method_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *
|
|||||||
// <CA>
|
// <CA>
|
||||||
com_obj<IXMLDOMElement> pXmlElCA;
|
com_obj<IXMLDOMElement> pXmlElCA;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, bstr(L"CA"), bstrNamespace, &pXmlElCA))) {
|
if ((dwResult = eapxml::create_element(pDoc, bstr(L"CA"), bstrNamespace, &pXmlElCA))) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <CA> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <CA> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <CA>/<format>
|
// <CA>/<format>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElCA, bstr(L"format"), bstrNamespace, bstr(L"PEM"))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElCA, bstr(L"format"), bstrNamespace, bstr(L"PEM"))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <format> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <format> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <CA>/<cert-data>
|
// <CA>/<cert-data>
|
||||||
const cert_context &cc = *i;
|
const cert_context &cc = *i;
|
||||||
if ((dwResult = eapxml::put_element_base64(pDoc, pXmlElCA, bstr(L"cert-data"), bstrNamespace, cc->pbCertEncoded, cc->cbCertEncoded)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_base64(pDoc, pXmlElCA, bstr(L"cert-data"), bstrNamespace, cc->pbCertEncoded, cc->cbCertEncoded)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <cert-data> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <cert-data> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = pXmlElServerSideCredential->appendChild(pXmlElCA, NULL))) {
|
if (FAILED(hr = pXmlElServerSideCredential->appendChild(pXmlElCA, NULL))) {
|
||||||
*ppEapError = m_module.make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <CA> element."));
|
*ppEapError = m_module->make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <CA> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ bool eap::config_method_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *
|
|||||||
wstring str;
|
wstring str;
|
||||||
MultiByteToWideChar(CP_UTF8, 0, i->c_str(), (int)i->length(), str);
|
MultiByteToWideChar(CP_UTF8, 0, i->c_str(), (int)i->length(), str);
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElServerSideCredential, bstr(L"ServerName"), bstrNamespace, bstr(str))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElServerSideCredential, bstr(L"ServerName"), bstrNamespace, bstr(str))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ServerName> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ServerName> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
|
|||||||
list<tstring> cert_names;
|
list<tstring> cert_names;
|
||||||
for (std::list<winstd::cert_context>::const_iterator cert = m_trusted_root_ca.cbegin(), cert_end = m_trusted_root_ca.cend(); cert != cert_end; ++cert)
|
for (std::list<winstd::cert_context>::const_iterator cert = m_trusted_root_ca.cbegin(), cert_end = m_trusted_root_ca.cend(); cert != cert_end; ++cert)
|
||||||
cert_names.push_back(std::move(get_cert_title(*cert)));
|
cert_names.push_back(std::move(get_cert_title(*cert)));
|
||||||
m_module.log_config((xpathServerSideCredential + L"/CA").c_str(), cert_names);
|
m_module->log_config((xpathServerSideCredential + L"/CA").c_str(), cert_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ServerName>
|
// <ServerName>
|
||||||
@ -248,7 +248,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
|
|||||||
m_server_names.push_back(str);
|
m_server_names.push_back(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_module.log_config((xpathServerSideCredential + L"/ServerName").c_str(), m_server_names);
|
m_module->log_config((xpathServerSideCredential + L"/ServerName").c_str(), m_server_names);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::credentials_tls
|
// eap::credentials_tls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::credentials_tls::credentials_tls(_In_ module &mod) : credentials(mod)
|
eap::credentials_tls::credentials_tls(_In_ module *mod) : credentials(mod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,26 +104,26 @@ bool eap::credentials_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC
|
|||||||
// <ClientCertificate>
|
// <ClientCertificate>
|
||||||
com_obj<IXMLDOMElement> pXmlElClientCertificate;
|
com_obj<IXMLDOMElement> pXmlElClientCertificate;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, bstr(L"ClientCertificate"), bstrNamespace, &pXmlElClientCertificate))) {
|
if ((dwResult = eapxml::create_element(pDoc, bstr(L"ClientCertificate"), bstrNamespace, &pXmlElClientCertificate))) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ClientCertificate> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ClientCertificate> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_cert) {
|
if (m_cert) {
|
||||||
// <ClientCertificate>/<format>
|
// <ClientCertificate>/<format>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientCertificate, bstr(L"format"), bstrNamespace, bstr(L"PEM"))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientCertificate, bstr(L"format"), bstrNamespace, bstr(L"PEM"))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <format> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <format> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ClientCertificate>/<cert-data>
|
// <ClientCertificate>/<cert-data>
|
||||||
if ((dwResult = eapxml::put_element_base64(pDoc, pXmlElClientCertificate, bstr(L"cert-data"), bstrNamespace, m_cert->pbCertEncoded, m_cert->cbCertEncoded)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_base64(pDoc, pXmlElClientCertificate, bstr(L"cert-data"), bstrNamespace, m_cert->pbCertEncoded, m_cert->cbCertEncoded)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <cert-data> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <cert-data> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = pConfigRoot->appendChild(pXmlElClientCertificate, NULL))) {
|
if (FAILED(hr = pConfigRoot->appendChild(pXmlElClientCertificate, NULL))) {
|
||||||
*ppEapError = m_module.make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <ClientCertificate> element."));
|
*ppEapError = m_module->make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <ClientCertificate> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ bool eap::credentials_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
// <ClientCertificate>
|
// <ClientCertificate>
|
||||||
com_obj<IXMLDOMElement> pXmlElClientCertificate;
|
com_obj<IXMLDOMElement> pXmlElClientCertificate;
|
||||||
if ((dwResult = eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ClientCertificate"), &pXmlElClientCertificate)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:ClientCertificate"), &pXmlElClientCertificate)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <ClientCertificate> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error reading <ClientCertificate> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ bool eap::credentials_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
|||||||
m_cert.create(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, aData.data(), (DWORD)aData.size());
|
m_cert.create(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, aData.data(), (DWORD)aData.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_module.log_config((xpath + L"/ClientCertificate").c_str(), get_name().c_str());
|
m_module->log_config((xpath + L"/ClientCertificate").c_str(), get_name().c_str());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ bool eap::credentials_tls::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **p
|
|||||||
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
||||||
data_blob cred_enc;
|
data_blob cred_enc;
|
||||||
if (!CryptProtectData(&cred_blob, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &cred_enc)) {
|
if (!CryptProtectData(&cred_blob, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &cred_enc)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptProtectData failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptProtectData failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ bool eap::credentials_tls::store(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **p
|
|||||||
(LPTSTR)name.c_str() // UserName
|
(LPTSTR)name.c_str() // UserName
|
||||||
};
|
};
|
||||||
if (!CredWrite(&cred, 0)) {
|
if (!CredWrite(&cred, 0)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CredWrite failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CredWrite failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ bool eap::credentials_tls::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
|
|||||||
// Read credentials.
|
// Read credentials.
|
||||||
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
|
unique_ptr<CREDENTIAL, CredFree_delete<CREDENTIAL> > cred;
|
||||||
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
|
if (!CredRead(target_name(pszTargetName).c_str(), CRED_TYPE_GENERIC, 0, (PCREDENTIAL*)&cred)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CredRead failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CredRead failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,18 +248,18 @@ bool eap::credentials_tls::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
|
|||||||
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
DATA_BLOB entropy_blob = { sizeof(s_entropy) , (LPBYTE)s_entropy };
|
||||||
data_blob cred_int;
|
data_blob cred_int;
|
||||||
if (!CryptUnprotectData(&cred_enc, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN | CRYPTPROTECT_VERIFY_PROTECTION, &cred_int)) {
|
if (!CryptUnprotectData(&cred_enc, NULL, &entropy_blob, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN | CRYPTPROTECT_VERIFY_PROTECTION, &cred_int)) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptUnprotectData failed."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" CryptUnprotectData failed."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bResult = m_cert.create(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cred_int.pbData, cred_int.cbData);
|
bool bResult = m_cert.create(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cred_int.pbData, cred_int.cbData);
|
||||||
SecureZeroMemory(cred_int.pbData, cred_int.cbData);
|
SecureZeroMemory(cred_int.pbData, cred_int.cbData);
|
||||||
if (!bResult) {
|
if (!bResult) {
|
||||||
*ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" Error loading certificate."));
|
*ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" Error loading certificate."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_module.log_config((wstring(pszTargetName) + L"/Certificate").c_str(), get_name().c_str());
|
m_module->log_config((wstring(pszTargetName) + L"/Certificate").c_str(), get_name().c_str());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::session_tls
|
// eap::session_tls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::session_tls::session_tls(_In_ module &mod) :
|
eap::session_tls::session_tls(_In_ module *mod) :
|
||||||
m_phase(phase_handshake_start),
|
m_phase(phase_handshake_start),
|
||||||
session<config_method_tls, credentials_tls, bool, bool>(mod)
|
session<config_method_tls, credentials_tls, bool, bool>(mod)
|
||||||
{
|
{
|
||||||
@ -152,7 +152,7 @@ bool eap::session_tls::begin(
|
|||||||
_Out_ EAP_ERROR **ppEapError)
|
_Out_ EAP_ERROR **ppEapError)
|
||||||
{
|
{
|
||||||
if (dwMaxSendPacketSize <= 10) {
|
if (dwMaxSendPacketSize <= 10) {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Maximum send packet size too small (expected: >%u, received: %u)."), 10, dwMaxSendPacketSize).c_str());
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, wstring_printf(_T(__FUNCTION__) _T(" Maximum send packet size too small (expected: >%u, received: %u)."), 10, dwMaxSendPacketSize).c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,10 +176,10 @@ bool eap::session_tls::process_request_packet(
|
|||||||
|
|
||||||
// Is this a valid EAP-TLS packet?
|
// Is this a valid EAP-TLS packet?
|
||||||
if (dwReceivedPacketSize < 6) {
|
if (dwReceivedPacketSize < 6) {
|
||||||
*ppEapError = m_module.make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, _T(__FUNCTION__) _T(" Packet is too small. EAP-%s packets should be at least 6B."));
|
*ppEapError = m_module->make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, _T(__FUNCTION__) _T(" Packet is too small. EAP-%s packets should be at least 6B."));
|
||||||
return false;
|
return false;
|
||||||
}/* else if (pReceivedPacket->Data[0] != eap_type_tls) {
|
}/* else if (pReceivedPacket->Data[0] != eap_type_tls) {
|
||||||
*ppEapError = m_module.make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not EAP-TLS (expected: %u, received: %u)."), eap_type_tls, pReceivedPacket->Data[0]).c_str());
|
*ppEapError = m_module->make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not EAP-TLS (expected: %u, received: %u)."), eap_type_tls, pReceivedPacket->Data[0]).c_str());
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ bool eap::session_tls::process_request_packet(
|
|||||||
if (pReceivedPacket->Data[1] & tls_flags_length_incl) {
|
if (pReceivedPacket->Data[1] & tls_flags_length_incl) {
|
||||||
// First fragment received.
|
// First fragment received.
|
||||||
if (dwReceivedPacketSize < 10) {
|
if (dwReceivedPacketSize < 10) {
|
||||||
*ppEapError = m_module.make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, _T(__FUNCTION__) _T(" Packet is too small. EAP-TLS first fragmented packet should be at least 10B."));
|
*ppEapError = m_module->make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, _T(__FUNCTION__) _T(" Packet is too small. EAP-TLS first fragmented packet should be at least 10B."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,17 +232,17 @@ bool eap::session_tls::process_request_packet(
|
|||||||
case phase_handshake_start: {
|
case phase_handshake_start: {
|
||||||
// Is this an EAP-TLS Start packet?
|
// Is this an EAP-TLS Start packet?
|
||||||
if (m_packet_req.m_code != EapCodeRequest) {
|
if (m_packet_req.m_code != EapCodeRequest) {
|
||||||
*ppEapError = m_module.make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not a request (expected: %x, received: %x)."), EapCodeRequest, m_packet_req.m_code).c_str());
|
*ppEapError = m_module->make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not a request (expected: %x, received: %x)."), EapCodeRequest, m_packet_req.m_code).c_str());
|
||||||
return false;
|
return false;
|
||||||
} else if (!(m_packet_req.m_flags & tls_flags_start)) {
|
} else if (!(m_packet_req.m_flags & tls_flags_start)) {
|
||||||
*ppEapError = m_module.make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not EAP-TLS Start (expected: %x, received: %x)."), tls_flags_start, m_packet_req.m_flags).c_str());
|
*ppEapError = m_module->make_error(EAP_E_EAPHOST_METHOD_INVALID_PACKET, wstring_printf(_T(__FUNCTION__) _T(" Packet is not EAP-TLS Start (expected: %x, received: %x)."), tls_flags_start, m_packet_req.m_flags).c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Determine minimum EAP-TLS version supported by server and us.
|
//// Determine minimum EAP-TLS version supported by server and us.
|
||||||
//version_t ver_remote = (version_t)(m_packet_req.m_flags & tls_flags_ver_mask);
|
//version_t ver_remote = (version_t)(m_packet_req.m_flags & tls_flags_ver_mask);
|
||||||
//m_version = std::min<version_t>(ver_remote, version_0);
|
//m_version = std::min<version_t>(ver_remote, version_0);
|
||||||
//m_module.log_event(&EAPMETHOD_HANDSHAKE_START, event_data(m_cred.target_suffix()), event_data((unsigned char)m_version), event_data((unsigned char)ver_remote), event_data::blank);
|
//m_module->log_event(&EAPMETHOD_HANDSHAKE_START, event_data(m_cred.target_suffix()), event_data((unsigned char)m_version), event_data((unsigned char)ver_remote), event_data::blank);
|
||||||
|
|
||||||
// Build response packet.
|
// Build response packet.
|
||||||
m_packet_res.m_code = EapCodeResponse;
|
m_packet_res.m_code = EapCodeResponse;
|
||||||
@ -251,14 +251,14 @@ bool eap::session_tls::process_request_packet(
|
|||||||
|
|
||||||
|
|
||||||
//if (!m_packet_res.create(EapCodeResponse, pReceivedPacket->Id, eap_type_tls, (BYTE)m_version)) {
|
//if (!m_packet_res.create(EapCodeResponse, pReceivedPacket->Id, eap_type_tls, (BYTE)m_version)) {
|
||||||
// *ppEapError = m_module.make_error(GetLastError(), _T(__FUNCTION__) _T(" Error creating packet."));
|
// *ppEapError = m_module->make_error(GetLastError(), _T(__FUNCTION__) _T(" Error creating packet."));
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,6 +330,6 @@ bool eap::session_tls::get_result(
|
|||||||
UNREFERENCED_PARAMETER(ppResult);
|
UNREFERENCED_PARAMETER(ppResult);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ namespace eap {
|
|||||||
///
|
///
|
||||||
/// Constructs configuration
|
/// Constructs configuration
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
config_method_ttls(_In_ module &mod);
|
config_method_ttls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies configuration
|
/// Copies configuration
|
||||||
|
@ -42,9 +42,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructs credentials
|
/// Constructs credentials
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
credentials_ttls(_In_ module &mod);
|
credentials_ttls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies credentials
|
/// Copies credentials
|
||||||
|
@ -55,9 +55,9 @@ namespace eap
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
/// \param[in] mod Reference of the EAP module to use for global services
|
/// \param[in] mod EAP module to use for global services
|
||||||
///
|
///
|
||||||
session_ttls(_In_ module &mod);
|
session_ttls(_In_ module *mod);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies TTLS session
|
/// Copies TTLS session
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::config_method_ttls
|
// eap::config_method_ttls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::config_method_ttls::config_method_ttls(_In_ module &mod) :
|
eap::config_method_ttls::config_method_ttls(_In_ module *mod) :
|
||||||
m_outer(mod),
|
m_outer(mod),
|
||||||
config_method(mod)
|
config_method(mod)
|
||||||
{
|
{
|
||||||
@ -100,14 +100,14 @@ bool eap::config_method_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode
|
|||||||
// <ClientSideCredential>
|
// <ClientSideCredential>
|
||||||
com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
com_obj<IXMLDOMElement> pXmlElClientSideCredential;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ClientSideCredential"), bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:ClientSideCredential"), bstr(L"ClientSideCredential"), bstrNamespace, &pXmlElClientSideCredential)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ClientSideCredential> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <ClientSideCredential> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <ClientSideCredential>/<AnonymousIdentity>
|
// <ClientSideCredential>/<AnonymousIdentity>
|
||||||
if (!m_anonymous_identity.empty())
|
if (!m_anonymous_identity.empty())
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, bstr(L"AnonymousIdentity"), bstrNamespace, bstr(m_anonymous_identity))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElClientSideCredential, bstr(L"AnonymousIdentity"), bstrNamespace, bstr(m_anonymous_identity))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AnonymousIdentity> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <AnonymousIdentity> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,14 +117,14 @@ bool eap::config_method_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode
|
|||||||
// <InnerAuthenticationMethod>
|
// <InnerAuthenticationMethod>
|
||||||
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), bstr(L"InnerAuthenticationMethod"), bstrNamespace, &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), bstr(L"InnerAuthenticationMethod"), bstrNamespace, &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <InnerAuthenticationMethod> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <InnerAuthenticationMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dynamic_cast<const config_method_pap*>(m_inner.get())) {
|
if (dynamic_cast<const config_method_pap*>(m_inner.get())) {
|
||||||
// <InnerAuthenticationMethod>/<NonEAPAuthMethod>
|
// <InnerAuthenticationMethod>/<NonEAPAuthMethod>
|
||||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElInnerAuthenticationMethod, bstr(L"NonEAPAuthMethod"), bstrNamespace, bstr(L"PAP"))) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElInnerAuthenticationMethod, bstr(L"NonEAPAuthMethod"), bstrNamespace, bstr(L"PAP"))) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <NonEAPAuthMethod> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <NonEAPAuthMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ bool eap::config_method_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode
|
|||||||
if (!m_inner->save(pDoc, pXmlElInnerAuthenticationMethod, ppEapError))
|
if (!m_inner->save(pDoc, pXmlElInnerAuthenticationMethod, ppEapError))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Unsupported inner authentication method."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Unsupported inner authentication method."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ bool eap::config_method_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERRO
|
|||||||
|
|
||||||
// <AnonymousIdentity>
|
// <AnonymousIdentity>
|
||||||
eapxml::get_element_value(pXmlElClientSideCredential, bstr(L"eap-metadata:AnonymousIdentity"), m_anonymous_identity);
|
eapxml::get_element_value(pXmlElClientSideCredential, bstr(L"eap-metadata:AnonymousIdentity"), m_anonymous_identity);
|
||||||
m_module.log_config((xpathClientSideCredential + L"/AnonymousIdentity").c_str(), m_anonymous_identity.c_str());
|
m_module->log_config((xpathClientSideCredential + L"/AnonymousIdentity").c_str(), m_anonymous_identity.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_outer.load(pConfigRoot, ppEapError))
|
if (!m_outer.load(pConfigRoot, ppEapError))
|
||||||
@ -169,7 +169,7 @@ bool eap::config_method_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERRO
|
|||||||
// <InnerAuthenticationMethod>
|
// <InnerAuthenticationMethod>
|
||||||
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
||||||
if ((dwResult = eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_element(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,12 +186,12 @@ bool eap::config_method_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERRO
|
|||||||
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrMethod, bstrMethod.length(), L"PAP", -1, NULL, NULL, 0) == CSTR_EQUAL)
|
CompareStringEx(LOCALE_NAME_INVARIANT, NORM_IGNORECASE, bstrMethod, bstrMethod.length(), L"PAP", -1, NULL, NULL, 0) == CSTR_EQUAL)
|
||||||
{
|
{
|
||||||
// PAP
|
// PAP
|
||||||
m_module.log_config((xpath + L"/NonEAPAuthMethod").c_str(), L"PAP");
|
m_module->log_config((xpath + L"/NonEAPAuthMethod").c_str(), L"PAP");
|
||||||
m_inner.reset(new config_method_pap(m_module));
|
m_inner.reset(new config_method_pap(m_module));
|
||||||
if (!m_inner->load(pXmlElInnerAuthenticationMethod, ppEapError))
|
if (!m_inner->load(pXmlElInnerAuthenticationMethod, ppEapError))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Unsupported inner authentication method."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Unsupported inner authentication method."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::credentials_ttls
|
// eap::credentials_ttls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::credentials_ttls::credentials_ttls(_In_ module &mod) :
|
eap::credentials_ttls::credentials_ttls(_In_ module *mod) :
|
||||||
m_outer(mod),
|
m_outer(mod),
|
||||||
credentials(mod)
|
credentials(mod)
|
||||||
{
|
{
|
||||||
@ -116,7 +116,7 @@ bool eap::credentials_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
// <InnerAuthenticationMethod>
|
// <InnerAuthenticationMethod>
|
||||||
winstd::com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
winstd::com_obj<IXMLDOMElement> pXmlElInnerAuthenticationMethod;
|
||||||
if ((dwResult = eapxml::create_element(pDoc, winstd::bstr(L"InnerAuthenticationMethod"), bstrNamespace, &pXmlElInnerAuthenticationMethod))) {
|
if ((dwResult = eapxml::create_element(pDoc, winstd::bstr(L"InnerAuthenticationMethod"), bstrNamespace, &pXmlElInnerAuthenticationMethod))) {
|
||||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <InnerAuthenticationMethod> element."));
|
*ppEapError = m_module->make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <InnerAuthenticationMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ bool eap::credentials_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (FAILED(hr = pConfigRoot->appendChild(pXmlElInnerAuthenticationMethod, NULL))) {
|
if (FAILED(hr = pConfigRoot->appendChild(pXmlElInnerAuthenticationMethod, NULL))) {
|
||||||
*ppEapError = m_module.make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <InnerAuthenticationMethod> element."));
|
*ppEapError = m_module->make_error(HRESULT_CODE(hr), _T(__FUNCTION__) _T(" Error appending <InnerAuthenticationMethod> element."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ bool eap::credentials_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
|
|||||||
if (m_inner) {
|
if (m_inner) {
|
||||||
com_obj<IXMLDOMNode> pXmlElInnerAuthenticationMethod;
|
com_obj<IXMLDOMNode> pXmlElInnerAuthenticationMethod;
|
||||||
if ((dwResult = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
if ((dwResult = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:InnerAuthenticationMethod"), &pXmlElInnerAuthenticationMethod)) != ERROR_SUCCESS) {
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
*ppEapError = m_module->make_error(ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting <InnerAuthenticationMethod> element."), _T("Please make sure profile XML is a valid ") _T(PRODUCT_NAME_STR) _T(" profile XML document."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ bool eap::peer_ttls::get_identity(
|
|||||||
bool user_ctx_changed = hTokenImpersonateUser && ImpersonateLoggedOnUser(hTokenImpersonateUser);
|
bool user_ctx_changed = hTokenImpersonateUser && ImpersonateLoggedOnUser(hTokenImpersonateUser);
|
||||||
|
|
||||||
if (!is_outer_set) {
|
if (!is_outer_set) {
|
||||||
credentials_tls cred_loaded(*this);
|
credentials_tls cred_loaded(this);
|
||||||
if (cred_loaded.retrieve(cfg_prov.m_id.c_str(), ppEapError)) {
|
if (cred_loaded.retrieve(cfg_prov.m_id.c_str(), ppEapError)) {
|
||||||
// Outer TLS: Using stored credentials.
|
// Outer TLS: Using stored credentials.
|
||||||
cred_out.m_outer = std::move(cred_loaded);
|
cred_out.m_outer = std::move(cred_loaded);
|
||||||
@ -150,7 +150,7 @@ bool eap::peer_ttls::get_identity(
|
|||||||
|
|
||||||
if (!is_inner_set) {
|
if (!is_inner_set) {
|
||||||
unique_ptr<credentials> cred_loaded;
|
unique_ptr<credentials> cred_loaded;
|
||||||
if (cfg_inner_pap) cred_loaded.reset(new credentials_pap(*this));
|
if (cfg_inner_pap) cred_loaded.reset(new credentials_pap(this));
|
||||||
else assert(0); // Unsupported inner authentication method type.
|
else assert(0); // Unsupported inner authentication method type.
|
||||||
if (cred_loaded->retrieve(cfg_prov.m_id.c_str(), ppEapError)) {
|
if (cred_loaded->retrieve(cfg_prov.m_id.c_str(), ppEapError)) {
|
||||||
// Inner PAP: Using stored credentials.
|
// Inner PAP: Using stored credentials.
|
||||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
|||||||
// eap::session_ttls
|
// eap::session_ttls
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
eap::session_ttls::session_ttls(_In_ module &mod) :
|
eap::session_ttls::session_ttls(_In_ module *mod) :
|
||||||
m_version(version_0),
|
m_version(version_0),
|
||||||
session<config_method_ttls, credentials_ttls, bool, bool>(mod)
|
session<config_method_ttls, credentials_ttls, bool, bool>(mod)
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ bool eap::session_ttls::process_request_packet(
|
|||||||
UNREFERENCED_PARAMETER(pEapOutput);
|
UNREFERENCED_PARAMETER(pEapOutput);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ bool eap::session_ttls::get_response_packet(
|
|||||||
UNREFERENCED_PARAMETER(pSendPacket);
|
UNREFERENCED_PARAMETER(pSendPacket);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +110,6 @@ bool eap::session_ttls::get_result(
|
|||||||
UNREFERENCED_PARAMETER(ppResult);
|
UNREFERENCED_PARAMETER(ppResult);
|
||||||
assert(ppEapError);
|
assert(ppEapError);
|
||||||
|
|
||||||
*ppEapError = m_module.make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
*ppEapError = m_module->make_error(ERROR_NOT_SUPPORTED, _T(__FUNCTION__) _T(" Not supported."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user