EAP_USE_NATIVE_CREDENTIAL_CACHE is now 0/1 #defined
This commit is contained in:
parent
8dcddb9ded
commit
6ef00f3fc2
@ -45,10 +45,7 @@ namespace eap
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// \defgroup EAPBaseCred Credentials
|
||||
/// Credential management
|
||||
///
|
||||
/// \addtogroup EAPBaseCred
|
||||
/// @{
|
||||
|
||||
///
|
||||
|
@ -28,12 +28,25 @@
|
||||
/// @{
|
||||
#ifndef EAP_ENCRYPT_BLOBS
|
||||
///
|
||||
/// Compiler variable to control whether BLOBs leaving our module get encrypted
|
||||
/// BLOBs leaving our module are encrypted
|
||||
///
|
||||
#define EAP_ENCRYPT_BLOBS 1
|
||||
#endif
|
||||
/// @}
|
||||
|
||||
///
|
||||
/// \defgroup EAPBaseCred Credentials
|
||||
/// Credential management
|
||||
///
|
||||
/// @{
|
||||
#ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
///
|
||||
/// Using EapHost credential cache
|
||||
///
|
||||
#define EAP_USE_NATIVE_CREDENTIAL_CACHE 0
|
||||
#endif
|
||||
/// @}
|
||||
|
||||
#define _HOST_LOW_ENDIAN
|
||||
|
||||
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)
|
||||
|
@ -198,7 +198,7 @@ namespace eap
|
||||
|
||||
// The following members are required to avoid memory leakage in get_result() and get_ui_context().
|
||||
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
|
||||
BYTE *m_blob_ui_ctx; ///< User Interface context data
|
||||
|
@ -342,7 +342,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)
|
||||
@ -426,7 +426,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)
|
||||
@ -451,7 +451,7 @@ 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
|
||||
|
||||
@ -460,7 +460,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
||||
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
||||
dwFlags,
|
||||
hTokenImpersonateUser,
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
has_cached ? cred_in.m_cred.get() : NULL,
|
||||
#else
|
||||
NULL,
|
||||
@ -476,7 +476,7 @@ const eap::config_method_ttls* eap::peer_ttls::combine_credentials(
|
||||
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
||||
dwFlags,
|
||||
hTokenImpersonateUser,
|
||||
#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,
|
||||
@ -522,7 +522,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
|
||||
m_blob_ui_ctx(NULL)
|
||||
@ -534,7 +534,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
|
||||
|
@ -159,7 +159,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)
|
||||
@ -214,7 +214,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
cred_out.m_id = cfg_prov->m_id;
|
||||
auto 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
|
||||
|
||||
@ -229,7 +229,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
eap::credentials::source_t src_outer = cred->credentials_tls::combine(
|
||||
dwFlags,
|
||||
NULL,
|
||||
#ifdef EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
#if EAP_USE_NATIVE_CREDENTIAL_CACHE
|
||||
has_cached ? cred_in.m_cred.get() : NULL,
|
||||
#else
|
||||
NULL,
|
||||
@ -273,7 +273,7 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
eap::credentials::source_t src_inner = cred->m_inner->combine(
|
||||
dwFlags,
|
||||
NULL,
|
||||
#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