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
|
||||
#endif
|
||||
|
||||
#ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#define EAP_USE_NATIVE_CREDENTIAL_CACHE 0
|
||||
#endif
|
||||
|
||||
#define _HOST_LOW_ENDIAN
|
||||
|
||||
#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()
|
||||
EAP_ATTRIBUTES m_eap_attr_desc; ///< EAP attributes descriptor
|
||||
BYTE *m_blob_cfg; ///< Configuration BLOB
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
BYTE *m_blob_cred; ///< Credentials BLOB
|
||||
#endif
|
||||
};
|
||||
|
@ -284,7 +284,7 @@ void eap::peer_ttls::get_result(
|
||||
s->m_blob_cfg = pResult->pConnectionData;
|
||||
}
|
||||
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
pResult->fSaveUserData = TRUE;
|
||||
pack(s->m_cred, &pResult->pUserData, &pResult->dwSizeofUserData);
|
||||
if (s->m_blob_cred)
|
||||
@ -354,7 +354,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
||||
_Out_ credentials_connection& cred_out,
|
||||
_In_ HANDLE hTokenImpersonateUser)
|
||||
{
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
// Unpack cached credentials.
|
||||
credentials_connection cred_in(*this, cfg);
|
||||
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.
|
||||
credentials_ttls *cred = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
||||
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);
|
||||
#endif
|
||||
|
||||
// Combine outer credentials.
|
||||
LPCTSTR _target_name = (dwFlags & EAP_FLAG_GUEST_ACCESS) == 0 ? target_name.c_str() : NULL;
|
||||
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,
|
||||
#else
|
||||
NULL,
|
||||
@ -401,7 +401,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
||||
|
||||
// Combine inner credentials.
|
||||
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,
|
||||
#else
|
||||
NULL,
|
||||
@ -447,7 +447,7 @@ eap::peer_ttls::session::session(_In_ module &mod) :
|
||||
m_cfg(mod),
|
||||
m_cred(mod, m_cfg),
|
||||
m_blob_cfg(NULL)
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
, m_blob_cred(NULL)
|
||||
#endif
|
||||
{}
|
||||
@ -458,7 +458,7 @@ eap::peer_ttls::session::~session()
|
||||
if (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)
|
||||
m_module.free_memory(m_blob_cred);
|
||||
#endif
|
||||
|
@ -153,7 +153,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
config_connection cfg(*this);
|
||||
unpack(cfg, pConnectionData, dwConnectionDataSize);
|
||||
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
// Unpack cached credentials.
|
||||
credentials_connection cred_in(*this, cfg);
|
||||
if (dwUserDataSize)
|
||||
@ -201,7 +201,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
cred_method.m_id = cfg_prov->m_id;
|
||||
credentials_ttls *_cred_method = dynamic_cast<credentials_ttls*>(cfg_method->make_credentials());
|
||||
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);
|
||||
#endif
|
||||
|
||||
@ -213,7 +213,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
|
||||
// Combine outer credentials.
|
||||
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,
|
||||
#else
|
||||
NULL,
|
||||
@ -223,7 +223,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
|
||||
// Combine inner credentials.
|
||||
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,
|
||||
#else
|
||||
NULL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user