diff --git a/lib/EAPBase/include/EAP.h b/lib/EAPBase/include/EAP.h index f98b63b..ada5370 100644 --- a/lib/EAPBase/include/EAP.h +++ b/lib/EAPBase/include/EAP.h @@ -28,12 +28,25 @@ /// @{ #ifndef EAP_ENCRYPT_BLOBS /// -/// BLOBs leaving our module are encrypted +/// Encrypt BLOBs leaving our module /// #define EAP_ENCRYPT_BLOBS 1 #endif /// @} +/// +/// \defgroup EAPBaseModule Modules +/// Modules +/// +/// @{ +#ifndef __DANGEROUS__LOG_CONFIDENTIAL_DATA +/// +/// Output passwords and other confidential information to event log +/// +#define __DANGEROUS__LOG_CONFIDENTIAL_DATA 0 +#endif +/// @} + /// /// \defgroup EAPBaseCred Credentials /// Credential management @@ -41,7 +54,7 @@ /// @{ #ifndef EAP_USE_NATIVE_CREDENTIAL_CACHE /// -/// Using EapHost credential cache +/// Use EapHost credential cache /// #define EAP_USE_NATIVE_CREDENTIAL_CACHE 0 #endif diff --git a/lib/EAPBase/include/Module.h b/lib/EAPBase/include/Module.h index 43d45e2..9109e8a 100644 --- a/lib/EAPBase/include/Module.h +++ b/lib/EAPBase/include/Module.h @@ -47,10 +47,7 @@ extern "C" { namespace eap { - /// - /// \defgroup EAPBaseModule Modules - /// Modules - /// + /// \addtogroup EAPBaseModule /// @{ /// @@ -236,8 +233,8 @@ namespace eap /// inline void log_config_discrete(_In_z_ LPCWSTR name, _In_z_ LPCWSTR value) const { -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA -#pragma message (__FILE__ "(" STRING(__LINE__) "): Warning: !!! DANGER !!! Passwords and certificates will be logged as a clear-text. Please, consider undefining __DANGEROUS__LOG_CONFIDENTIAL_DATA.") +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA +#pragma message (__FILE__ "(" STRING(__LINE__) "): Warning: !!! DANGER !!! Passwords and certificates will be logged as a clear-text. Please, consider setting __DANGEROUS__LOG_CONFIDENTIAL_DATA to 0.") log_config(name, value); #else log_config(name, value ? value[0] ? L"********" : L"" : NULL); @@ -255,8 +252,8 @@ namespace eap /// inline void log_config_discrete(_In_z_ LPCWSTR name, _In_bytecount_(size) const void *data, _In_ ULONG size) const { -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA -#pragma message (__FILE__ "(" STRING(__LINE__) "): Warning: !!! DANGER !!! Passwords and certificates will be logged as a clear-text. Please, consider undefining __DANGEROUS__LOG_CONFIDENTIAL_DATA.") +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA +#pragma message (__FILE__ "(" STRING(__LINE__) "): Warning: !!! DANGER !!! Passwords and certificates will be logged as a clear-text. Please, consider setting __DANGEROUS__LOG_CONFIDENTIAL_DATA to 0.") log_config(name, data, size); #else log_config(name, data ? size ? L"********" : L"" : NULL); diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 9276f06..fd1f424 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -34,7 +34,7 @@ class wxEAPCredentialsDialog; class wxEAPNotePanel; class wxEAPProviderLockedPanel; class wxEAPCredentialWarningPanel; -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA class wxEAPCredentialLogWarningPanel; #endif class wxEAPConfigWindow; @@ -477,7 +477,7 @@ public: /// /// EAP credential logging enabled warning note /// -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA class wxEAPCredentialLogWarningPanel : public wxEAPNotePanel { public: diff --git a/lib/EAPBase_UI/src/EAP_UI.cpp b/lib/EAPBase_UI/src/EAP_UI.cpp index 85709fd..f7a437f 100644 --- a/lib/EAPBase_UI/src/EAP_UI.cpp +++ b/lib/EAPBase_UI/src/EAP_UI.cpp @@ -102,7 +102,7 @@ wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov, // Set banner title. m_banner->m_title->SetLabel(wxString::Format(_("%s Credentials"), wxEAPGetProviderName(prov.m_name))); -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA AddContent(new wxEAPCredentialLogWarningPanel(this)); #endif } @@ -239,7 +239,7 @@ wxEAPCredentialWarningPanel::wxEAPCredentialWarningPanel(const eap::config_provi // wxEAPCredentialWarningPanel ////////////////////////////////////////////////////////////////////// -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA wxEAPCredentialLogWarningPanel::wxEAPCredentialLogWarningPanel(wxWindow* parent) : wxEAPNotePanel(parent) { // Load and set icon.