From e0572524aa86e4a0b55dc2c6c1e51060c0088040 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 2 Feb 2017 14:01:12 +0100 Subject: [PATCH] __DANGEROUS__LOG_CONFIDENTIAL_DATA is now 0/1 #defined --- lib/EAPBase/include/EAP.h | 4 ++++ lib/EAPBase/include/Module.h | 8 ++++---- lib/EAPBase_UI/include/EAP_UI.h | 4 ++-- lib/EAPBase_UI/src/EAP_UI.cpp | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/EAPBase/include/EAP.h b/lib/EAPBase/include/EAP.h index 0b621ae..e98b921 100644 --- a/lib/EAPBase/include/EAP.h +++ b/lib/EAPBase/include/EAP.h @@ -25,6 +25,10 @@ #define EAP_ENCRYPT_BLOBS 1 #endif +#ifndef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#define __DANGEROUS__LOG_CONFIDENTIAL_DATA 0 +#endif + #ifndef EAP_USE_NATIVE_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 16d714a..4e32436 100644 --- a/lib/EAPBase/include/Module.h +++ b/lib/EAPBase/include/Module.h @@ -225,8 +225,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); @@ -240,8 +240,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 7d02ffe..dd0ba56 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -67,7 +67,7 @@ class wxEAPProviderLockedPanel; /// class wxEAPCredentialWarningPanel; -#ifdef __DANGEROUS__LOG_CONFIDENTIAL_DATA +#if __DANGEROUS__LOG_CONFIDENTIAL_DATA /// /// EAP credential logging enabled warning note /// @@ -452,7 +452,7 @@ public: }; -#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 8f73809..5c77afd 100644 --- a/lib/EAPBase_UI/src/EAP_UI.cpp +++ b/lib/EAPBase_UI/src/EAP_UI.cpp @@ -98,7 +98,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 } @@ -271,7 +271,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.