EAP_USE_NATIVE_CREDENTIAL_CACHE is now 0/1 #defined
This commit is contained in:
parent
f5530b4ca9
commit
decf8d0860
@ -25,6 +25,10 @@
|
|||||||
#define EAP_ENCRYPT_BLOBS 1
|
#define EAP_ENCRYPT_BLOBS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
|
#define EAP_USE_NATIVE_CREDENTIAL_CACHE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _HOST_LOW_ENDIAN
|
#define _HOST_LOW_ENDIAN
|
||||||
|
|
||||||
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)
|
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)
|
||||||
|
@ -240,7 +240,7 @@ namespace eap
|
|||||||
// The following members are required to avoid memory leakage in get_result()
|
// The following members are required to avoid memory leakage in get_result()
|
||||||
EAP_ATTRIBUTES m_eap_attr_desc; ///< EAP attributes descriptor
|
EAP_ATTRIBUTES m_eap_attr_desc; ///< EAP attributes descriptor
|
||||||
BYTE *m_blob_cfg; ///< Configuration BLOB
|
BYTE *m_blob_cfg; ///< Configuration BLOB
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
BYTE *m_blob_cred; ///< Credentials BLOB
|
BYTE *m_blob_cred; ///< Credentials BLOB
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -284,7 +284,7 @@ void eap::peer_ttls::get_result(
|
|||||||
s->m_blob_cfg = pResult->pConnectionData;
|
s->m_blob_cfg = pResult->pConnectionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
pResult->fSaveUserData = TRUE;
|
pResult->fSaveUserData = TRUE;
|
||||||
pack(s->m_cred, &pResult->pUserData, &pResult->dwSizeofUserData);
|
pack(s->m_cred, &pResult->pUserData, &pResult->dwSizeofUserData);
|
||||||
if (s->m_blob_cred)
|
if (s->m_blob_cred)
|
||||||
@ -354,7 +354,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
|||||||
_Out_ credentials_connection& cred_out,
|
_Out_ credentials_connection& cred_out,
|
||||||
_In_ HANDLE hTokenImpersonateUser)
|
_In_ HANDLE hTokenImpersonateUser)
|
||||||
{
|
{
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
// Unpack cached credentials.
|
// Unpack cached credentials.
|
||||||
credentials_connection cred_in(*this, cfg);
|
credentials_connection cred_in(*this, cfg);
|
||||||
if (dwUserDataSize)
|
if (dwUserDataSize)
|
||||||
@ -380,14 +380,14 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
|||||||
// Combine credentials. We could use eap::credentials_ttls() to do all the work, but we would not know which credentials is missing then.
|
// Combine credentials. We could use eap::credentials_ttls() to do all the work, but we would not know which credentials is missing then.
|
||||||
credentials_ttls *cred = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
credentials_ttls *cred = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
||||||
cred_out.m_cred.reset(cred);
|
cred_out.m_cred.reset(cred);
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Combine outer credentials.
|
// Combine outer credentials.
|
||||||
LPCTSTR _target_name = (dwFlags & EAP_FLAG_GUEST_ACCESS) == 0 ? target_name.c_str() : NULL;
|
LPCTSTR _target_name = (dwFlags & EAP_FLAG_GUEST_ACCESS) == 0 ? target_name.c_str() : NULL;
|
||||||
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
has_cached ? cred_in.m_cred.get() : NULL,
|
has_cached ? cred_in.m_cred.get() : NULL,
|
||||||
#else
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
@ -401,7 +401,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
|||||||
|
|
||||||
// Combine inner credentials.
|
// Combine inner credentials.
|
||||||
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
||||||
#else
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
@ -447,7 +447,7 @@ eap::peer_ttls::session::session(_In_ module &mod) :
|
|||||||
m_cfg(mod),
|
m_cfg(mod),
|
||||||
m_cred(mod, m_cfg),
|
m_cred(mod, m_cfg),
|
||||||
m_blob_cfg(NULL)
|
m_blob_cfg(NULL)
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
, m_blob_cred(NULL)
|
, m_blob_cred(NULL)
|
||||||
#endif
|
#endif
|
||||||
{}
|
{}
|
||||||
@ -458,7 +458,7 @@ eap::peer_ttls::session::~session()
|
|||||||
if (m_blob_cfg)
|
if (m_blob_cfg)
|
||||||
m_module.free_memory(m_blob_cfg);
|
m_module.free_memory(m_blob_cfg);
|
||||||
|
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
if (m_blob_cred)
|
if (m_blob_cred)
|
||||||
m_module.free_memory(m_blob_cred);
|
m_module.free_memory(m_blob_cred);
|
||||||
#endif
|
#endif
|
||||||
|
@ -153,7 +153,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
config_connection cfg(*this);
|
config_connection cfg(*this);
|
||||||
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
||||||
|
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
// Unpack cached credentials.
|
// Unpack cached credentials.
|
||||||
credentials_connection cred_in(*this, cfg);
|
credentials_connection cred_in(*this, cfg);
|
||||||
if (dwUserDataSize)
|
if (dwUserDataSize)
|
||||||
@ -201,7 +201,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
cred_method.m_id = cfg_prov->m_id;
|
cred_method.m_id = cfg_prov->m_id;
|
||||||
credentials_ttls *_cred_method = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
credentials_ttls *_cred_method = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
||||||
cred_method.m_cred.reset(_cred_method);
|
cred_method.m_cred.reset(_cred_method);
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
bool has_cached = cred_in.m_cred && cred_in.match(*cfg_prov);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
|
|
||||||
// Combine outer credentials.
|
// Combine outer credentials.
|
||||||
eap::credentials::source_t src_outer = _cred_method->credentials_tls::combine(
|
eap::credentials::source_t src_outer = _cred_method->credentials_tls::combine(
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
has_cached ? cred_in.m_cred.get() : NULL,
|
has_cached ? cred_in.m_cred.get() : NULL,
|
||||||
#else
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
@ -223,7 +223,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
|||||||
|
|
||||||
// Combine inner credentials.
|
// Combine inner credentials.
|
||||||
eap::credentials::source_t src_inner = _cred_method->m_inner->combine(
|
eap::credentials::source_t src_inner = _cred_method->m_inner->combine(
|
||||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||||
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
has_cached ? dynamic_cast<credentials_ttls*>(cred_in.m_cred.get())->m_inner.get() : NULL,
|
||||||
#else
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user