__DANGEROUS__LOG_CONFIDENTIAL_DATA is now 0/1 #defined

This commit is contained in:
2017-02-02 14:01:12 +01:00
parent decf8d0860
commit e0572524aa
4 changed files with 12 additions and 8 deletions

View File

@@ -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

View File

@@ -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);